Re: [PING] libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]
On 10/25/23 02:32, Thomas Schwinge wrote: Hi! Ping. Grüße Thomas On 2023-09-12T13:03:28+0200, I wrote: Hi! On 2020-04-04T00:00:44+0100, "Maciej W. Rozycki via Gcc-patches" wrote: Fix a problem with the libatomic testsuite using a method to determine the compiler to use resulting in the tool being different from one the library has been built with, and causing a catastrophic failure from the lack of a suitable `--sysroot=' option where the `--with-build-sysroot=' configuration option has been used to build the compiler resulting in the inability to link executables. Address this problem by providing a DejaGNU configuration file defining the compiler to use, via the GCC_UNDER_TEST TCL variable, set from $CC by autoconf, which will have all the required options set for the target compiler to build executables in the environment configured As we've found, this is conceptually problematic, as discussed in <https://inbox.sourceware.org/875y868a4b@euler.schwinge.homeip.net> "Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]". I therefore suggest to apply to libatomic the conceptually same changes as I've just pushed for libgomp: <https://inbox.sourceware.org/874jjzzqc2@euler.schwinge.homeip.net> "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]". OK to push the attached "libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]"? Also OK. Jeff
Re: [PING] libffi: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]
On 10/25/23 02:30, Thomas Schwinge wrote: Hi! Ping. Grüße Thomas On 2023-09-12T12:58:27+0200, I wrote: Hi! On 2020-04-20T14:18:40+0100, "Maciej W. Rozycki via Gcc-patches" wrote: Fix a problem with the libffi testsuite using a method to determine the compiler to use resulting in the tool being different from one the library has been built with, and causing a catastrophic failure from the inability to actually choose any compiler at all in a cross-compilation configuration. This has since, as far as I can tell, been resolved properly by H.J. Lu's GCC commit 5be7b66998127286fada45e4f23bd8a2056d553e, "libffi: Integrate build with GCC", and GCC commit 4824ed41ba7cd63e60fd9f8769a58b79935a90d1 "libffi: Integrate testsuite with GCC testsuite". Address this problem by providing a DejaGNU configuration file defining the compiler to use, via the CC_FOR_TARGET TCL variable, set from $CC by autoconf, which will have all the required options set for the target compiler to build executables in the environment configured As we've found, this is conceptually problematic, as discussed in <https://inbox.sourceware.org/875y868a4b....@euler.schwinge.homeip.net> "Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]". I therefore suggest to apply to GCC libffi the conceptually same changes as I've just pushed for libgomp: <https://inbox.sourceware.org/874jjzzqc2@euler.schwinge.homeip.net> "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]". OK to push the attached "libffi: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]"? OK (patch didn't appear inline, but hopefully you've got enough context to know it's the libffi bits getting ACK'd). jeff
[PING] libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH v4 1/5] libatomic/test: Fix compilation for b
Hi! Ping. Grüße Thomas On 2023-09-12T13:03:28+0200, I wrote: > Hi! > > On 2020-04-04T00:00:44+0100, "Maciej W. Rozycki via Gcc-patches" > wrote: >> Fix a problem with the libatomic testsuite using a method to determine >> the compiler to use resulting in the tool being different from one the >> library has been built with, and causing a catastrophic failure from the >> lack of a suitable `--sysroot=' option where the `--with-build-sysroot=' >> configuration option has been used to build the compiler resulting in >> the inability to link executables. >> >> Address this problem by providing a DejaGNU configuration file defining >> the compiler to use, via the GCC_UNDER_TEST TCL variable, set from $CC >> by autoconf, which will have all the required options set for the target >> compiler to build executables in the environment configured > > As we've found, this is conceptually problematic, as discussed in > <https://inbox.sourceware.org/875y868a4b....@euler.schwinge.homeip.net> > "Consider '--with-build-sysroot=[...]' for target libraries' build-tree > testing (instead of build-time 'CC' etc.) > [PR109951]". > I therefore suggest to apply to libatomic the conceptually same changes > as I've just pushed for libgomp: > <https://inbox.sourceware.org/874jjzzqc2@euler.schwinge.homeip.net> > "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' > build-tree testing (instead of build-time 'CC' > etc.) [PR91884, PR109951]". > OK to push the attached > "libatomic: Consider '--with-build-sysroot=[...]' for target libraries' > build-tree testing (instead of build-time 'CC' etc.) [PR109951]"? > > > 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 >From 584bfb74e802b94c490b963bd05ed520b5c6e453 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 11 Sep 2023 11:36:31 +0200 Subject: [PATCH] libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Similar to commit fb5d27be272b71fb9026224535fc73f125ce3be7 "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]", this is commit 5ff06d762a88077aff0fb637c931c64e6f47f93d "libatomic/test: Fix compilation for build sysroot" done differently, avoiding build-tree testing use of any random gunk that may appear in build-time 'CC'. PR testsuite/109951 libatomic/ * configure.ac: 'AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)'. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/Makefile.in: Likewise. * testsuite/lib/libatomic.exp (libatomic_init): If '--with-build-sysroot=[...]' was specified, use it for build-tree testing. * testsuite/libatomic-site-extra.exp.in (GCC_UNDER_TEST): Don't set. (SYSROOT_CFLAGS_FOR_TARGET): Set. --- libatomic/Makefile.in | 1 + libatomic/configure | 7 +-- libatomic/configure.ac | 2 ++ libatomic/testsuite/Makefile.in | 1 + libatomic/testsuite/lib/libatomic.exp | 5 + libatomic/testsuite/libatomic-site-extra.exp.in | 2 +- 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in index 83efe7d2694..2d2d64ee947 100644 --- a/libatomic/Makefile.in +++ b/libatomic/Makefile.in @@ -328,6 +328,7 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZES = @SIZES@ STRIP = @STRIP@ +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ VERSION = @VERSION@ XCFLAGS = @XCFLAGS@ XLDFLAGS = @XLDFLAGS@ diff --git a/libatomic/configure b/libatomic/configure index 57f320753e1..629ad22e833 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -656,6 +656,7 @@ LIBAT_BUILD_VERSIONED_SHLIB_FALSE LIBAT_BUILD_VERSIONED_SHLIB_TRUE OPT_LDFLAGS SECTION_LDFLAGS +SYSROOT_CFLAGS_FOR_TARGET enable_aarch64_lse libtool_VERSION MAINT @@ -11402,7 +11403,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11405 "configure" +#line 11406 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11508,7 +11509,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11511 "configure&q
[PING] libffi: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH v5 GCC] libffi/test: Fix compilation for build s
Hi! Ping. Grüße Thomas On 2023-09-12T12:58:27+0200, I wrote: > Hi! > > On 2020-04-20T14:18:40+0100, "Maciej W. Rozycki via Gcc-patches" > wrote: >> Fix a problem with the libffi testsuite using a method to determine the >> compiler to use resulting in the tool being different from one the >> library has been built with, and causing a catastrophic failure from the >> inability to actually choose any compiler at all in a cross-compilation >> configuration. > > This has since, as far as I can tell, been resolved properly by H.J. Lu's > GCC commit 5be7b66998127286fada45e4f23bd8a2056d553e, > "libffi: Integrate build with GCC", and > GCC commit 4824ed41ba7cd63e60fd9f8769a58b79935a90d1 > "libffi: Integrate testsuite with GCC testsuite". > >> Address this problem by providing a DejaGNU configuration file defining >> the compiler to use, via the CC_FOR_TARGET TCL variable, set from $CC by >> autoconf, which will have all the required options set for the target >> compiler to build executables in the environment configured > > As we've found, this is conceptually problematic, as discussed in > <https://inbox.sourceware.org/875y868a4b....@euler.schwinge.homeip.net> > "Consider '--with-build-sysroot=[...]' for target libraries' build-tree > testing (instead of build-time 'CC' etc.) [PR109951]". > I therefore suggest to apply to GCC libffi the conceptually same changes > as I've just pushed for libgomp: > <https://inbox.sourceware.org/874jjzzqc2@euler.schwinge.homeip.net> > "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' > build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]". > OK to push the attached > "libffi: Consider '--with-build-sysroot=[...]' for target libraries' > build-tree testing (instead of build-time 'CC' etc.) [PR109951]"? > > > 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 >From 8b8654d04dcbb7f0a5947bc21efc5b9c60b3b6c6 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 11 Sep 2023 10:50:00 +0200 Subject: [PATCH] libffi: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Similar to commit fb5d27be272b71fb9026224535fc73f125ce3be7 "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]", this is commit a0b48358cb1e70e161a87ec5deb7a4b25defba6b "libffi/test: Fix compilation for build sysroot" done differently, avoiding build-tree testing use of any random gunk that may appear in build-time 'CC', 'CXX'. PR testsuite/109951 libffi/ * configure.ac: 'AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)'. : Don't set 'CC_FOR_TARGET', 'CXX_FOR_TARGET', instead set 'SYSROOT_CFLAGS_FOR_TARGET'. * Makefile.in: Regenerate. * configure: Likewise. * include/Makefile.in: Likewise. * man/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. * testsuite/lib/libffi.exp (libffi_target_compile): If '--with-build-sysroot=[...]' was specified, use it for build-tree testing. --- libffi/Makefile.in | 1 + libffi/configure| 10 ++ libffi/configure.ac | 5 +++-- libffi/include/Makefile.in | 1 + libffi/man/Makefile.in | 1 + libffi/testsuite/Makefile.in| 1 + libffi/testsuite/lib/libffi.exp | 7 +++ 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/libffi/Makefile.in b/libffi/Makefile.in index 1d936b5c8a5..3a55212cc00 100644 --- a/libffi/Makefile.in +++ b/libffi/Makefile.in @@ -383,6 +383,7 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ TARGET = @TARGET@ TARGETDIR = @TARGETDIR@ TARGET_OBJ = @TARGET_OBJ@ diff --git a/libffi/configure b/libffi/configure index 9eac9c907bf..f1efd6987a3 100755 --- a/libffi/configure +++ b/libffi/configure @@ -666,6 +666,7 @@ TESTSUBDIR_TRUE MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE +SYSROOT_CFLAGS_FOR_TARGET READELF CXXCPP CPP @@ -11634,7 +11635,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11637 "configure" +#line 11638 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11740,7 +11741,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11743 "configure" +#line 11744 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15137,9 +15138,10 @@ _ACEOF + + cat > local.exp < local.exp <
Re: libgo: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH 3/4] libgo/test: Fix compilation for build sysroot)
On Tue, Sep 12, 2023 at 4:16 AM Thomas Schwinge wrote: > > As we've found, this is conceptually problematic, as discussed in > <https://inbox.sourceware.org/875y868a4b@euler.schwinge.homeip.net> > "Consider '--with-build-sysroot=[...]' for target libraries' build-tree > testing (instead of build-time 'CC' etc.) > [PR109951]". > I therefore suggest to apply to libgo the conceptually same changes > as I've just pushed for libgomp: > <https://inbox.sourceware.org/874jjzzqc2@euler.schwinge.homeip.net> > "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' > build-tree testing (instead of build-time 'CC' > etc.) [PR91884, PR109951]". > OK to push (via Ian/Go upstream) the attached > "libgo: Consider '--with-build-sysroot=[...]' for target libraries' > build-tree testing (instead of build-time 'CC' etc.) [PR109951]"? > > By the way, I've tested this one via hard-coding > 'libgo/configure.ac:USE_DEJAGNU' to 'yes', and observing that my > "quick hack to replicate the original requirement" > ('internal_error ("MISSING SYSROOT");') no longer triggers. Thanks. Committed. Ian
libgo: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH 3/4] libgo/test: Fix compilation for build sysroot)
Hi! On 2019-11-11T18:12:44+, "Maciej W. Rozycki" wrote: > Fix a problem with the libgo testsuite using a method to determine the > compiler to use resulting in the tool being different from one the > library has been built with, and causing a catastrophic failure from the > lack of a suitable `--sysroot=' option where the `--with-build-sysroot=' > configuration option has been used to build the compiler resulting in > the inability to link executables. > > Address this problem by providing a DejaGNU configuration file defining > the compiler to use, via the GOC_UNDER_TEST TCL variable, set from $GOC > by autoconf, which will have all the required options set for the target > compiler to build executables in the environment configured As we've found, this is conceptually problematic, as discussed in <https://inbox.sourceware.org/875y868a4b....@euler.schwinge.homeip.net> "Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]". I therefore suggest to apply to libgo the conceptually same changes as I've just pushed for libgomp: <https://inbox.sourceware.org/874jjzzqc2@euler.schwinge.homeip.net> "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]". OK to push (via Ian/Go upstream) the attached "libgo: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]"? By the way, I've tested this one via hard-coding 'libgo/configure.ac:USE_DEJAGNU' to 'yes', and observing that my "quick hack to replicate the original requirement" ('internal_error ("MISSING SYSROOT");') no longer triggers. 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 >From 81a73112e3d0b43c240c7c9040c24d68c2739bf3 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 11 Sep 2023 16:55:24 +0200 Subject: [PATCH] libgo: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Similar to commit fb5d27be272b71fb9026224535fc73f125ce3be7 "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]", this is commit b72813a68c943643a6241418f27aa8b9d4614647 "libgo: fix DejaGNU testsuite compiler when using build sysroot" done differently, avoiding build-tree testing use of any random gunk that may appear in build-time 'GOC'. PR testsuite/109951 libgo/ * configure.ac: 'AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)'. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/Makefile.in: Likewise. * testsuite/lib/libgo.exp (libgo_init): If '--with-build-sysroot=[...]' was specified, use it for build-tree testing. * testsuite/libgo-test-support.exp.in (GOC_UNDER_TEST): Don't set. (SYSROOT_CFLAGS_FOR_TARGET): Set. --- libgo/Makefile.in | 1 + libgo/configure | 7 +-- libgo/configure.ac| 2 ++ libgo/testsuite/Makefile.in | 1 + libgo/testsuite/lib/libgo.exp | 8 libgo/testsuite/libgo-test-support.exp.in | 2 +- 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 40340bfb7a5..8dcb6d6a354 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -474,6 +474,7 @@ SPLIT_STACK = @SPLIT_STACK@ STRINGOPS_FLAG = @STRINGOPS_FLAG@ STRIP = @STRIP@ STRUCT_EPOLL_EVENT_FD_OFFSET = @STRUCT_EPOLL_EVENT_FD_OFFSET@ +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ USE_DEJAGNU = @USE_DEJAGNU@ VERSION = @VERSION@ WARN_FLAGS = @WARN_FLAGS@ diff --git a/libgo/configure b/libgo/configure index a607dbff68e..2f1609b42b5 100755 --- a/libgo/configure +++ b/libgo/configure @@ -633,6 +633,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +SYSROOT_CFLAGS_FOR_TARGET HAVE_STATIC_LINK_FALSE HAVE_STATIC_LINK_TRUE HAVE_STAT_TIMESPEC_FALSE @@ -11544,7 +11545,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11547 "configure" +#line 11548 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11650,7 +11651,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown
libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH v4 1/5] libatomic/test: Fix compilation for build sy
Hi! On 2020-04-04T00:00:44+0100, "Maciej W. Rozycki via Gcc-patches" wrote: > Fix a problem with the libatomic testsuite using a method to determine > the compiler to use resulting in the tool being different from one the > library has been built with, and causing a catastrophic failure from the > lack of a suitable `--sysroot=' option where the `--with-build-sysroot=' > configuration option has been used to build the compiler resulting in > the inability to link executables. > > Address this problem by providing a DejaGNU configuration file defining > the compiler to use, via the GCC_UNDER_TEST TCL variable, set from $CC > by autoconf, which will have all the required options set for the target > compiler to build executables in the environment configured As we've found, this is conceptually problematic, as discussed in <https://inbox.sourceware.org/875y868a4b....@euler.schwinge.homeip.net> "Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]". I therefore suggest to apply to libatomic the conceptually same changes as I've just pushed for libgomp: <https://inbox.sourceware.org/874jjzzqc2@euler.schwinge.homeip.net> "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]". OK to push the attached "libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]"? 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 >From 584bfb74e802b94c490b963bd05ed520b5c6e453 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 11 Sep 2023 11:36:31 +0200 Subject: [PATCH] libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Similar to commit fb5d27be272b71fb9026224535fc73f125ce3be7 "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]", this is commit 5ff06d762a88077aff0fb637c931c64e6f47f93d "libatomic/test: Fix compilation for build sysroot" done differently, avoiding build-tree testing use of any random gunk that may appear in build-time 'CC'. PR testsuite/109951 libatomic/ * configure.ac: 'AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)'. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/Makefile.in: Likewise. * testsuite/lib/libatomic.exp (libatomic_init): If '--with-build-sysroot=[...]' was specified, use it for build-tree testing. * testsuite/libatomic-site-extra.exp.in (GCC_UNDER_TEST): Don't set. (SYSROOT_CFLAGS_FOR_TARGET): Set. --- libatomic/Makefile.in | 1 + libatomic/configure | 7 +-- libatomic/configure.ac | 2 ++ libatomic/testsuite/Makefile.in | 1 + libatomic/testsuite/lib/libatomic.exp | 5 + libatomic/testsuite/libatomic-site-extra.exp.in | 2 +- 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in index 83efe7d2694..2d2d64ee947 100644 --- a/libatomic/Makefile.in +++ b/libatomic/Makefile.in @@ -328,6 +328,7 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZES = @SIZES@ STRIP = @STRIP@ +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ VERSION = @VERSION@ XCFLAGS = @XCFLAGS@ XLDFLAGS = @XLDFLAGS@ diff --git a/libatomic/configure b/libatomic/configure index 57f320753e1..629ad22e833 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -656,6 +656,7 @@ LIBAT_BUILD_VERSIONED_SHLIB_FALSE LIBAT_BUILD_VERSIONED_SHLIB_TRUE OPT_LDFLAGS SECTION_LDFLAGS +SYSROOT_CFLAGS_FOR_TARGET enable_aarch64_lse libtool_VERSION MAINT @@ -11402,7 +11403,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11405 "configure" +#line 11406 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11508,7 +11509,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11511 "configure" +#line 11512 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11866,6 +11867,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; esac + + # Get target configury. . ${srcdir}/configur
libffi: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] (was: [PATCH v5 GCC] libffi/test: Fix compilation for build sysroot)
Hi! On 2020-04-20T14:18:40+0100, "Maciej W. Rozycki via Gcc-patches" wrote: > Fix a problem with the libffi testsuite using a method to determine the > compiler to use resulting in the tool being different from one the > library has been built with, and causing a catastrophic failure from the > inability to actually choose any compiler at all in a cross-compilation > configuration. This has since, as far as I can tell, been resolved properly by H.J. Lu's GCC commit 5be7b66998127286fada45e4f23bd8a2056d553e, "libffi: Integrate build with GCC", and GCC commit 4824ed41ba7cd63e60fd9f8769a58b79935a90d1 "libffi: Integrate testsuite with GCC testsuite". > Address this problem by providing a DejaGNU configuration file defining > the compiler to use, via the CC_FOR_TARGET TCL variable, set from $CC by > autoconf, which will have all the required options set for the target > compiler to build executables in the environment configured As we've found, this is conceptually problematic, as discussed in <https://inbox.sourceware.org/875y868a4b....@euler.schwinge.homeip.net> "Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]". I therefore suggest to apply to GCC libffi the conceptually same changes as I've just pushed for libgomp: <https://inbox.sourceware.org/874jjzzqc2@euler.schwinge.homeip.net> "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]". OK to push the attached "libffi: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]"? 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 >From 8b8654d04dcbb7f0a5947bc21efc5b9c60b3b6c6 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 11 Sep 2023 10:50:00 +0200 Subject: [PATCH] libffi: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Similar to commit fb5d27be272b71fb9026224535fc73f125ce3be7 "libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951]", this is commit a0b48358cb1e70e161a87ec5deb7a4b25defba6b "libffi/test: Fix compilation for build sysroot" done differently, avoiding build-tree testing use of any random gunk that may appear in build-time 'CC', 'CXX'. PR testsuite/109951 libffi/ * configure.ac: 'AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)'. : Don't set 'CC_FOR_TARGET', 'CXX_FOR_TARGET', instead set 'SYSROOT_CFLAGS_FOR_TARGET'. * Makefile.in: Regenerate. * configure: Likewise. * include/Makefile.in: Likewise. * man/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. * testsuite/lib/libffi.exp (libffi_target_compile): If '--with-build-sysroot=[...]' was specified, use it for build-tree testing. --- libffi/Makefile.in | 1 + libffi/configure| 10 ++ libffi/configure.ac | 5 +++-- libffi/include/Makefile.in | 1 + libffi/man/Makefile.in | 1 + libffi/testsuite/Makefile.in| 1 + libffi/testsuite/lib/libffi.exp | 7 +++ 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/libffi/Makefile.in b/libffi/Makefile.in index 1d936b5c8a5..3a55212cc00 100644 --- a/libffi/Makefile.in +++ b/libffi/Makefile.in @@ -383,6 +383,7 @@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ TARGET = @TARGET@ TARGETDIR = @TARGETDIR@ TARGET_OBJ = @TARGET_OBJ@ diff --git a/libffi/configure b/libffi/configure index 9eac9c907bf..f1efd6987a3 100755 --- a/libffi/configure +++ b/libffi/configure @@ -666,6 +666,7 @@ TESTSUBDIR_TRUE MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE +SYSROOT_CFLAGS_FOR_TARGET READELF CXXCPP CPP @@ -11634,7 +11635,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11637 "configure" +#line 11638 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11740,7 +11741,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11743 "configure" +#line 11744 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15137,9 +15138,10 @@ _ACEOF + + cat > local.exp < local.exp <
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])
Hi! On 2023-06-02T11:52:04+0200, I wrote: > On 2020-01-14T21:31:13+0800, Chung-Lin Tang 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 >> >> * 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 >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
Re: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]
Hi Thomas, > Will you, Maciej, please test that this doesn't break your setting? Umm, this was implemented for my Western Digital development environment, which I don't have access to anymore. I'll see what I can do, but it may be neither easy nor quick. It's been long ago and I don't have a setup with multilibs enabled anymore. And neither I remember the thorough problem analysis I went through that has led me to the conclusions. I've come across my note, in a reply to Chung-Lin's concerns, about using libgomp.exp as a standalone test driver. Has this been verified somehow with your proposed change? Also I've skimmed over your change and this has caught my eye: > diff --git a/libgomp/configure.ac b/libgomp/configure.ac > index 1aad83a79da..49f7fb0dc82 100644 > --- a/libgomp/configure.ac > +++ b/libgomp/configure.ac > @@ -151,22 +151,11 @@ AC_SUBST(enable_static) > > AM_MAINTAINER_MODE > > -# We optionally test libgomp C++ support, and for that want to use the proper > -# C++ driver, 'g++' (or 'xg++' for build-tree testing). Given that build of > -# target libstdc++-v3 depends on target libgomp (see '../Makefile.def'), we > -# cannot make build of target libgomp depend on target libstdc++-v3: circular > -# dependency. We thus cannot instantiate 'AC_PROG_CXX' here: we'd get > -# '-funconfigured-libstdc++-v3' (see '../configure.ac'). Therefore, just > -# capture 'CXX', and we'll fix this up at 'make check' time (see > -# 'testsuite/lib/libgomp.exp:libgomp_init'). > -AC_SUBST(CXX) > - > # Create a spec file, so that compile/link tests don't fail > test -f libgfortran.spec || touch libgfortran.spec > FCFLAGS="$FCFLAGS -L." > > -# We need 'gfortran' to compile parts of the library, and test libgomp > Fortran > -# support. > +# We need gfortran to compile parts of the library > # We can't use AC_PROG_FC because it expects a fully working gfortran. -- missing full stop here, and I suggest to just make all this comment one paragraph (I can't imagine why it's not already, as the second sentence is clearly a continuation of the first one). I think a proper change description would be good too, as otherwise one may wonder why you have removed all the stuff above, and what this change is about anyway. Maciej
Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]
lappend ALWAYS_CFLAGS > "additional_flags=--sysroot=$SYSROOT_CFLAGS_FOR_TARGET" > + } Need 'global SYSROOT_CFLAGS_FOR_TARGET'. Need to change: - lappend ALWAYS_CFLAGS "additional_flags=--sysroot=$SYSROOT_CFLAGS_FOR_TARGET" + lappend ALWAYS_CFLAGS "additional_flags=$SYSROOT_CFLAGS_FOR_TARGET" ..., as 'SYSROOT_CFLAGS_FOR_TARGET' already includes '--sysroot=' prefix. > --- libgomp/testsuite/libgomp-test-support.exp.in (revision 279954) > +++ libgomp/testsuite/libgomp-test-support.exp.in (working copy) > @@ -1,5 +1,3 @@ > -set GCC_UNDER_TEST {@CC@} Also need to capture 'SYSROOT_CFLAGS_FOR_TARGET' here, so that it's then available at test time. > --- 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', adapting things to the current state of affaris plus some polishing, the attached "Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]" appears to be doing the right thing per my (limited, so far) testing. Will you, Maciej, please test that this doesn't break your setting? Will you, Iain, please test that this does address <https://gcc.gnu.org/PR109951> "libgomp, testsuite: non-native multilib c++ tests fail on Darwin"? Anybody got any other comments? Once that's all clear, we may either push this one already, and then I work on applying the same changes to other target libraries incrementally, or do all that at once. I suppose: "push this one already", to restore Iain's testing as well as giving these changes some wider exposure, and in parallel "I work on applying the same changes to other target libraries incrementally"? 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 >From ab5d1d3ef91b2ad7e1ed262c9487f727b79ceb3f Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 1 Jun 2023 23:07:37 +0200 Subject: [PATCH] Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] PR testsuite/109951 * Makefile.tpl (BASE_TARGET_EXPORTS): Add 'SYSROOT_CFLAGS_FOR_TARGET'. * Makefile.in: Regenerate. libgomp/ * configure.ac: Revert earlier changes, instead 'AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)'. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/Makefile.in: Likewise. * testsuite/lib/libgomp.exp (libgomp_init): Remove "Fix up '-funconfigured-libstdc++-v3' in 'GXX_UNDER_TEST'" code. If '--with-build-sysroot=[...]' was specified, use it for build-tree testing. * testsuite/libgomp-site-extra.exp.in (GCC_UNDER_TEST) (GXX_UNDER_TEST, GFORTRAN_UNDER_TEST): Don't set. (SYSROOT_CFLAGS_FOR_TARGET): Set. * testsuite/libgomp.c++/c++.exp (lang_source_re) (lang_include_flags): Set for build-tree testing. * testsuite/libgomp.oacc-c++/c++.exp (lang_source_re) (lang_include_flags): Likewise. Co-authored-by: Chung-Lin Tang --- Makefile.in | 1 + Makefile.tpl| 1 + libgomp/Makefile.in | 2 +- libgomp/configure | 17 - libgomp/configure.ac| 15 +++ libgomp/testsuite/Makefile.in | 2 +- libgomp/testsuite/lib/libgomp.exp | 18 +- libgomp/testsuite/libgomp-site-extra.exp.in | 4 +--- libgomp/testsuite/libgomp.c++/c++.exp | 6 ++ libgomp/testsuite/libgomp.oacc-c++/c++.exp | 6 ++ 10 files changed, 29 insertions(+), 43 deletions(-) diff --git a/Makefile.in b/Makefile.in index b559454cc90..e75bd98bde5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -320,6 +320,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 WI