From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70660 invoked by alias); 14 May 2019 21:47:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 70647 invoked by uid 89); 14 May 2019 21:47:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=sk:gcc-gna, sk:gccgna X-HELO: esa3.hgst.iphmx.com Received: from esa3.hgst.iphmx.com (HELO esa3.hgst.iphmx.com) (216.71.153.141) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 May 2019 21:47:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1557870470; x=1589406470; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=P3D/h1wWy756Ctk1CTJxQ9pCgbAyopIgtuPB2At0ruY=; b=SduwVeZpD9jJa/KaRzTtLGL+h7pIL7s59/UIIHwHEeqkiLh2YmFTWEKn ryzL2KjjlTfUtg/2nC8z6PyDuQsfRPq3NNlWbsjqNyzaHkqwOmtakS6za 52zu+KHr7ZrZQGfU3tppF+hKkywF3KOxBrKOomju8wa86Jt/xid4idyVK HZlodaiL5w90hfDE46iRtAgLNMMhYHnGqWmCGhEZCVHszfHzYQYXj1Cc3 UMsA8rHp4aJHExInzCjfWgA85IsE6CDLbcfN4qJy1k9me7zJsKT8XplwN RQkRpFS6bBvG5m4KLITuObZz/FsiV4OBh31DT28mSeRok3lN87cMEVssR A==; Received: from mail-bn3nam01lp2059.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([104.47.33.59]) by ob1.hgst.iphmx.com with ESMTP; 15 May 2019 05:47:48 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b0V8jjsYG6O0Oy/wSGztNhIsJkHDRBFLdKlKY7igSeM=; b=IvCvX+qIA6UqN0js7JOqo0ny+Ern62aNQZSnop1MjcMBSh0muM2Bpus6GpZrqg6RLP6gmrPW51xq86MEQpkjfcwrhHoPbBktbM2SvZsvLz1OoZ9KMgylY4Rl6T/Scq4ottYE2KeB3NCqqv/Fed52BXTli/GIL5kv2kx0gANrLxU= Received: from BYAPR04MB6262.namprd04.prod.outlook.com (20.178.235.160) by BYAPR04MB4856.namprd04.prod.outlook.com (52.135.232.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.16; Tue, 14 May 2019 21:47:46 +0000 Received: from BYAPR04MB6262.namprd04.prod.outlook.com ([fe80::31ee:c691:33ca:b46b]) by BYAPR04MB6262.namprd04.prod.outlook.com ([fe80::31ee:c691:33ca:b46b%3]) with mapi id 15.20.1878.024; Tue, 14 May 2019 21:47:46 +0000 From: "Maciej W. Rozycki" To: "gcc-patches@gcc.gnu.org" , "dejagnu@gnu.org" CC: Arnaud Charlet , Eric Botcazou , Pierre-Marie de Rodat Subject: [PATCH 1/3][GCC] gnatmake: Accept the `--sysroot=' GCC driver option Date: Tue, 14 May 2019 21:47:00 -0000 Message-ID: References: In-Reply-To: authentication-results: spf=none (sender IP is ) smtp.mailfrom=macro@wdc.com; wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 Content-Type: text/plain; charset="us-ascii" Content-ID: <0F0DEE80F3B238489232F3E37F54916E@namprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-SW-Source: 2019-05/txt/msg00753.txt.bz2 According to `gnatmake' documentation: "Any uppercase or multi-character switch that is not a 'gnatmake' switch is passed to 'gcc' (e.g., '-O', '-gnato,' etc.)" however the `--sysroot=3D' switch is actually rejected: gnatmake: invalid switch: --sysroot=3D... likely because it is one of the very few GCC driver options that have a=20 leading double dash and therefore we don't have a blanket fall-through=20 for such switches that would satisfy what our documentation claims. The option is actually shared between the compiler and the linker, so=20 pass the switch to both build stages if requested, removing GNAT=20 testsuite issues like: gnatmake: invalid switch: --sysroot=3D.../sysroot compiler exited with status 1 Executing on host: .../gcc/gnatclean -c -q -n ./abstract_with_anonymous_res= ult (timeout =3D 300) spawn -ignore SIGHUP .../gcc/gnatclean -c -q -n ./abstract_with_anonymous_r= esult PASS: gnat.dg/abstract_with_anonymous_result.adb (test for excess errors) UNRESOLVED: gnat.dg/abstract_with_anonymous_result.adb compilation failed t= o produce executable in a test environment where `--with-build-sysroot=3D.../sysroot' has been=20 used to build a cross-compiler. Passing to the compilation stage only=20 would lead to errors like: .../bin/riscv64-linux-gnu-ld: cannot find crt1.o: No such file or directory .../bin/riscv64-linux-gnu-ld: cannot find -lc collect2: error: ld returned 1 exit status gnatlink: error when calling .../gcc/xgcc gnatmake: *** link failed. compiler exited with status 1 Executing on host: .../gcc/gnatclean -c -q -n ./abstract_with_anonymous_res= ult (timeout =3D 300) spawn -ignore SIGHUP .../gcc/gnatclean -c -q -n ./abstract_with_anonymous_r= esult ./abstract_with_anonymous_result.ali ./abstract_with_anonymous_result.o FAIL: gnat.dg/abstract_with_anonymous_result.adb (test for excess errors) Excess errors: .../bin/riscv64-linux-gnu-ld: cannot find crt1.o: No such file or directory .../bin/riscv64-linux-gnu-ld: cannot find -lc gnatlink: error when calling .../gcc/xgcc UNRESOLVED: gnat.dg/abstract_with_anonymous_result.adb compilation failed t= o produce executable instead. gcc/ada/ * make.adb (Scan_Make_Arg): Also accept `--sysroot=3D' for the=20 compiler and the linker. --- Hi, I think treating `--sysroot=3D' like this makes sense, as otherwise it'd=20 have to be specified twice, once with `-largs' and the second time=20 optionally with `-cargs'. It's consistent with how `--param=3D' is handled. I'm not sure if this peculiarity should be mentioned in the manual; it=20 surely is not for the existing `--param=3D' switch. Unfortunately I have exhausted the limit of changes I can make to GCC=20 without my WDC copyright paperwork sorted with FSF. OK to apply once that= =20 has been completed? Maciej --- gcc/ada/make.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) gcc-gnatmake-sysroot.diff Index: gcc/gcc/ada/make.adb =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc.orig/gcc/ada/make.adb +++ gcc/gcc/ada/make.adb @@ -4516,7 +4516,9 @@ package body Make is end; end if; =20 - elsif Argv'Length >=3D 8 and then Argv (1 .. 8) =3D "--param=3D" = then + elsif (Argv'Length >=3D 8 and then Argv (1 .. 8) =3D "--param=3D") + or (Argv'Length >=3D 10 and then Argv (1 .. 10) =3D "--sysroot= =3D") + then Add_Switch (Argv, Compiler); Add_Switch (Argv, Linker); =20