From patchwork Tue May 14 21:47:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 1099755 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-500700-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="CrJwTmMY"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="SduwVeZp"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="IvCvX+qI"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 453WWg3yP9z9sDn for ; Wed, 15 May 2019 07:47:59 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:content-id:content-transfer-encoding:mime-version; q=dns; s=default; b=Wy+HbGXJD+7TptNoG8N2t/LMhyYXUao8xj02E6L/dun ySBXPv+kVdVj+SLtvQga1ltRfcPssAnS/xFb4cDvcN4rZ+uGCetiCav7HOEqUPbJ uGAO8kXyrxah6/llBIK1YIzgXGGEgvJ6YjSSWrgl3LJwFtMeyzwfs3OZSiIts8aE = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:content-id:content-transfer-encoding:mime-version; s=default; bh=nAomIM5MdJuU4SByt8HvB9TS0yg=; b=CrJwTmMYaelUQmTFW oOXfcaDcIr5qdiuO8MOwf6hwFa8C1RGkCtOVO2ECid0remDgt22HWjXtIGfEJuNx hpu2RJ72+3tblmnFsnK6YuQV8KFV+yzkPbWod+pyTWWJpHMTR7SCDGZ+nCk3eodW HjBc7/vzfDM08c34T2zr4iCRC8= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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:45 +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-ID: <0F0DEE80F3B238489232F3E37F54916E@namprd04.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED 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=' switch is actually rejected: gnatmake: invalid switch: --sysroot=... likely because it is one of the very few GCC driver options that have a leading double dash and therefore we don't have a blanket fall-through for such switches that would satisfy what our documentation claims. The option is actually shared between the compiler and the linker, so pass the switch to both build stages if requested, removing GNAT testsuite issues like: gnatmake: invalid switch: --sysroot=.../sysroot compiler exited with status 1 Executing on host: .../gcc/gnatclean -c -q -n ./abstract_with_anonymous_result (timeout = 300) spawn -ignore SIGHUP .../gcc/gnatclean -c -q -n ./abstract_with_anonymous_result PASS: gnat.dg/abstract_with_anonymous_result.adb (test for excess errors) UNRESOLVED: gnat.dg/abstract_with_anonymous_result.adb compilation failed to produce executable in a test environment where `--with-build-sysroot=.../sysroot' has been used to build a cross-compiler. Passing to the compilation stage only 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_result (timeout = 300) spawn -ignore SIGHUP .../gcc/gnatclean -c -q -n ./abstract_with_anonymous_result ./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 to produce executable instead. gcc/ada/ * make.adb (Scan_Make_Arg): Also accept `--sysroot=' for the compiler and the linker. --- Hi, I think treating `--sysroot=' like this makes sense, as otherwise it'd have to be specified twice, once with `-largs' and the second time optionally with `-cargs'. It's consistent with how `--param=' is handled. I'm not sure if this peculiarity should be mentioned in the manual; it surely is not for the existing `--param=' switch. Unfortunately I have exhausted the limit of changes I can make to GCC without my WDC copyright paperwork sorted with FSF. OK to apply once that 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 =================================================================== --- gcc.orig/gcc/ada/make.adb +++ gcc/gcc/ada/make.adb @@ -4516,7 +4516,9 @@ package body Make is end; end if; - elsif Argv'Length >= 8 and then Argv (1 .. 8) = "--param=" then + elsif (Argv'Length >= 8 and then Argv (1 .. 8) = "--param=") + or (Argv'Length >= 10 and then Argv (1 .. 10) = "--sysroot=") + then Add_Switch (Argv, Compiler); Add_Switch (Argv, Linker); From patchwork Tue May 14 21:48:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 1099756 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-500701-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="iILfPstw"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="P0Jn6mCN"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="jfB3Ip/8"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 453WXk1NG9z9sB8 for ; Wed, 15 May 2019 07:48:52 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:content-id:content-transfer-encoding:mime-version; q=dns; s=default; b=yOCE7mWH+5sII+RQGy+Xf3Iu0lNaNABtpdsnydm7gwD xFLZAN6NR1CX9nNxFN1cjIVVT2KJB8tE6FQ/UONUkPr6jIwoJAVZAv7lynOGWG8Z muoI2f+T+zHlSYqrPTET8G/GILioMTfVSbsfGy9RmoXxNXHmVEMtx4kSu3iLX3VE = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:content-id:content-transfer-encoding:mime-version; s=default; bh=xJhTgUnTHpzTsPqnSiDaR7uF9zY=; b=iILfPstw+KjJwP9ZC rKfRSkZZJMDzvMvTYEJKr7x9m1EInstuz+QT86Aldtrq/vq6ewfHzLLmuQEH6MLF DxXh3uI9vKCbgq6rEAfrBxZ3aZS0K2zC4U7oRzKaFX80fe4fZ+RNN/3BlrLjIreo U9tkBL8u8dYYWEaRYZ/FZFAfLo= Received: (qmail 72917 invoked by alias); 14 May 2019 21:48:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 72729 invoked by uid 89); 14 May 2019 21:48:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=sk:gcc-tes, arranges 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:48:33 +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=1557870504; x=1589406504; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=+ItcCxaPN54uENWK28ZU5FWrJnq7hJ3e11ntdF/lruk=; b=P0Jn6mCNXPQi//Ho4365cl9FYrUtegcl/KAUP5jXRwcZq8ZXxoXXRVLQ zy+s7W6N6yBVHAoTNaBVhRX0uVjpUoQ8hGhOVjNoYV033qHLX2rzkav6s 8j1nndyxTS7Lw8y3ddpqRH3RVIiZOuV95KCnRgXUBoVqInB0C6HRcAsep UoUIm6Avvo+p2jRFhhQL8QFg9GddThjU1N9t8DPwEky6RBFf/DOotD7bz zuUkvLbES2TttcddRtXFsLFwr3aA6kDjsijejXvhRfjhH0IGBhIEX1NQU ePBxBjL5RMWEj4C6J+aUVIaS3Ki6B1uVzDBMz+g5cLG1OO3anSvUEsdPJ g==; Received: from mail-bn3nam01lp2055.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([104.47.33.55]) by ob1.hgst.iphmx.com with ESMTP; 15 May 2019 05:48:22 +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=9X8NW7guo4cEqljPaqk/o96YznJLLiLTAN7tPxbhAng=; b=jfB3Ip/8J2dO4QNxjwEE3+rqt1eR4SXTBW87z3GmHiIYvXFVhBAdseIr2KCY7M2abQgE987RJUmQ/fO/KrDQuGxiM9Hrzpf15qV3cVTw3Z8nK4toH7OAWzvbrUrJYFUuMpQcgQcq2dwlF9FdkVAYU7u/Srd7am+mQ2orMOPCLoo= 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:48:20 +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:48:20 +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 2/3][GCC] GNAT/testsuite: Pass the `ada' option to target compilation Date: Tue, 14 May 2019 21:48:20 +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:8882; x-ms-exchange-senderadcheck: 1 Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED Pass the `ada' option to DejaGNU's `target_compile' procedure, which by default calls `default_target_compile', so that it arranges for an Ada compilation rather the default of C. We set the compiler to `gnatmake' manually here, so that part of the logic in `default_target_compile' is not used, but it affects other settings, such as the use of `adaflags'. gcc/testsuite/ * lib/gnat.exp (gnat_target_compile): Pass the `ada' option to `target_compile'. --- Hi, Unfortunately I have exhausted the limit of changes I can make to GCC without my WDC copyright paperwork sorted with FSF. OK to apply once that has been completed? Maciej --- gcc/testsuite/lib/gnat.exp | 2 ++ 1 file changed, 2 insertions(+) gcc-test-gnat-options-ada.diff Index: gcc/gcc/testsuite/lib/gnat.exp =================================================================== --- gcc.orig/gcc/testsuite/lib/gnat.exp +++ gcc/gcc/testsuite/lib/gnat.exp @@ -167,6 +167,8 @@ proc gnat_target_compile { source dest t set options [concat "additional_flags=$TOOL_OPTIONS" $options] } + set options [concat "{ada}" $options] + return [target_compile $source $dest $type $options] } From patchwork Tue May 14 21:49:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 1099757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-500702-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="sCPSFMp8"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="Y+9iLziV"; dkim=pass (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="KOAmK1nH"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 453WYQ1kWrz9sB8 for ; Wed, 15 May 2019 07:49:30 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:content-id:content-transfer-encoding:mime-version; q=dns; s=default; b=JSxzA+zpIbTSGv8DLMjNcEXFqrVcp4G4O2giQsLXBIL mWkK7tt3WSI/jjmp6Tgv+6SekddYhzuK78gmlCZxIdEo73fExkcfyRP/EFCX0zQ7 /yhQciX+OuQbjVE3wlC38lJj13rfDWWzr8urMGiwzqtbNmUpWYn89Z4HP+Xt2GOk = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:content-id:content-transfer-encoding:mime-version; s=default; bh=jV7BfKQI7hyzsa/geTnb6qdUZbg=; b=sCPSFMp895zKyZfMf 8UZjgkjjlU+5XXj55aMviGg/oxoegvIQqlnzdEbdsWhOHgR6uzZiYC6VMEp4C5Rh 6iGKMJnSJgTKLfGxGR05LwNFmesTE6WA0TpBqzNWPcZqETcIOdS/tsIcWRXrsiWs VlGl2kSs4+RMaDds17Sdc6BRd4= Received: (qmail 74607 invoked by alias); 14 May 2019 21:49:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 74598 invoked by uid 89); 14 May 2019 21:49:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= 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:49:19 +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=1557870559; x=1589406559; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=ZJdbC/+Xwz7faykM6MnNmQEx0SQ84wcHJXmRSQGxQr4=; b=Y+9iLziVz08D/twRStEbrJ5d5hGOhamw1hAB1xzb3tR721G+p3PlJngW l4ws5oP9f4q75QmKh0StdvhCpwm9+bNxx8JaK22rLBZhR12cCEB0NJ8kn 2DzhjvtpfIMW3+bxUdx2Xpbn41zKJMTGcXSu3Ei3MgNCL/CFFrapdvQ0L dK0vb+YojETv3N6JNIFUbbHBUtVcPjtYlIXkPU0dvP/dBTuhRy4tm4N8d gN09kMbdU2gbsnR/FBzHjXoa5QD5YTeFk1g3yYv8aAfu2CDhftYChTq5T skDFE2my7Cy9oEACQaz95PEOcjS3h/776G1uwr7NjXemNedPtwP+ffLPl Q==; Received: from mail-bn3nam01lp2056.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([104.47.33.56]) by ob1.hgst.iphmx.com with ESMTP; 15 May 2019 05:49:17 +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=ewGa0KrRfH/77o8eLfCpZRWhNx9dqPQFHu2Go5T4avs=; b=KOAmK1nHczheS7ghvgOk6yZBSgZrxjGMz/dgsqaui7cFvP/1+r0wtGQAy5Vik7Bc/9tgTt1GFUvbPVGN9HpLoPf8JADtvAtRGU/b5VlWtq+jE/h9hbK08rj7yXltIufcGcRKxGJ9wVlJj6nw3unG5rK2unFwvKUJOvicreWctPM= 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:49:15 +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:49:15 +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 3/3][DejaGNU] target: Wrap linker flags into `-largs'/`-margs' for Ada Date: Tue, 14 May 2019 21:49:15 +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-ID: <1AB7B94D00F9AB4F989FB126DE48D12D@namprd04.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED Unrecognized `gnatmake' switches are not implicitly passed on to the linker, so just pasting board `ldflags' and any other linker flags verbatim into `add_flags' to use for the invocation line of `gnatmake' will make them ignored at best. For example in a GCC test environment that has: set_board_info ldflags "-Wl,-dynamic-linker,.../sysroot/lib/ld-linux-riscv64-lp64d.so.1 -Wl,-rpath,.../sysroot/lib64/lp64d -Wl,-rpath,.../sysroot/usr/lib64/lp64d" so that sysroot paths are correctly embedded with the binaries linked for use with the dynamic loader and shared library dependencies, the setting will be ignored for the GNAT test suite making all the execution tests fail, e.g.: PASS: gnat.dg/abstract_with_anonymous_result.adb (test for excess errors) spawn qemu-riscv64 ./abstract_with_anonymous_result.exe /lib/ld-linux-riscv64-lp64d.so.1: No such file or directory FAIL: gnat.dg/abstract_with_anonymous_result.adb execution test For `gnatmake' to pass switches on to the linker the `-largs' switch has to be used, which affects all the switches that follow until a switch is seen that changes the selection, like `-margs', which resets to the initial state of the switch interpretation machine. Wrap linker flags into `-largs'/`-margs' for Ada then, carefully preserving the place these flags are placed within `add_flags', as surely someone will have depended on that, correcting test failures like above: PASS: gnat.dg/abstract_with_anonymous_result.adb (test for excess errors) spawn qemu-riscv64 ./abstract_with_anonymous_result.exe PASS: gnat.dg/abstract_with_anonymous_result.adb execution test * lib/target.exp (default_target_compile): Wrap linker flags into `-largs'/`-margs' for Ada. Signed-off-by: Maciej W. Rozycki --- Hi, My WDC copyright paperwork has not been sorted with FSF yet, however I have not contributed to DejaGNU on behalf of WDC so far and I believe this change falls within the limit of roughly 15 lines to be considered legally insignificant given that: "A regular series of repeated changes, such as renaming a symbol, is not legally significant even if the symbol has to be renamed in many places." Please apply then; this does not rely on 2/3 in any way, as we ought to handle Ada compilations correctly regardless of whether our caller does the right thing there. Maciej --- lib/target.exp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) dejagnu-target-ada-ldflags.diff Index: dejagnu/lib/target.exp =================================================================== --- dejagnu.orig/lib/target.exp +++ dejagnu/lib/target.exp @@ -518,11 +518,12 @@ proc default_target_compile {source dest } if { $type eq "executable" } { + set extra_ldflags "" if {[board_info $dest exists ldflags]} { - append add_flags " [board_info $dest ldflags]" + append extra_ldflags " [board_info $dest ldflags]" } if { $compiler_type eq "c++" } { - append add_flags " [g++_link_flags]" + append extra_ldflags " [g++_link_flags]" } if {[isnative]} { # This is a lose. @@ -530,16 +531,23 @@ proc default_target_compile {source dest if { $tmp ne "" } { if {[regexp ".*solaris2.*" $target_triplet]} { # Solaris 2 - append add_flags " -R$tool_root_dir/libstdc++" + append extra_ldflags " -R$tool_root_dir/libstdc++" } elseif {[regexp ".*(osf|irix5|linux).*" $target_triplet]} { # OSF/1 or IRIX 5 - append add_flags " -Wl,-rpath,$tool_root_dir/libstdc++" + append extra_ldflags " -Wl,-rpath,$tool_root_dir/libstdc++" } elseif {[regexp ".*hppa.*" $target_triplet]} { # HP-UX - append add_flags " -Wl,-a,shared_archive" + append extra_ldflags " -Wl,-a,shared_archive" } } } + if { $extra_ldflags ne "" } { + if { $compiler_type eq "ada" } { + append add_flags " -largs $extra_ldflags -margs" + } else { + append add_flags " $extra_ldflags" + } + } } if {![info exists ldscript]} { @@ -561,7 +569,11 @@ proc default_target_compile {source dest } if { $type eq "executable" } { - append add_flags " $ldflags" + if { $compiler_type eq "ada" } { + append add_flags " -largs $ldflags -margs" + } else { + append add_flags " $ldflags" + } foreach x $libs { if {[file exists $x]} { append source " $x"