From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 44321385703F for ; Tue, 12 Sep 2023 09:35:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 44321385703F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-CSE-ConnectionGUID: tYtjwwHPTeWwL3xjrmVSKA== X-CSE-MsgGUID: hurECogzQbqJ7jO2Qq1/lQ== X-IronPort-AV: E=Sophos;i="6.02,245,1688457600"; d="scan'208,223";a="16692168" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 12 Sep 2023 01:35:40 -0800 IronPort-SDR: 1PCVGfZ0dxUDzKiMEIOUdGP41FXNnbe/f/P1CO2tmwpa6AKaABvlp3OuhKG5vsGUQrwp4McX1i Q9G1PW4Q1a568SIWm+t9VYwoO5CZYjR+SCj/MxYIFONLjGSsCati0L76gF+fGYWQ5VQPuwPHFa rWVewVDw+ySOPo113yOdkGKsUPtBD2sPSZ9qQDgkxe7zl++H8LPUkskmPgfIOHd6PP+bUB+sGY GWni0KB703oWYi4i5goLI2wpX9rP4Rnnx0cSBe12jaOTBbJ0mOvJUqQRY40eLe3ru2tlWEHx1p 4Yo= From: Thomas Schwinge To: CC: Julian Brown , Chung-Lin Tang , "Maciej W. Rozycki" , "Rainer Orth" , Mike Stump , Iain Sandoe Subject: Pass 'SYSROOT_CFLAGS_FOR_TARGET' down to target libraries [PR109951] (was: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]) In-Reply-To: <875y868a4b.fsf@euler.schwinge.homeip.net> References: <6594B30D-743B-4B4C-81CE-11DD3EE87C8C@comcast.net> <20200103113421.51b55ff5@squid.athome> <875y868a4b.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Tue, 12 Sep 2023 11:35:33 +0200 Message-ID: <875y4fzqca.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,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 List-Id: --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi! On 2023-06-02T11:52:04+0200, I wrote: > On 2020-01-14T21:31:13+0800, Chung-Lin Tang wr= ote: >> I understand your situation with --with-build-sysroot/--without-sysroot,= [...] >> >> Can you test if the attached patch works for you? The patch exports the = build sysroot >> setting from the toplevel to target library subdirs, and adds the --sysr= oot=3D option >> when doing build-tree testing [...] > > Belatedly: thanks, I like that approach better indeed. > > This is, by the way, in line with what GCC compiler testing is doing; > 'gcc/Makefile.in': > > # Set if the compiler was configured with --with-build-sysroot. > SYSROOT_CFLAGS_FOR_TARGET =3D @SYSROOT_CFLAGS_FOR_TARGET@ > > # TEST_ALWAYS_FLAGS are flags that should be passed to every compilat= ion. > # They are passed first to allow individual tests to override them. > @echo "set TEST_ALWAYS_FLAGS \"$(SYSROOT_CFLAGS_FOR_TARGET)\"= " >> ./site.tmp > > That is, via 'site.exp', put 'SYSROOT_CFLAGS_FOR_TARGET' into > 'TEST_ALWAYS_FLAGS', which is "passed to every compilation". > >> [...], if this does work, then other library testsuites (e.g. libatomic.= exp) might >> also need considering updating, I think. > > Correct. (I'm offering to take care of that.) First, regarding the top-level build system part: >> 2020-01-14 Chung-Lin Tang >> >> * Makefile.tpl (NORMAL_TARGET_EXPORTS): Add export of >> SYSROOT_CFLAGS_FOR_TARGET variable. >> * Makefile.in: Regenerate. >> --- Makefile.tpl (revision 279954) >> +++ Makefile.tpl (working copy) >> @@ -322,6 +322,7 @@ RAW_CXX_TARGET_EXPORTS =3D \ >> >> NORMAL_TARGET_EXPORTS =3D \ >> $(BASE_TARGET_EXPORTS) \ >> + SYSROOT_CFLAGS_FOR_TARGET=3D"$(SYSROOT_CFLAGS_FOR_TARGET)"; export= SYSROOT_CFLAGS_FOR_TARGET; \ >> CXX=3D"$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; expor= t CXX; > > With that one moved into the generic 'BASE_TARGET_EXPORTS', [...] Pushed to master branch commit d1bff1ba4d470f6723be83c0e3c4d5083e51877a "Pass 'SYSROOT_CFLAGS_FOR_TARGET' down to target libraries [PR109951]", see attached. Gr=C3=BC=C3=9Fe Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-Pass-SYSROOT_CFLAGS_FOR_TARGET-down-to-target-librar.patch" >From d1bff1ba4d470f6723be83c0e3c4d5083e51877a Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 1 Jun 2023 23:07:37 +0200 Subject: [PATCH] Pass 'SYSROOT_CFLAGS_FOR_TARGET' down to target libraries [PR109951] ..., where we need to use it (separate commits) for build-tree testing, similar to 'gcc/Makefile.in:site.exp': # TEST_ALWAYS_FLAGS are flags that should be passed to every compilation. # They are passed first to allow individual tests to override them. @echo "set TEST_ALWAYS_FLAGS \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./site.tmp PR testsuite/109951 * Makefile.tpl (BASE_TARGET_EXPORTS): Add 'SYSROOT_CFLAGS_FOR_TARGET'. * Makefile.in: Regenerate. Co-authored-by: Chung-Lin Tang --- Makefile.in | 1 + Makefile.tpl | 1 + 2 files changed, 2 insertions(+) diff --git a/Makefile.in b/Makefile.in index c97130a2338..2f136839c35 100644 --- a/Makefile.in +++ b/Makefile.in @@ -321,6 +321,7 @@ BASE_TARGET_EXPORTS = \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ READELF="$(READELF_FOR_TARGET)"; export READELF; \ STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \ + SYSROOT_CFLAGS_FOR_TARGET="$(SYSROOT_CFLAGS_FOR_TARGET)"; export SYSROOT_CFLAGS_FOR_TARGET; \ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \ @if gcc-bootstrap diff --git a/Makefile.tpl b/Makefile.tpl index 36fa20950d4..5872dd03f2c 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -324,6 +324,7 @@ BASE_TARGET_EXPORTS = \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ READELF="$(READELF_FOR_TARGET)"; export READELF; \ STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \ + SYSROOT_CFLAGS_FOR_TARGET="$(SYSROOT_CFLAGS_FOR_TARGET)"; export SYSROOT_CFLAGS_FOR_TARGET; \ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \ @if gcc-bootstrap -- 2.34.1 --=-=-=--