]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testi...
authorThomas Schwinge <thomas@codesourcery.com>
Thu, 1 Jun 2023 21:07:37 +0000 (23:07 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 12 Sep 2023 09:30:37 +0000 (11:30 +0200)
This is commit c8e759b4215ba4b376c9d468aeffe163b3d520f0 (Subversion r279708)
"libgomp/test: Fix compilation for build sysroot" and follow-up
commit 749bd22ddc50b5112e5ed506ffef7249bf8e6fb3
"libgomp/test: Remove a build sysroot fix regression" done differently,
avoiding build-tree testing use of any random gunk that may appear in
build-time 'CC', 'CXX', 'FC'.

PR testsuite/91884
PR testsuite/109951
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 <cltang@codesourcery.com>
libgomp/Makefile.in
libgomp/configure
libgomp/configure.ac
libgomp/testsuite/Makefile.in
libgomp/testsuite/lib/libgomp.exp
libgomp/testsuite/libgomp-site-extra.exp.in
libgomp/testsuite/libgomp.c++/c++.exp
libgomp/testsuite/libgomp.oacc-c++/c++.exp

index 3ef05e6a3cbbda21d35d5d4dca5b082296a6c70f..431bc87b6297168742693ffc2712f40b5018bbc1 100644 (file)
@@ -368,7 +368,6 @@ CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CPU_COUNT = @CPU_COUNT@
-CXX = @CXX@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -436,6 +435,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
 VERSION = @VERSION@
 XCFLAGS = @XCFLAGS@
 XLDFLAGS = @XLDFLAGS@
index a12b30f1b0fc1799185124d2d404c90ddab3e680..498bc084a865ffcc7100a1eabfed579f7dd039d9 100755 (executable)
@@ -656,6 +656,7 @@ tmake_file
 XLDFLAGS
 XCFLAGS
 config_path
+SYSROOT_CFLAGS_FOR_TARGET
 FLOCK
 CPU_COUNT
 LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_FALSE
@@ -679,7 +680,6 @@ libtool_VERSION
 ac_ct_FC
 FCFLAGS
 FC
-CXX
 MAINT
 MAINTAINER_MODE_FALSE
 MAINTAINER_MODE_TRUE
 
 
 
-# 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').
-
-
 # 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.
 #AC_PROG_FC(gfortran)
 case `echo $GFORTRAN` in
@@ -16580,6 +16569,8 @@ fi
 
 fi
 
+
+
 # Get target configury.
 . ${srcdir}/configure.tgt
 CFLAGS="$save_CFLAGS $XCFLAGS"
index 1aad83a79da2850d23d3658de051e5b826d1b4ee..49f7fb0dc82b188d0042aeb04b9da4effe812fcc 100644 (file)
@@ -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.
 #AC_PROG_FC(gfortran)
 case `echo $GFORTRAN` in
@@ -356,6 +345,8 @@ if test -z "$FLOCK"; then
   AC_CHECK_PROG(FLOCK, perl, $srcdir/testsuite/flock)
 fi
 
+AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
+
 # Get target configury.
 . ${srcdir}/configure.tgt
 CFLAGS="$save_CFLAGS $XCFLAGS"
index d743e464cdc34cedf7bc5ab3d637f784011ca323..4155350cf80e38a97615e2dd63807f09a32daa7e 100644 (file)
@@ -147,7 +147,6 @@ CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CPU_COUNT = @CPU_COUNT@
-CXX = @CXX@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -215,6 +214,7 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
 VERSION = @VERSION@
 XCFLAGS = @XCFLAGS@
 XLDFLAGS = @XLDFLAGS@
index a143b5d0defa1bb87bf7c28f8355c1fc29830d8b..cab926a798bf3405473bd93908a9d78c4b249260 100644 (file)
@@ -91,19 +91,6 @@ proc libgomp_init { args } {
       setenv LANG C.ASCII
     }
 
-    if { $blddir != "" } {
-       # Fix up '-funconfigured-libstdc++-v3' in 'GXX_UNDER_TEST' (see
-       # '../../configure.ac').
-       set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags"
-       if { [file exists $flags_file] } {
-           set flags [exec sh $flags_file --build-includes]
-           verbose -log "GXX_UNDER_TEST = $GXX_UNDER_TEST"
-           set GXX_UNDER_TEST [string map [list \
-             " -funconfigured-libstdc++-v3 " " $flags " \
-                                          ] $GXX_UNDER_TEST]
-           verbose -log "GXX_UNDER_TEST = $GXX_UNDER_TEST"
-       }
-    }
     if ![info exists GCC_UNDER_TEST] then {
        if [info exists TOOL_EXECUTABLE] {
            set GCC_UNDER_TEST $TOOL_EXECUTABLE
@@ -185,6 +172,11 @@ proc libgomp_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}/"
         # targets that use libgomp.a%s in their specs need a -B option
         # for uninstalled testing.
index c824d85f7edac0658377cea9863ca187f440414f..8de14f4897667463f45325dc85511e792e26f3c5 100644 (file)
@@ -1,4 +1,2 @@
 set FLOCK {@FLOCK@}
-set GCC_UNDER_TEST {@CC@}
-set GXX_UNDER_TEST {@CXX@}
-set GFORTRAN_UNDER_TEST {@FC@}
+set SYSROOT_CFLAGS_FOR_TARGET {@SYSROOT_CFLAGS_FOR_TARGET@}
index 8b4563b1d0def4e22fcdd21a9c89cbeaa5b6dc3b..ed096e17b9c599c8d4185b3ba227bbd3ca239322 100644 (file)
@@ -15,6 +15,10 @@ if { $blddir != "" } {
     verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
     return
 }
+if { $blddir != "" } {
+    set lang_source_re {^.*\.[cC]$}
+    set lang_include_flags [exec sh ${blddir}/../libstdc++-v3/scripts/testsuite_flags --build-includes]
+}
 lappend ALWAYS_CFLAGS "compiler=$GXX_UNDER_TEST"
 
 # If a testcase doesn't have special options, use these.
@@ -44,6 +48,8 @@ set_ld_library_path_env_vars
 dg-runtest $tests "" $DEFAULT_CFLAGS
 
 if { $blddir != "" } {
+    unset lang_source_re
+    unset lang_include_flags
     unset libstdc++_library_path
     unset lang_library_paths
 }
index 79df401c99ab74267e4a3b20109b80bba25c97a9..7b2315e406f2370c2c17f2a2bd9eee301d1d49c5 100644 (file)
@@ -25,6 +25,10 @@ if { $blddir != "" } {
     verbose -log "GXX_UNDER_TEST not defined, will not execute c++ tests"
     return
 }
+if { $blddir != "" } {
+    set lang_source_re {^.*\.[cC]$}
+    set lang_include_flags [exec sh ${blddir}/../libstdc++-v3/scripts/testsuite_flags --build-includes]
+}
 lappend ALWAYS_CFLAGS "compiler=$GXX_UNDER_TEST"
 
 # Initialize dg.
@@ -121,6 +125,8 @@ foreach offload_target [concat [split $offload_targets ","] "disable"] {
 unset offload_target
 
 if { $blddir != "" } {
+    unset lang_source_re
+    unset lang_include_flags
     unset libstdc++_library_path
     unset lang_library_paths
 }