From: Thomas Schwinge <thomas@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: Julian Brown <julian@codesourcery.com>,
Chung-Lin Tang <cltang@codesourcery.com>,
"Maciej W. Rozycki" <macro@orcam.me.uk>,
"Rainer Orth" <ro@CeBiTec.Uni-Bielefeld.DE>,
Mike Stump <mikestump@comcast.net>,
Iain Sandoe <idsandoe@googlemail.com>
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])
Date: Tue, 12 Sep 2023 11:35:33 +0200 [thread overview]
Message-ID: <875y4fzqca.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <875y868a4b.fsf@euler.schwinge.homeip.net>
[-- Attachment #1: Type: text/plain, Size: 2489 bytes --]
Hi!
On 2023-06-02T11:52:04+0200, I wrote:
> On 2020-01-14T21:31:13+0800, Chung-Lin Tang <chunglin_tang@mentor.com> wrote:
>> 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 --sysroot= 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 = @SYSROOT_CFLAGS_FOR_TARGET@
>
> # 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
>
> 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 <cltang@codesourcery.com>
>>
>> * 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 = \
>>
>> NORMAL_TARGET_EXPORTS = \
>> $(BASE_TARGET_EXPORTS) \
>> + SYSROOT_CFLAGS_FOR_TARGET="$(SYSROOT_CFLAGS_FOR_TARGET)"; export SYSROOT_CFLAGS_FOR_TARGET; \
>> CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export 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üße
Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Pass-SYSROOT_CFLAGS_FOR_TARGET-down-to-target-librar.patch --]
[-- Type: text/x-diff, Size: 1914 bytes --]
From d1bff1ba4d470f6723be83c0e3c4d5083e51877a Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
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 <cltang@codesourcery.com>
---
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
next prev parent reply other threads:[~2023-09-12 9:35 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 18:12 [PATCH 0/4] Fix library testsuite compilation for build sysroot Maciej W. Rozycki
2019-11-11 18:12 ` [PATCH 1/4] libatomic/test: Fix " Maciej W. Rozycki
2019-11-11 18:12 ` [PATCH 2/4] libffi/test: " Maciej W. Rozycki
2019-11-11 18:23 ` [golang-dev] [PATCH 0/4] Fix library testsuite " Ulderico Cirello
2019-11-11 18:29 ` Kaz Kylheku (libffi)
2019-11-11 18:42 ` Ian Lance Taylor
2019-11-11 18:35 ` Ian Lance Taylor
2019-11-11 18:45 ` Maciej W. Rozycki
2019-11-11 23:29 ` Ian Lance Taylor
2019-11-11 18:44 ` Maciej W. Rozycki
2019-11-26 15:56 ` [PING][PATCH " Maciej W. Rozycki
2019-12-02 14:49 ` [PING^2][PATCH " Maciej W. Rozycki
2019-12-09 21:30 ` [PING^3][PATCH " Maciej W. Rozycki
2019-12-17 0:06 ` [PING^4][PATCH " Maciej W. Rozycki
2019-12-21 1:30 ` Mike Stump
2019-12-22 1:34 ` Maciej W. Rozycki
2020-01-03 11:34 ` Julian Brown
2020-01-06 15:25 ` Maciej W. Rozycki
2020-01-09 21:00 ` Tobias Burnus
2020-01-14 13:43 ` Chung-Lin Tang
2020-01-21 3:21 ` Maciej W. Rozycki
2020-01-31 22:36 ` Maciej W. Rozycki
2020-02-11 8:35 ` Chung-Lin Tang
2020-02-11 21:31 ` Maciej W. Rozycki
2023-06-02 9:52 ` Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Thomas Schwinge
2023-06-03 20:32 ` Maciej W. Rozycki
2023-09-12 9:35 ` libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951] (was: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]) Thomas Schwinge
2023-09-12 9:35 ` Thomas Schwinge [this message]
2020-01-06 15:47 ` [PING^5][PATCH 0/4] Fix library testsuite compilation for build sysroot Maciej W. Rozycki
2020-01-13 21:20 ` [PING^6][PATCH " Maciej W. Rozycki
2020-01-21 2:44 ` [PING^7][PATCH " Maciej W. Rozycki
2020-01-26 21:07 ` Jeff Law
2020-02-13 23:37 ` Maciej W. Rozycki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875y4fzqca.fsf@euler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=cltang@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=idsandoe@googlemail.com \
--cc=julian@codesourcery.com \
--cc=macro@orcam.me.uk \
--cc=mikestump@comcast.net \
--cc=ro@CeBiTec.Uni-Bielefeld.DE \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).