public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] Fix library testsuite compilation for build sysroot
@ 2020-04-03 23:00 Maciej W. Rozycki
  2020-04-03 23:00 ` [PATCH v4 1/5] libatomic/test: Fix " Maciej W. Rozycki
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2020-04-03 23:00 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jeff Law, Mike Stump, Chung-Lin Tang, Ian Lance Taylor

Hi,

 This is v4 of patch series, originally posted here:

<https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00767.html>
<https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00768.html>
<https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00769.html>
<https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00770.html>

v2 posted here:

<https://gcc.gnu.org/ml/gcc-patches/2020-02/msg00827.html>
<https://gcc.gnu.org/ml/gcc-patches/2020-02/msg00828.html>
<https://gcc.gnu.org/ml/gcc-patches/2020-02/msg00829.html>
<https://gcc.gnu.org/ml/gcc-patches/2020-02/msg00830.html>

and v3 posted here:

<https://gcc.gnu.org/ml/gcc-patches/2020-02/msg01592.html>
<https://gcc.gnu.org/ml/gcc-patches/2020-02/msg01593.html>
<https://gcc.gnu.org/ml/gcc-patches/2020-02/msg01594.html>
<https://gcc.gnu.org/ml/gcc-patches/2020-02/msg01595.html>

meant to address a problem with the testsuite compiler being set up across 
libatomic, libffi, libgo, libgomp with no correlation whatsoever to the 
target compiler being used in GCC compilation.  Consequently there in no 
arrangement made to set up the compilation sysroot according to the build 
sysroot specified for GCC compilation, causing a catastrophic failure 
across the testsuites affected from the inability to link executables.

 In the course of discussion it has been determined it might be the best 
if we sync with libffi rather than providing our replacement solution, as 
the upstream version has it addressed, although in a slightly messy way.  
I have therefore decided to clean it up with upstream libffi and propose a 
corresponding backport of the change to be included with our version.  
This has resulted in two patches actually, replacing 2/4 from the original 
series.  The remaining changes are the same as in v3, however Chung-Lin 
has since confirmed the libgomp change proposed here has addressed issues 
with testing in his environment (thank you, Chung-Lin!).

 Verified with a cross-compiler configured for the `riscv-linux-gnu' 
target and the `x86_64-linux-gnu' host and using RISC-V/Linux QEMU in the 
user emulation mode as the target board.  Also no change in results with 
`x86_64-linux-gnu' native regression testing.

 See individual change descriptions for details.

 I'm assuming Ian will take care of the 4/5 libgo change (Ian, it's up to 
you if you want to have it or not).

 Any objections about 1/5 previously approved by Jeff, and OK to apply 2/5 
and 3/5 (if the corresponding changes have been accepted into upstream 
libffi), as well as 5/5 to the GCC repo?

  Maciej


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v4 1/5] libatomic/test: Fix compilation for build sysroot
  2020-04-03 23:00 [PATCH v4 0/5] Fix library testsuite compilation for build sysroot Maciej W. Rozycki
@ 2020-04-03 23:00 ` Maciej W. Rozycki
  2020-04-06 18:10   ` Jeff Law
  2023-09-12 11:03   ` 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 sysroot) Thomas Schwinge
  2020-04-03 23:01 ` [PATCH v4 GCC 2/5] libffi/test: Fix compilation for build sysroot Maciej W. Rozycki
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2020-04-03 23:00 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jeff Law, Mike Stump, Chung-Lin Tang, Ian Lance Taylor

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, removing 
failures 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: libatomic.c/atomic-compare-exchange-1.c (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 -lm

UNRESOLVED: libatomic.c/atomic-compare-exchange-1.c compilation failed to produce executable

and bringing overall test results for the `riscv64-linux-gnu' target 
(here with the `x86_64-linux-gnu' host and RISC-V QEMU in the Linux user 
emulation mode as the target board) from:

		=== libatomic Summary ===

# of unexpected failures	27
# of unresolved testcases	27

to:

		=== libatomic Summary ===

# of expected passes		54

	libatomic/
	* configure.ac: Add testsuite/libatomic-site-extra.exp to output 
	files.
	* configure: Regenerate.
	* libatomic/testsuite/libatomic-site-extra.exp.in: New file.
	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New 
	variable.
	* testsuite/Makefile.in: Regenerate.
---
No change from v3.

Changes from v2:

- Revert to v1.

- Rename testsuite/libatomic-test-support.exp.in to 
  testsuite/libatomic-site-extra.exp.in.

Changes from v1:

- Remove testsuite/libatomic-test-support.exp.in and the associated
  changes.

- Pass $(CC) via `--tool_exec' in $(AM_RUNTESTFLAGS).
---
 libatomic/configure                             |    3 +++
 libatomic/configure.ac                          |    1 +
 libatomic/testsuite/Makefile.am                 |    2 ++
 libatomic/testsuite/Makefile.in                 |    5 ++++-
 libatomic/testsuite/libatomic-site-extra.exp.in |    1 +
 5 files changed, 11 insertions(+), 1 deletion(-)

gcc-test-libatomic-gcc-under-test.diff
Index: gcc/libatomic/configure
===================================================================
--- gcc.orig/libatomic/configure
+++ gcc/libatomic/configure
@@ -15728,6 +15728,8 @@ fi
 
 ac_config_files="$ac_config_files Makefile testsuite/Makefile"
 
+ac_config_files="$ac_config_files testsuite/libatomic-site-extra.exp"
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -16799,6 +16801,7 @@ do
     "gstdint.h") CONFIG_COMMANDS="$CONFIG_COMMANDS gstdint.h" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
+    "testsuite/libatomic-site-extra.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libatomic-site-extra.exp" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
Index: gcc/libatomic/configure.ac
===================================================================
--- gcc.orig/libatomic/configure.ac
+++ gcc/libatomic/configure.ac
@@ -288,4 +288,5 @@ else
 fi
 
 AC_CONFIG_FILES(Makefile testsuite/Makefile)
+AC_CONFIG_FILES(testsuite/libatomic-site-extra.exp)
 AC_OUTPUT
Index: gcc/libatomic/testsuite/Makefile.am
===================================================================
--- gcc.orig/libatomic/testsuite/Makefile.am
+++ gcc/libatomic/testsuite/Makefile.am
@@ -11,3 +11,5 @@ 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)
 RUNTEST = $(_RUNTEST) $(AM_RUNTESTFLAGS)
+
+EXTRA_DEJAGNU_SITE_CONFIG = libatomic-site-extra.exp
Index: gcc/libatomic/testsuite/Makefile.in
===================================================================
--- gcc.orig/libatomic/testsuite/Makefile.in
+++ gcc/libatomic/testsuite/Makefile.in
@@ -109,7 +109,7 @@ am__configure_deps = $(am__aclocal_m4_de
 DIST_COMMON = $(srcdir)/Makefile.am
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/auto-config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = libatomic-site-extra.exp
 CONFIG_CLEAN_VPATH_FILES =
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -278,6 +278,7 @@ _RUNTEST = $(shell if test -f $(top_srcd
 	     echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
 
 RUNTEST = $(_RUNTEST) $(AM_RUNTESTFLAGS)
+EXTRA_DEJAGNU_SITE_CONFIG = libatomic-site-extra.exp
 all: all-am
 
 .SUFFIXES:
@@ -310,6 +311,8 @@ $(top_srcdir)/configure: @MAINTAINER_MOD
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+libatomic-site-extra.exp: $(top_builddir)/config.status $(srcdir)/libatomic-site-extra.exp.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
 mostlyclean-libtool:
 	-rm -f *.lo
Index: gcc/libatomic/testsuite/libatomic-site-extra.exp.in
===================================================================
--- /dev/null
+++ gcc/libatomic/testsuite/libatomic-site-extra.exp.in
@@ -0,0 +1 @@
+set GCC_UNDER_TEST {@CC@}

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v4 GCC 2/5] libffi/test: Fix compilation for build sysroot
  2020-04-03 23:00 [PATCH v4 0/5] Fix library testsuite compilation for build sysroot Maciej W. Rozycki
  2020-04-03 23:00 ` [PATCH v4 1/5] libatomic/test: Fix " Maciej W. Rozycki
@ 2020-04-03 23:01 ` Maciej W. Rozycki
  2020-04-06 18:06   ` Jeff Law
  2020-04-03 23:01 ` [PATCH v4 GCC 3/5] libffi/test: Make `libffi-init' use $CC_FOR_TARGET Maciej W. Rozycki
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Maciej W. Rozycki @ 2020-04-03 23:01 UTC (permalink / raw)
  To: gcc-patches
  Cc: Jeff Law, Mike Stump, Chung-Lin Tang, Ian Lance Taylor, libffi-discuss

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.

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, removing 
failures like:

FAIL: libffi.call/closure_fn0.c -W -Wall -Wno-psabi -O0 (test for excess errors)
Excess errors:
default_target_compile: No compiler to compile with
UNRESOLVED: libffi.call/closure_fn0.c -W -Wall -Wno-psabi -O0 compilation failed to produce executable

and bringing overall test results for the `riscv64-linux-gnu' target 
(here with the `x86_64-linux-gnu' host and RISC-V QEMU in the Linux user 
emulation mode as the target board) from:

		=== libffi Summary ===

# of unexpected failures	708
# of unresolved testcases	708
# of unsupported tests		30

to:

		=== libffi Summary ===

# of expected passes		1934
# of unsupported tests		28

	libffi/
	* configure.ac: Add testsuite/local.exp to output files.
	* configure: Regenerate.
	* testsuite/local.exp.in: New file.
	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New 
	variable.
	* testsuite/Makefile.in: Regenerate.
---
This is a backport of upstream libffi change as recorded here: 
<https://sourceware.org/pipermail/libffi-discuss/2020/002503.html>.

New change in v4.
---
 libffi/configure              |    3 ++-
 libffi/configure.ac           |    2 +-
 libffi/testsuite/Makefile.am  |    2 ++
 libffi/testsuite/Makefile.in  |    5 ++++-
 libffi/testsuite/local.exp.in |    2 ++
 5 files changed, 11 insertions(+), 3 deletions(-)

gcc-test-libffi-cc-for-target-template.diff
Index: gcc/libffi/configure
===================================================================
--- gcc.orig/libffi/configure
+++ gcc/libffi/configure
@@ -16662,7 +16662,7 @@ ac_config_commands="$ac_config_commands
 ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETDIR/ffitarget.h"
 
 
-ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
+ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile testsuite/local.exp man/Makefile libffi.pc"
 
 
 cat >confcache <<\_ACEOF
@@ -17829,6 +17829,7 @@ do
     "include/ffi.h") CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
+    "testsuite/local.exp") CONFIG_FILES="$CONFIG_FILES testsuite/local.exp" ;;
     "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
     "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
 
Index: gcc/libffi/configure.ac
===================================================================
--- gcc.orig/libffi/configure.ac
+++ gcc/libffi/configure.ac
@@ -377,6 +377,6 @@ test -d src/$TARGETDIR || mkdir src/$TAR
 
 AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h)
 
-AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
+AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile testsuite/local.exp man/Makefile libffi.pc)
 
 AC_OUTPUT
Index: gcc/libffi/testsuite/Makefile.am
===================================================================
--- gcc.orig/libffi/testsuite/Makefile.am
+++ gcc/libffi/testsuite/Makefile.am
@@ -13,6 +13,8 @@ RUNTEST = `if [ -f $(top_srcdir)/../deja
 
 AM_RUNTESTFLAGS =
 
+EXTRA_DEJAGNU_SITE_CONFIG = local.exp
+
 CLEANFILES = *.exe core* *.log *.sum
 
 EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c		\
Index: gcc/libffi/testsuite/Makefile.in
===================================================================
--- gcc.orig/libffi/testsuite/Makefile.in
+++ gcc/libffi/testsuite/Makefile.in
@@ -106,7 +106,7 @@ am__configure_deps = $(am__aclocal_m4_de
 DIST_COMMON = $(srcdir)/Makefile.am
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/fficonfig.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = local.exp
 CONFIG_CLEAN_VPATH_FILES =
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -279,6 +279,7 @@ RUNTEST = `if [ -f $(top_srcdir)/../deja
 	       echo $(top_srcdir)/../dejagnu/runtest ; \
 	    else echo runtest; fi`
 
+EXTRA_DEJAGNU_SITE_CONFIG = local.exp
 CLEANFILES = *.exe core* *.log *.sum
 EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c		\
 libffi.call/cls_align_longdouble_split.c				\
@@ -390,6 +391,8 @@ $(top_srcdir)/configure: @MAINTAINER_MOD
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+local.exp: $(top_builddir)/config.status $(srcdir)/local.exp.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
 mostlyclean-libtool:
 	-rm -f *.lo
Index: gcc/libffi/testsuite/local.exp.in
===================================================================
--- /dev/null
+++ gcc/libffi/testsuite/local.exp.in
@@ -0,0 +1,2 @@
+set CC_FOR_TARGET "@CC@"
+set CXX_FOR_TARGET "@CXX@"

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v4 GCC 3/5] libffi/test: Make `libffi-init' use $CC_FOR_TARGET
  2020-04-03 23:00 [PATCH v4 0/5] Fix library testsuite compilation for build sysroot Maciej W. Rozycki
  2020-04-03 23:00 ` [PATCH v4 1/5] libatomic/test: Fix " Maciej W. Rozycki
  2020-04-03 23:01 ` [PATCH v4 GCC 2/5] libffi/test: Fix compilation for build sysroot Maciej W. Rozycki
@ 2020-04-03 23:01 ` Maciej W. Rozycki
  2020-04-03 23:01 ` [PATCH v4 4/5] libgo/test: Complement compilation fix for build sysroot Maciej W. Rozycki
  2020-04-03 23:01 ` [PATCH v4 5/5] libgomp/test: Remove a build sysroot fix regression Maciej W. Rozycki
  4 siblings, 0 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2020-04-03 23:01 UTC (permalink / raw)
  To: gcc-patches
  Cc: Jeff Law, Mike Stump, Chung-Lin Tang, Ian Lance Taylor, libffi-discuss

Update code in `libffi-init' to use $CC_FOR_TARGET in determining the 
value of $ld_library_path, as using a different compiler location from 
one actually used in testing may have odd consequences.

As this obviously loses the setting of $gccdir provide a replacement way 
to determine the directory if feasible, however prefer the location of 
shared libgcc over static libgcc.  This helps in configurations where 
shared libgcc is, unlike libgcc, a location that is not specific to the 
compiler version, a common scenario.  It does not address the scenario 
however where there is a shared libgcc symlink installed pointing to the 
actual run-time library installed elsewhere; this would have to be dealt 
with in a board description file specific to the installation.

Use `remote_exec host' rather than `exec' to invoke the compiler so as 
to support remote configurations and also avoid the latter procedure's 
path length limitation that prevents execution in some actual scenarios.

As using `remote_exec host' precludes the use of our existing file name 
globbing to examine directory contents reuse, with minor modifications 
needed to adjust to our structure, the piece I previously contributed to 
GCC with commit d42b84f427e4 ("testsuite: Fix run-time tracking down 
of `libgcc_s'").

	libffi/
	* testsuite/lib/libffi.exp (libffi-init): Use CC_FOR_TARGET.
	Update the determination of `ld_library_path' accordingly.
---
This is a backport of combined upstream libffi changes as recorded here: 
<https://sourceware.org/pipermail/libffi-discuss/2020/002505.html> and 
here: <https://sourceware.org/pipermail/libffi-discuss/2020/002506.html> 
(there's no point to introduce indentation breakage only to fix it with 
the next change).

New change in v4.
---
 libffi/testsuite/lib/libffi.exp |   72 ++++++++++++++++++++++++++++++----------
 1 file changed, 54 insertions(+), 18 deletions(-)

gcc-test-libffi-init-compiler.diff
Index: gcc/libffi/testsuite/lib/libffi.exp
===================================================================
--- gcc.orig/libffi/testsuite/lib/libffi.exp
+++ gcc/libffi/testsuite/lib/libffi.exp
@@ -99,7 +99,7 @@ proc libffi-init { args } {
     global blddirffi
     global objdir
     global blddircxx
-    global TOOL_OPTIONS
+    global CC_FOR_TARGET
     global tool
     global libffi_include
     global libffi_link_flags
@@ -114,26 +114,62 @@ proc libffi-init { args } {
 
     set compiler_vendor "gnu"
 
-    set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
-    if {$gccdir != ""} {
-	set gccdir [file dirname $gccdir]
-    }
-    verbose "gccdir $gccdir"
+    if { [string match $compiler_vendor "gnu"] } {
+	if [info exists CC_FOR_TARGET] then {
+	    set compiler "$CC_FOR_TARGET"
+	    set libgcc_a_x [remote_exec host "$compiler" \
+			    "-print-file-name=libgcc.a"]
+	    if { [lindex $libgcc_a_x 0] == 0 } {
+		set gccdir [file dirname [lindex $libgcc_a_x 1]]
+	    } else {
+		set gccdir ""
+	    }
+	} else {
+	    set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+	    if {$gccdir != ""} {
+		set gccdir [file dirname $gccdir]
+	    }
+	    set compiler "${gccdir}/xgcc"
+	}
+	verbose "gccdir $gccdir"
 
-    set ld_library_path "."
-    append ld_library_path ":${gccdir}"
+	set shlib_ext [get_shlib_extension]
+	set libgcc_s_x [remote_exec host "$compiler" \
+			"-print-file-name=libgcc_s.${shlib_ext}"]
+	if { [lindex $libgcc_s_x 0] == 0 } {
+	    set libgcc_dir [file dirname [lindex $libgcc_s_x 1]]
+	} else {
+	    set libgcc_dir $gccdir
+	}
+	verbose "libgcc_dir $libgcc_dir"
 
-    set compiler "${gccdir}/xgcc"
-    if { [is_remote host] == 0 && [which $compiler] != 0 } {
-	foreach i "[exec $compiler --print-multi-lib]" {
-	    set mldir ""
-	    regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
-	    set mldir [string trimright $mldir "\;@"]
-	    if { "$mldir" == "." } {
-		continue
+	set ld_library_path "."
+	append ld_library_path ":${gccdir}"
+
+	set multi_dir_x [remote_exec host "$compiler" "-print-multi-directory"]
+	set multi_lib_x [remote_exec host "$compiler" "-print-multi-lib"]
+	if { [lindex $multi_dir_x 0] == 0 && [lindex $multi_lib_x 0] == 0 } {
+	    set multi_dir [string trim [lindex $multi_dir_x 1]]
+	    set multi_lib [string trim [lindex $multi_lib_x 1]]
+	    if { "$multi_dir" == "." } {
+		set multi_root "$libgcc_dir"
+	    } else {
+		set multi_match [string last "/$multi_dir" "$libgcc_dir"]
+		if { "$multi_match" >= 0 } {
+		    set multi_root [string range "$libgcc_dir" \
+				    0 [expr $multi_match - 1]]
+		} else {
+		    set multi_lib ""
+		}
 	    }
-	    if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
-		append ld_library_path ":${gccdir}/${mldir}"
+	    foreach i "$multi_lib" {
+		set mldir ""
+		regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
+		set mldir [string trimright $mldir "\;@"]
+		if { "$mldir" == "$multi_dir" } {
+		    continue
+		}
+		append ld_library_path ":${multi_root}/${mldir}"
 	    }
 	}
     }

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v4 4/5] libgo/test: Complement compilation fix for build sysroot
  2020-04-03 23:00 [PATCH v4 0/5] Fix library testsuite compilation for build sysroot Maciej W. Rozycki
                   ` (2 preceding siblings ...)
  2020-04-03 23:01 ` [PATCH v4 GCC 3/5] libffi/test: Make `libffi-init' use $CC_FOR_TARGET Maciej W. Rozycki
@ 2020-04-03 23:01 ` Maciej W. Rozycki
  2020-04-03 23:01 ` [PATCH v4 5/5] libgomp/test: Remove a build sysroot fix regression Maciej W. Rozycki
  4 siblings, 0 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2020-04-03 23:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jeff Law, Mike Stump, Chung-Lin Tang, Ian Lance Taylor

Complement commit b72813a68c94 ("libgo: fix DejaGNU testsuite compiler 
when using build sysroot") and move testsuite/libgo-test-support.exp.in 
to testsuite/libgo-site-extra.exp.in.  Update testsuite/lib/libgo.exp to 
handle the `--tool_exec' option to `runtest' as with other top-level GCC 
target libraries, by using the TOOL_EXECUTABLE TCL variable.

	libgo/
	* configure.ac: Produce testsuite/libgo-site-extra.exp rather 
	than testsuite/libgo-test-support.exp.
	* configure: Regenerate.
	* testsuite/libgo-test-support.exp.in: Rename file to...
	* testsuite/libgo-site-extra.exp.in: ... this.
	* testsuite/Makefile.am: Use libgo-site-extra.exp rather than 
	libgo-test-support.exp.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/lib/libgo.exp: Handle TOOL_EXECUTABLE.
---
No changes from v3.

Changes from v2:

- Rename testsuite/libgo-test-support.exp.in to 
  testsuite/libgo-site-extra.exp.in.

Applies on top of v1.
---
 libgo/configure                           |    4 ++--
 libgo/configure.ac                        |    2 +-
 libgo/testsuite/Makefile.am               |    2 +-
 libgo/testsuite/Makefile.in               |    6 +++---
 libgo/testsuite/lib/libgo.exp             |   12 ++++++++----
 libgo/testsuite/libgo-site-extra.exp.in   |   17 +++++++++++++++++
 libgo/testsuite/libgo-test-support.exp.in |   17 -----------------
 7 files changed, 32 insertions(+), 28 deletions(-)

gcc-test-libgo-site-extra.diff
Index: gcc/libgo/configure
===================================================================
--- gcc.orig/libgo/configure
+++ gcc/libgo/configure
@@ -15893,7 +15893,7 @@ else
   multilib_arg=
 fi
 
-ac_config_files="$ac_config_files Makefile testsuite/Makefile testsuite/libgo-test-support.exp"
+ac_config_files="$ac_config_files Makefile testsuite/Makefile testsuite/libgo-site-extra.exp"
 
 
 ac_config_commands="$ac_config_commands default"
@@ -17074,7 +17074,7 @@ do
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
-    "testsuite/libgo-test-support.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libgo-test-support.exp" ;;
+    "testsuite/libgo-site-extra.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libgo-site-extra.exp" ;;
     "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
Index: gcc/libgo/configure.ac
===================================================================
--- gcc.orig/libgo/configure.ac
+++ gcc/libgo/configure.ac
@@ -895,7 +895,7 @@ else
   multilib_arg=
 fi
 
-AC_CONFIG_FILES(Makefile testsuite/Makefile testsuite/libgo-test-support.exp)
+AC_CONFIG_FILES(Makefile testsuite/Makefile testsuite/libgo-site-extra.exp)
 
 AC_CONFIG_COMMANDS([default],
 [if test -n "$CONFIG_FILES"; then
Index: gcc/libgo/testsuite/Makefile.am
===================================================================
--- gcc.orig/libgo/testsuite/Makefile.am
+++ gcc/libgo/testsuite/Makefile.am
@@ -11,7 +11,7 @@ RUNTEST = `if [ -f $(top_srcdir)/../deja
 	       echo $(top_srcdir)/../dejagnu/runtest ; \
 	    else echo runtest; fi`
 
-EXTRA_DEJAGNU_SITE_CONFIG = libgo-test-support.exp
+EXTRA_DEJAGNU_SITE_CONFIG = libgo-site-extra.exp
 
 # When running the tests we set GCC_EXEC_PREFIX to the install tree so that
 # files that have already been installed there will be found.  The -B option
Index: gcc/libgo/testsuite/Makefile.in
===================================================================
--- gcc.orig/libgo/testsuite/Makefile.in
+++ gcc/libgo/testsuite/Makefile.in
@@ -107,7 +107,7 @@ am__configure_deps = $(am__aclocal_m4_de
 DIST_COMMON = $(srcdir)/Makefile.am
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = libgo-test-support.exp
+CONFIG_CLEAN_FILES = libgo-site-extra.exp
 CONFIG_CLEAN_VPATH_FILES =
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -300,7 +300,7 @@ RUNTEST = `if [ -f $(top_srcdir)/../deja
 	       echo $(top_srcdir)/../dejagnu/runtest ; \
 	    else echo runtest; fi`
 
-EXTRA_DEJAGNU_SITE_CONFIG = libgo-test-support.exp
+EXTRA_DEJAGNU_SITE_CONFIG = libgo-site-extra.exp
 
 # When running the tests we set GCC_EXEC_PREFIX to the install tree so that
 # files that have already been installed there will be found.  The -B option
@@ -340,7 +340,7 @@ $(top_srcdir)/configure: @MAINTAINER_MOD
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
-libgo-test-support.exp: $(top_builddir)/config.status $(srcdir)/libgo-test-support.exp.in
+libgo-site-extra.exp: $(top_builddir)/config.status $(srcdir)/libgo-site-extra.exp.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
 mostlyclean-libtool:
Index: gcc/libgo/testsuite/lib/libgo.exp
===================================================================
--- gcc.orig/libgo/testsuite/lib/libgo.exp
+++ gcc/libgo/testsuite/lib/libgo.exp
@@ -17,11 +17,15 @@
 set TESTING_IN_BUILD_TREE 1
 
 if ![info exists GOC_UNDER_TEST] then {
-    set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
-    if {$gccdir != ""} {
-	set gccdir [file dirname $gccdir]
+    if [info exists TOOL_EXECUTABLE] {
+	set GOC_UNDER_TEST $TOOL_EXECUTABLE
+    } else {
+	set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+	if {$gccdir != ""} {
+	    set gccdir [file dirname $gccdir]
+	}
+	set GOC_UNDER_TEST "$gccdir/gccgo -B$gccdir/"
     }
-    set GOC_UNDER_TEST "$gccdir/gccgo -B$gccdir/"
 }
 
 if [info exists GOTEST_TMPDIR] {
Index: gcc/libgo/testsuite/libgo-site-extra.exp.in
===================================================================
--- /dev/null
+++ gcc/libgo/testsuite/libgo-site-extra.exp.in
@@ -0,0 +1,17 @@
+# Copyright (C) 2019 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+set GOC_UNDER_TEST {@GOC@}
Index: gcc/libgo/testsuite/libgo-test-support.exp.in
===================================================================
--- gcc.orig/libgo/testsuite/libgo-test-support.exp.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2019 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3.  If not see
-# <http://www.gnu.org/licenses/>.
-
-set GOC_UNDER_TEST {@GOC@}

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v4 5/5] libgomp/test: Remove a build sysroot fix regression
  2020-04-03 23:00 [PATCH v4 0/5] Fix library testsuite compilation for build sysroot Maciej W. Rozycki
                   ` (3 preceding siblings ...)
  2020-04-03 23:01 ` [PATCH v4 4/5] libgo/test: Complement compilation fix for build sysroot Maciej W. Rozycki
@ 2020-04-03 23:01 ` Maciej W. Rozycki
  2020-04-06 18:11   ` Jeff Law
  4 siblings, 1 reply; 15+ messages in thread
From: Maciej W. Rozycki @ 2020-04-03 23:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jeff Law, Mike Stump, Chung-Lin Tang, Ian Lance Taylor

Fix a problem with commit c8e759b4215b ("libgomp/test: Fix compilation 
for build sysroot") that caused a regression in some standalone test 
environments where testsuite/libgomp-test-support.exp is used, but the 
compiler is expected to be determined by `[find_gcc]', and set the 
GCC_UNDER_TEST TCL variable in testsuite/libgomp-site-extra.exp instead.

	libgomp/
	* configure.ac: Add testsuite/libgomp-site-extra.exp to output 
	files.
	* configure: Regenerate.
	* testsuite/libgomp-site-extra.exp.in: New file.
	* testsuite/libgomp-test-support.exp.in (GCC_UNDER_TEST): Remove 
	variable.
	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New
	variable.
	* testsuite/Makefile.in: Regenerate.
---
No changes from v3.

Changes from v2:

- Do not use `--tool_exec' with AM_RUNTESTFLAGS.

- Move the definition of GCC_UNDER_TEST from 
  testsuite/libgomp-test-support.exp to 
  testsuite/libgomp-site-extra.exp.

Applies on top of v1.
---
 libgomp/configure                             |    3 +++
 libgomp/configure.ac                          |    1 +
 libgomp/testsuite/Makefile.am                 |    2 ++
 libgomp/testsuite/Makefile.in                 |    6 +++++-
 libgomp/testsuite/libgomp-site-extra.exp.in   |    1 +
 libgomp/testsuite/libgomp-test-support.exp.in |    2 --
 6 files changed, 12 insertions(+), 3 deletions(-)

gcc-test-libgomp-site-extra.diff
Index: gcc/libgomp/configure
===================================================================
--- gcc.orig/libgomp/configure
+++ gcc/libgomp/configure
@@ -17047,6 +17047,8 @@ ac_config_files="$ac_config_files Makefi
 
 ac_config_files="$ac_config_files testsuite/libgomp-test-support.pt.exp:testsuite/libgomp-test-support.exp.in"
 
+ac_config_files="$ac_config_files testsuite/libgomp-site-extra.exp"
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -18200,6 +18202,7 @@ do
     "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
     "libgomp.spec") CONFIG_FILES="$CONFIG_FILES libgomp.spec" ;;
     "testsuite/libgomp-test-support.pt.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libgomp-test-support.pt.exp:testsuite/libgomp-test-support.exp.in" ;;
+    "testsuite/libgomp-site-extra.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libgomp-site-extra.exp" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
Index: gcc/libgomp/configure.ac
===================================================================
--- gcc.orig/libgomp/configure.ac
+++ gcc/libgomp/configure.ac
@@ -436,4 +436,5 @@ GCC_BASE_VER
 AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h)
 AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec)
 AC_CONFIG_FILES([testsuite/libgomp-test-support.pt.exp:testsuite/libgomp-test-support.exp.in])
+AC_CONFIG_FILES([testsuite/libgomp-site-extra.exp])
 AC_OUTPUT
Index: gcc/libgomp/testsuite/Makefile.am
===================================================================
--- gcc.orig/libgomp/testsuite/Makefile.am
+++ gcc/libgomp/testsuite/Makefile.am
@@ -12,6 +12,8 @@ _RUNTEST = $(shell if test -f $(top_srcd
 	     echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
 
+EXTRA_DEJAGNU_SITE_CONFIG = libgomp-site-extra.exp
+
 # Instead of directly in ../testsuite/libgomp-test-support.exp.in, the
 # following variables have to be "routed through" this Makefile, for expansion
 # of the several (Makefile) variables used therein.
Index: gcc/libgomp/testsuite/Makefile.in
===================================================================
--- gcc.orig/libgomp/testsuite/Makefile.in
+++ gcc/libgomp/testsuite/Makefile.in
@@ -111,7 +111,8 @@ am__configure_deps = $(am__aclocal_m4_de
 DIST_COMMON = $(srcdir)/Makefile.am
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = libgomp-test-support.pt.exp
+CONFIG_CLEAN_FILES = libgomp-test-support.pt.exp \
+	libgomp-site-extra.exp
 CONFIG_CLEAN_VPATH_FILES =
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -310,6 +311,7 @@ _RUNTEST = $(shell if test -f $(top_srcd
 	     echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi)
 
 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
+EXTRA_DEJAGNU_SITE_CONFIG = libgomp-site-extra.exp
 all: all-am
 
 .SUFFIXES:
@@ -344,6 +346,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(
 $(am__aclocal_m4_deps):
 libgomp-test-support.pt.exp: $(top_builddir)/config.status $(srcdir)/libgomp-test-support.exp.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+libgomp-site-extra.exp: $(top_builddir)/config.status $(srcdir)/libgomp-site-extra.exp.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
 mostlyclean-libtool:
 	-rm -f *.lo
Index: gcc/libgomp/testsuite/libgomp-site-extra.exp.in
===================================================================
--- /dev/null
+++ gcc/libgomp/testsuite/libgomp-site-extra.exp.in
@@ -0,0 +1 @@
+set GCC_UNDER_TEST {@CC@}
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@"

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 GCC 2/5] libffi/test: Fix compilation for build sysroot
  2020-04-03 23:01 ` [PATCH v4 GCC 2/5] libffi/test: Fix compilation for build sysroot Maciej W. Rozycki
@ 2020-04-06 18:06   ` Jeff Law
  2020-04-06 20:21     ` Maciej W. Rozycki
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Law @ 2020-04-06 18:06 UTC (permalink / raw)
  To: Maciej W. Rozycki, gcc-patches
  Cc: Mike Stump, Chung-Lin Tang, Ian Lance Taylor, libffi-discuss

On Sat, 2020-04-04 at 00:01 +0100, Maciej W. Rozycki 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.
> 
> 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, removing 
> failures like:
> 
> FAIL: libffi.call/closure_fn0.c -W -Wall -Wno-psabi -O0 (test for excess
> errors)
> Excess errors:
> default_target_compile: No compiler to compile with
> UNRESOLVED: libffi.call/closure_fn0.c -W -Wall -Wno-psabi -O0 compilation
> failed to produce executable
> 
> and bringing overall test results for the `riscv64-linux-gnu' target 
> (here with the `x86_64-linux-gnu' host and RISC-V QEMU in the Linux user 
> emulation mode as the target board) from:
> 
> 		=== libffi Summary ===
> 
> # of unexpected failures	708
> # of unresolved testcases	708
> # of unsupported tests		30
> 
> to:
> 
> 		=== libffi Summary ===
> 
> # of expected passes		1934
> # of unsupported tests		28
> 
> 	libffi/
> 	* configure.ac: Add testsuite/local.exp to output files.
> 	* configure: Regenerate.
> 	* testsuite/local.exp.in: New file.
> 	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New 
> 	variable.
> 	* testsuite/Makefile.in: Regenerate.
Oh, I see it now.  THe patches I ack'd were actually for upstream libffi.

You should actually wait for a libffi maintainer to ack those, not me :-)  Sorry
for the confusion.

Both backports are OK once they're upstreamed.

jeff
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 1/5] libatomic/test: Fix compilation for build sysroot
  2020-04-03 23:00 ` [PATCH v4 1/5] libatomic/test: Fix " Maciej W. Rozycki
@ 2020-04-06 18:10   ` Jeff Law
  2020-04-06 22:34     ` Maciej W. Rozycki
  2023-09-12 11:03   ` 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 sysroot) Thomas Schwinge
  1 sibling, 1 reply; 15+ messages in thread
From: Jeff Law @ 2020-04-06 18:10 UTC (permalink / raw)
  To: Maciej W. Rozycki, gcc-patches
  Cc: Mike Stump, Chung-Lin Tang, Ian Lance Taylor

On Sat, 2020-04-04 at 00:00 +0100, Maciej W. Rozycki 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, removing 
> failures 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: libatomic.c/atomic-compare-exchange-1.c (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 -lm
> 
> UNRESOLVED: libatomic.c/atomic-compare-exchange-1.c compilation failed to
> produce executable
> 
> and bringing overall test results for the `riscv64-linux-gnu' target 
> (here with the `x86_64-linux-gnu' host and RISC-V QEMU in the Linux user 
> emulation mode as the target board) from:
> 
> 		=== libatomic Summary ===
> 
> # of unexpected failures	27
> # of unresolved testcases	27
> 
> to:
> 
> 		=== libatomic Summary ===
> 
> # of expected passes		54
> 
> 	libatomic/
> 	* configure.ac: Add testsuite/libatomic-site-extra.exp to output 
> 	files.
> 	* configure: Regenerate.
> 	* libatomic/testsuite/libatomic-site-extra.exp.in: New file.
> 	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New 
> 	variable.
> 	* testsuite/Makefile.in: Regenerate.
OK
jeff
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 5/5] libgomp/test: Remove a build sysroot fix regression
  2020-04-03 23:01 ` [PATCH v4 5/5] libgomp/test: Remove a build sysroot fix regression Maciej W. Rozycki
@ 2020-04-06 18:11   ` Jeff Law
  2020-04-06 22:34     ` Maciej W. Rozycki
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Law @ 2020-04-06 18:11 UTC (permalink / raw)
  To: Maciej W. Rozycki, gcc-patches
  Cc: Mike Stump, Chung-Lin Tang, Ian Lance Taylor

On Sat, 2020-04-04 at 00:01 +0100, Maciej W. Rozycki wrote:
> Fix a problem with commit c8e759b4215b ("libgomp/test: Fix compilation 
> for build sysroot") that caused a regression in some standalone test 
> environments where testsuite/libgomp-test-support.exp is used, but the 
> compiler is expected to be determined by `[find_gcc]', and set the 
> GCC_UNDER_TEST TCL variable in testsuite/libgomp-site-extra.exp instead.
> 
> 	libgomp/
> 	* configure.ac: Add testsuite/libgomp-site-extra.exp to output 
> 	files.
> 	* configure: Regenerate.
> 	* testsuite/libgomp-site-extra.exp.in: New file.
> 	* testsuite/libgomp-test-support.exp.in (GCC_UNDER_TEST): Remove 
> 	variable.
> 	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New
> 	variable.
> 	* testsuite/Makefile.in: Regenerate.
OK
jeff
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 GCC 2/5] libffi/test: Fix compilation for build sysroot
  2020-04-06 18:06   ` Jeff Law
@ 2020-04-06 20:21     ` Maciej W. Rozycki
  0 siblings, 0 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2020-04-06 20:21 UTC (permalink / raw)
  To: Jeff Law
  Cc: gcc-patches, Mike Stump, Chung-Lin Tang, Ian Lance Taylor,
	libffi-discuss

On Mon, 6 Apr 2020, Jeff Law wrote:

> > 	libffi/
> > 	* configure.ac: Add testsuite/local.exp to output files.
> > 	* configure: Regenerate.
> > 	* testsuite/local.exp.in: New file.
> > 	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New 
> > 	variable.
> > 	* testsuite/Makefile.in: Regenerate.
> Oh, I see it now.  THe patches I ack'd were actually for upstream libffi.
> 
> You should actually wait for a libffi maintainer to ack those, not me :-)  Sorry
> for the confusion.

 Sorry to make it unclear.  I chose to cc the other mailing list with the 
libffi part of both submissions so as to give a chance to chime in to 
members of both communities.  We are quite tightly coupled with each other 
here after all and my experience over the many years I have been involved 
has been that the bits related to Autotools are often quite tricky and 
hard to get right (Autotools are fine tools in my experience, it's just 
you need to be thorough with them as they tend not to forgive a cursory 
approach).

> Both backports are OK once they're upstreamed.

 Thanks for your ack; it was my intent to get these upstream first, and I 
realise there can be changes requested that will require the GCC backport 
to be adjusted accordingly (and reviewed again).

  Maciej

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 1/5] libatomic/test: Fix compilation for build sysroot
  2020-04-06 18:10   ` Jeff Law
@ 2020-04-06 22:34     ` Maciej W. Rozycki
  0 siblings, 0 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2020-04-06 22:34 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches, Mike Stump, Chung-Lin Tang, Ian Lance Taylor

On Mon, 6 Apr 2020, Jeff Law wrote:

> > 	libatomic/
> > 	* configure.ac: Add testsuite/libatomic-site-extra.exp to output 
> > 	files.
> > 	* configure: Regenerate.
> > 	* libatomic/testsuite/libatomic-site-extra.exp.in: New file.
> > 	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New 
> > 	variable.
> > 	* testsuite/Makefile.in: Regenerate.
> OK
> jeff

 Committed now, thanks for your review.

  Maciej

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 5/5] libgomp/test: Remove a build sysroot fix regression
  2020-04-06 18:11   ` Jeff Law
@ 2020-04-06 22:34     ` Maciej W. Rozycki
  0 siblings, 0 replies; 15+ messages in thread
From: Maciej W. Rozycki @ 2020-04-06 22:34 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches, Mike Stump, Chung-Lin Tang, Ian Lance Taylor

On Mon, 6 Apr 2020, Jeff Law wrote:

> > 	libgomp/
> > 	* configure.ac: Add testsuite/libgomp-site-extra.exp to output 
> > 	files.
> > 	* configure: Regenerate.
> > 	* testsuite/libgomp-site-extra.exp.in: New file.
> > 	* testsuite/libgomp-test-support.exp.in (GCC_UNDER_TEST): Remove 
> > 	variable.
> > 	* testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): New
> > 	variable.
> > 	* testsuite/Makefile.in: Regenerate.
> OK
> jeff

 Committed now, thanks for your review.

  Maciej

^ permalink raw reply	[flat|nested] 15+ messages in thread

* 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 sysroot)
  2020-04-03 23:00 ` [PATCH v4 1/5] libatomic/test: Fix " Maciej W. Rozycki
  2020-04-06 18:10   ` Jeff Law
@ 2023-09-12 11:03   ` Thomas Schwinge
  2023-10-25  8:32     ` [PING] " Thomas Schwinge
  1 sibling, 1 reply; 15+ messages in thread
From: Thomas Schwinge @ 2023-09-12 11:03 UTC (permalink / raw)
  To: gcc-patches; +Cc: Maciej W. Rozycki, Rainer Orth, Mike Stump, Iain Sandoe

[-- Attachment #1: Type: text/plain, Size: 1866 bytes --]

Hi!

On 2020-04-04T00:00:44+0100, "Maciej W. Rozycki via Gcc-patches" <gcc-patches@gcc.gnu.org> 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.fsf@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.fsf@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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-libatomic-Consider-with-build-sysroot-.-for-target-l.patch --]
[-- Type: text/x-diff, Size: 4685 bytes --]

From 584bfb74e802b94c490b963bd05ed520b5c6e453 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
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}/configure.tgt
 if test -n "$UNSUPPORTED"; then
diff --git a/libatomic/configure.ac b/libatomic/configure.ac
index 318b605a1d7..4beff2d681f 100644
--- a/libatomic/configure.ac
+++ b/libatomic/configure.ac
@@ -170,6 +170,8 @@ case "$target" in
     ;;
 esac
 
+AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
+
 # Get target configury.
 . ${srcdir}/configure.tgt
 if test -n "$UNSUPPORTED"; then
diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefile.in
index b874ac527a9..247268f1949 100644
--- a/libatomic/testsuite/Makefile.in
+++ b/libatomic/testsuite/Makefile.in
@@ -198,6 +198,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/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp
index 10f38475bc8..43b54212d90 100644
--- a/libatomic/testsuite/lib/libatomic.exp
+++ b/libatomic/testsuite/lib/libatomic.exp
@@ -146,6 +146,11 @@ proc libatomic_init { args } {
 
     set ALWAYS_CFLAGS ""
     if { $blddir != "" } {
+	# If '--with-build-sysroot=[...]' was specified, use it for build-tree
+	# testing.
+	global SYSROOT_CFLAGS_FOR_TARGET
+	lappend ALWAYS_CFLAGS "additional_flags=${SYSROOT_CFLAGS_FOR_TARGET}"
+
 	lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
 	lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
 	lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
diff --git a/libatomic/testsuite/libatomic-site-extra.exp.in b/libatomic/testsuite/libatomic-site-extra.exp.in
index c0d26660bad..5c81b7750bb 100644
--- a/libatomic/testsuite/libatomic-site-extra.exp.in
+++ b/libatomic/testsuite/libatomic-site-extra.exp.in
@@ -1 +1 @@
-set GCC_UNDER_TEST {@CC@}
+set SYSROOT_CFLAGS_FOR_TARGET {@SYSROOT_CFLAGS_FOR_TARGET@}
-- 
2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [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 build sysroot)
  2023-09-12 11:03   ` 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 sysroot) Thomas Schwinge
@ 2023-10-25  8:32     ` Thomas Schwinge
  2023-10-26 13:34       ` [PING] libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Jeff Law
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas Schwinge @ 2023-10-25  8:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Iain Sandoe, Rainer Orth, Mike Stump, Maciej W. Rozycki

[-- Attachment #1: Type: text/plain, Size: 1990 bytes --]

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" <gcc-patches@gcc.gnu.org> 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.fsf@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.fsf@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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-libatomic-Consider-with-build-sysroot-.-for-target-l.patch --]
[-- Type: text/x-diff, Size: 4685 bytes --]

From 584bfb74e802b94c490b963bd05ed520b5c6e453 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
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}/configure.tgt
 if test -n "$UNSUPPORTED"; then
diff --git a/libatomic/configure.ac b/libatomic/configure.ac
index 318b605a1d7..4beff2d681f 100644
--- a/libatomic/configure.ac
+++ b/libatomic/configure.ac
@@ -170,6 +170,8 @@ case "$target" in
     ;;
 esac
 
+AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
+
 # Get target configury.
 . ${srcdir}/configure.tgt
 if test -n "$UNSUPPORTED"; then
diff --git a/libatomic/testsuite/Makefile.in b/libatomic/testsuite/Makefile.in
index b874ac527a9..247268f1949 100644
--- a/libatomic/testsuite/Makefile.in
+++ b/libatomic/testsuite/Makefile.in
@@ -198,6 +198,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/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp
index 10f38475bc8..43b54212d90 100644
--- a/libatomic/testsuite/lib/libatomic.exp
+++ b/libatomic/testsuite/lib/libatomic.exp
@@ -146,6 +146,11 @@ proc libatomic_init { args } {
 
     set ALWAYS_CFLAGS ""
     if { $blddir != "" } {
+	# If '--with-build-sysroot=[...]' was specified, use it for build-tree
+	# testing.
+	global SYSROOT_CFLAGS_FOR_TARGET
+	lappend ALWAYS_CFLAGS "additional_flags=${SYSROOT_CFLAGS_FOR_TARGET}"
+
 	lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
 	lappend ALWAYS_CFLAGS "additional_flags=-I${blddir}"
 	lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
diff --git a/libatomic/testsuite/libatomic-site-extra.exp.in b/libatomic/testsuite/libatomic-site-extra.exp.in
index c0d26660bad..5c81b7750bb 100644
--- a/libatomic/testsuite/libatomic-site-extra.exp.in
+++ b/libatomic/testsuite/libatomic-site-extra.exp.in
@@ -1 +1 @@
-set GCC_UNDER_TEST {@CC@}
+set SYSROOT_CFLAGS_FOR_TARGET {@SYSROOT_CFLAGS_FOR_TARGET@}
-- 
2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PING] libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951]
  2023-10-25  8:32     ` [PING] " Thomas Schwinge
@ 2023-10-26 13:34       ` Jeff Law
  0 siblings, 0 replies; 15+ messages in thread
From: Jeff Law @ 2023-10-26 13:34 UTC (permalink / raw)
  To: Thomas Schwinge, gcc-patches
  Cc: Iain Sandoe, Rainer Orth, Mike Stump, Maciej W. Rozycki



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" <gcc-patches@gcc.gnu.org> 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.fsf@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.fsf@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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-10-26 13:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03 23:00 [PATCH v4 0/5] Fix library testsuite compilation for build sysroot Maciej W. Rozycki
2020-04-03 23:00 ` [PATCH v4 1/5] libatomic/test: Fix " Maciej W. Rozycki
2020-04-06 18:10   ` Jeff Law
2020-04-06 22:34     ` Maciej W. Rozycki
2023-09-12 11:03   ` 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 sysroot) Thomas Schwinge
2023-10-25  8:32     ` [PING] " Thomas Schwinge
2023-10-26 13:34       ` [PING] libatomic: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR109951] Jeff Law
2020-04-03 23:01 ` [PATCH v4 GCC 2/5] libffi/test: Fix compilation for build sysroot Maciej W. Rozycki
2020-04-06 18:06   ` Jeff Law
2020-04-06 20:21     ` Maciej W. Rozycki
2020-04-03 23:01 ` [PATCH v4 GCC 3/5] libffi/test: Make `libffi-init' use $CC_FOR_TARGET Maciej W. Rozycki
2020-04-03 23:01 ` [PATCH v4 4/5] libgo/test: Complement compilation fix for build sysroot Maciej W. Rozycki
2020-04-03 23:01 ` [PATCH v4 5/5] libgomp/test: Remove a build sysroot fix regression Maciej W. Rozycki
2020-04-06 18:11   ` Jeff Law
2020-04-06 22:34     ` Maciej W. Rozycki

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).