From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92138 invoked by alias); 11 Feb 2020 08:35:33 -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 92101 invoked by uid 89); 11 Feb 2020 08:35:31 -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,KAM_ASCII_DIVIDERS autolearn=ham version=3.3.1 spammy=formally, HX-Languages-Length:4545 X-HELO: esa3.mentor.iphmx.com Received: from esa3.mentor.iphmx.com (HELO esa3.mentor.iphmx.com) (68.232.137.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Feb 2020 08:35:30 +0000 IronPort-SDR: Jtcfqtz8Ibyu027jRWDtZJEyH8iMX+QtMatkD18Pky8DwKEWq2nHIyfnzDPxeGvOl5RlFz5RSK NTLtZBjpTH7u+nlXv/kIiNaRy5BS6SPsAksFIVagYb0XqNebWfHBvixaQOdZWmmHRjqBRG9POa EpWOfbEftNsX7Vhe7yus97f1Qte6Yq6iMATX4GNaeEzoI198g/nTo9YsGoBCLOt9bWAhfp4xWV Fdb9x/KRuDmVzoh+r8/yiEy/uUODWnVCa2txBWKY0CTNmKKphoVJkmAW0Qux+m0eTZKLqjioV5 M28= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 11 Feb 2020 00:35:28 -0800 IronPort-SDR: rYyf+CMdBe5/zLH5b2ZUi+RPO/TICTHE/LR+mVQSEtHIIeOCnghTR/zxY9opOdnZ5HNSM7FmZN 8aYswSXDSALn8Fa8cVngUq7/gtFcNDG8Tqm5PrKG+ilQIQU/CAgps7natkjaaf8cR2U9sKhDIr pvz6HwdzFHoTrr66eK58HbJg2uCJH5b4PeTjjfYFUtIN3XWnDanFeK6QoDmdvLUuRpRtLeIzxt se/JcknDCPAchbLI0xA1Pp7/RQhQZwLWJPsPAd20kmPm8QswwfxFBUFRBF/5e+gCWeckmg3eTa gkg= Reply-To: Subject: Re: [PING^4][PATCH 0/4] Fix library testsuite compilation for build sysroot To: "Maciej W. Rozycki" , CC: Julian Brown , Mike Stump , , Thomas Schwinge References: <6594B30D-743B-4B4C-81CE-11DD3EE87C8C@comcast.net> <20200103113421.51b55ff5@squid.athome> From: Chung-Lin Tang Message-ID: <8a502b40-43d6-8e55-7fa6-1e4ed0f111f6@mentor.com> Date: Tue, 11 Feb 2020 08:35:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Return-Path: chunglin_tang@mentor.com X-SW-Source: 2020-02/txt/msg00633.txt.bz2 Hi Maciej, sorry for the late reply. On 2020/2/1 5:46 AM, Maciej W. Rozycki wrote: > On Tue, 21 Jan 2020, Maciej W. Rozycki wrote: > >> I'll give your proposal a shot and I'm lucky enough to have a build >> configuration where I can have no compiler preinstalled, so at least I can >> check if testing with your change applied correctly picks the newly built >> uninstalled compiler in that case. > > So it does seem to pick the right uninstalled compiler, however without > the sysroot option and therefore all tests fail either like: > > .../bin/riscv64-linux-gnu-ld: cannot find crt1.o: No such file or directory > .../bin/riscv64-linux-gnu-ld: cannot find -lm > collect2: error: ld returned 1 exit status > compiler exited with status 1 > FAIL: libgomp.c/../libgomp.c-c++-common/depend-iterator-2.c (test for excess errors) > > or like: > > .../libgomp/testsuite/libgomp.c/../libgomp.c-c++-common/cancel-parallel-1.c:4:10: fatal error: stdlib.h: No such file or directory > compilation terminated. > compiler exited with status 1 > FAIL: libgomp.c/../libgomp.c-c++-common/cancel-parallel-1.c (test for excess errors) Weird that the --sysroot option doesn't properly get down there. I'll try to whip up a similar environment later to really test this myself if I have time. As for your patch... > I am somewhat wary about picking the compiler options to pass selectively > anyway. However the change below does not do that and works for me and I > think it should be fine for your use case too. Please confirm. > > I'm yet verifying the other libraries with corresponding changes and will > formally submit v2 of this series once that has completed. > > Apologies for the slightly long RTT with this update. > > Maciej The 'AM_RUNTESTFLAGS = --tool_exec "$(CC)"' does work for us, but only because you backed out the change from libgomp-test-support.exp, and our installed testing doesn't use the libgomp/testsuite/Makefile.* files (we invoke runtest using another script). From the code in libgomp/testsuite/lib/libgomp.exp:libgomp_init(): ... if ![info exists GCC_UNDER_TEST] then { if [info exists TOOL_EXECUTABLE] { set GCC_UNDER_TEST $TOOL_EXECUTABLE } else { set GCC_UNDER_TEST "[find_gcc]" } } So essentially this patch is the same as the prior one, and still blocks the usual find_gcc logic from ever getting control (as long as we use the in-tree 'make check'). I'm not sure that is the right thing to do... That said, I don't have anything further against this patch. Okay for me. (I do still think that actually detecting the right in-tree compiler and giving the correct sysroot options from the configuration is the more proper approach, maybe later) Thanks, Chung-Lin > --- > libgomp/testsuite/Makefile.am | 1 + > libgomp/testsuite/Makefile.in | 1 + > libgomp/testsuite/libgomp-test-support.exp.in | 2 -- > 3 files changed, 2 insertions(+), 2 deletions(-) > > gcc-test-libgomp-runtestflags-tool-exec.diff > Index: gcc/libgomp/testsuite/Makefile.am > =================================================================== > --- gcc.orig/libgomp/testsuite/Makefile.am > +++ gcc/libgomp/testsuite/Makefile.am > @@ -11,6 +11,7 @@ EXPECT = $(shell if test -f $(top_buildd > _RUNTEST = $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \ > echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi) > RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir > +AM_RUNTESTFLAGS = --tool_exec "$(CC)" > > # Instead of directly in ../testsuite/libgomp-test-support.exp.in, the > # following variables have to be "routed through" this Makefile, for expansion > Index: gcc/libgomp/testsuite/Makefile.in > =================================================================== > --- gcc.orig/libgomp/testsuite/Makefile.in > +++ gcc/libgomp/testsuite/Makefile.in > @@ -308,6 +308,7 @@ _RUNTEST = $(shell if test -f $(top_srcd > echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi) > > RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir > +AM_RUNTESTFLAGS = --tool_exec "$(CC)" > all: all-am > > .SUFFIXES: > Index: gcc/libgomp/testsuite/libgomp-test-support.exp.in > =================================================================== > --- gcc.orig/libgomp/testsuite/libgomp-test-support.exp.in > +++ gcc/libgomp/testsuite/libgomp-test-support.exp.in > @@ -1,5 +1,3 @@ > -set GCC_UNDER_TEST {@CC@} > - > set cuda_driver_include "@CUDA_DRIVER_INCLUDE@" > set cuda_driver_lib "@CUDA_DRIVER_LIB@" > set hsa_runtime_lib "@HSA_RUNTIME_LIB@" >