From patchwork Thu Aug 1 15:17:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 95082 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 20552386486F for ; Thu, 1 Aug 2024 15:42:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id EEAF73861822 for ; Thu, 1 Aug 2024 15:18:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EEAF73861822 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EEAF73861822 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722525514; cv=none; b=dUGPsWm0WVGYwC1u+txOGrywlNQhqYJRwQlcgue37ReT9o0bpsFhwG19Flm2Qfxgbi8aKPn19yNJ8amlMzOlEAoiikakjOYmoPRWR+aJ5WVWDOdyVdlUWBZhtKZiUDfI935THPYOITIhUbE7A0TDZV2ZJ0VvoZLUv4FYEsYW8o4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722525514; c=relaxed/simple; bh=O6EFumWvgSJTht9u+etN8d3EWAB6oRwQIsS8gI0rYwE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uE6S4WCq8eoWjvY/BM1KX5KVzMV0pw0/3ZtsxYkgNCMSE/PrDL73ygwB/uJ502zq6VMZ4uP4yMK+eJKoMyGW3iUdJ9h0/csO6f67DmV3LkSy+1k1terzXZRoz9gFFVNyWN5Uwc3itAYiR8HvysjIxj+jZIgSHgSgFHXmJcIBHYY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3687fb526b9so3455671f8f.0 for ; Thu, 01 Aug 2024 08:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1722525503; x=1723130303; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oiJq7kzQWv4FJjKgZQ8uTHzWGvrrGTlczTcr3dKT8Gs=; b=JPDrqdtHdIlgo/+4Gt9X6vRLqS0H2dNPp5SSKu2UYcMKbYN6G2vOhGPf4PWWZkR4do 5ij5hxFPOjbCofP9Dkpe5CCvxfZNsm1mD1Q9KuhvdatqMLYd1Yw5OAI3ZvfACq6Q5iEH EFIEfxbsK47mDdGx28XhekQxmcfxhK3R+zTkNDcoW28atM+tar9J2NtOhn9TxGAjtFOC qrNhcmnVCut8bcRvvV/1UG6aJNZoJu2dVdgGv1NcHNEZPK2UtovqX1c7kt+vEh8nQlOf n5eGU6F2C/4twfYB95PPCEG6w7vwE6dC2Bl8lasJljY9sROSabvSC0wrUUq0JfBJTGZC DltA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722525503; x=1723130303; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oiJq7kzQWv4FJjKgZQ8uTHzWGvrrGTlczTcr3dKT8Gs=; b=p0xfpW0Bes30pt11odaWER7RaVteBWPS3p34Hkg+YtdvOZz+4dNHkKr2Dq5xqLoKQ8 y8sdAm9x16oc2ZWFkHwog7OocQGaQPy3WElRcMu+VUWW3G1/KsP7wnCvfgMAH331F+kR dBfm+CYEQilKuSD59JLJVkXEcGYUoKvZxV2Z8sW9SJ11ACyxB/Z24DZOMEnH/xNam4Lu Ch/fkqwCpFTTvqyGNxU8dlYFqlByfP6UuKMELDSEgeTMP1dSSo6KyY8mO68/KIFa0f6G 8qB40KkOzwVxGSwhrBV5QsMg3Owdn4dnwHF/79VepfIXIn3nER6rbBeer9AxPk2X22tn kx7w== X-Gm-Message-State: AOJu0Yyz7dhoFjrO65guMQHQ7wiKzMyIH4uVZBmten+vc7Jjid/nCY9j 6cVdrrd5b+W7LCI7MsKfRwKFgTJysm1bnzfiBOhqOkFnmR7K4PX+0e05hbUxxGCWmY0XP3y7dzU mOg== X-Google-Smtp-Source: AGHT+IHz+dGLhhZ6DWzFeKQ3jGGeHAILOb9R8jEbufLKR2xiI4gD1bmkk9woLLFX0jl2RlrkKHbOSg== X-Received: by 2002:a5d:5274:0:b0:367:8ff5:5858 with SMTP id ffacd0b85a97d-36bbc1d346dmr119894f8f.56.1722525503586; Thu, 01 Aug 2024 08:18:23 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:b6aa:4751:9ea1:da1e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b36857fdesm20065995f8f.75.2024.08.01.08.18.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 08:18:23 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Arnaud Charlet Subject: [COMMITTED 17/30] ada: Put back -G for binder Date: Thu, 1 Aug 2024 17:17:25 +0200 Message-ID: <20240801151738.400796-17-poulhies@adacore.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240801151738.400796-1-poulhies@adacore.com> References: <20240801151738.400796-1-poulhies@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org From: Arnaud Charlet gcc/ada/ * bindgen.adb (Gen_Main): Put back support for -G * bindusg.adb (Display): Put back line for -G * opt.ads (CCG_Mode): Update doc * switch-b.adb (Scan_Binder_Switches): Put back support for -G Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/bindgen.adb | 1 + gcc/ada/bindusg.adb | 5 +++++ gcc/ada/opt.ads | 4 +++- gcc/ada/switch-b.adb | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index cdfaa08d8a6..57c97d966c9 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -2113,6 +2113,7 @@ package body Bindgen is if Bind_Main_Program and then not Minimal_Binder and then not CodePeer_Mode + and then not CCG_Mode then WBI (" Ensure_Reference : aliased System.Address := " & "Ada_Main_Program_Name'Address;"); diff --git a/gcc/ada/bindusg.adb b/gcc/ada/bindusg.adb index e870c5f0e22..855fd16c930 100644 --- a/gcc/ada/bindusg.adb +++ b/gcc/ada/bindusg.adb @@ -133,6 +133,11 @@ package body Bindusg is Write_Line (" -F Force checking of elaboration Flags"); + -- Line for -G switch + + Write_Line + (" -G Generate binder file suitable for CCG"); + -- Line for -h switch Write_Line diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index cc3723e1daa..dd0c8b38954 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -261,7 +261,9 @@ package Opt is -- (switch -B) CCG_Mode : Boolean := False; - -- Set to True when running as CCG (either via -gnatceg or via -emit-c) + -- GNAT, GNATBIND + -- Set to True when running as CCG (implicitly, via -emit-c, or -G for the + -- binder) Check_Aliasing_Of_Parameters : Boolean := False; -- GNAT diff --git a/gcc/ada/switch-b.adb b/gcc/ada/switch-b.adb index 7cc0b8f0e3d..729855bd5fe 100644 --- a/gcc/ada/switch-b.adb +++ b/gcc/ada/switch-b.adb @@ -362,6 +362,12 @@ package body Switch.B is Debugger_Level := 2; end if; + -- Processing for G switch + + when 'G' => + Ptr := Ptr + 1; + CCG_Mode := True; + -- Processing for h switch when 'h' =>