]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[LIBPHOBOS] Fix multi-lib RUNTESTFLAGS handling
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 30 Oct 2019 11:51:15 +0000 (12:51 +0100)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Wed, 30 Oct 2019 11:51:15 +0000 (12:51 +0100)
Testing libphobos fails for multi-lib configs:

$ make check-target-libphobos RUNTESTFLAGS="--target_board=unix\{-m32,\}"

fails for every 32bit execution, because the host libgcc_s.so is used which
is not the correct version:

spawn [open ...]
./test_aa.exe: /lib/i386-linux-gnu/libgcc_s.so.1: version `GCC_7.0.0' not found (required by ./test_aa.exe)
FAIL: libphobos.aa/test_aa.d execution test

This can be fixed by adding a few lines from libstdc++/testsuite/lib/libstdc++.exp
to libphobos/testsuite/lib/libphobos.exp

Backport trunk r275332:

libphobos/
2019-09-03  Bernd Edlinger  <bernd.edlinger@hotmail.de>

* testsuite/lib/libphobos.exp (libphobos_init): Add multi-lib libgcc
dirs to the ld_library_path var.

From-SVN: r277611

libphobos/ChangeLog
libphobos/testsuite/lib/libphobos.exp

index 24de0ab9bd80019242f8b3cdeb1d4687b9e00b7b..becd8b1ec86af94706d52272c785a2bdddc5a47e 100644 (file)
@@ -1,3 +1,12 @@
+2019-10-30  Thomas Schwinge  <thomas@codesourcery.com>
+
+       Backport from trunk:
+
+       2019-09-03  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       * testsuite/lib/libphobos.exp (libphobos_init): Add multi-lib libgcc
+       dirs to the ld_library_path var.
+
 2019-08-12  Release Manager
 
        * GCC 9.2.0 released.
index d3fe75358c860aed21f8550be732e0be585e9b89..056e8f1d444ebad4c715cf5a274d654b80816635 100644 (file)
@@ -170,6 +170,25 @@ proc libphobos_init { args } {
        append ld_library_path ":${blddir}/src/.libs"
     }
 
+    # Compute what needs to be added to the existing LD_LIBRARY_PATH.
+    if {$gccdir != ""} {
+       set compiler ${gccdir}/gdc
+
+       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
+           }
+           if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
+             append ld_library_path ":${gccdir}/${mldir}"
+           }
+         }
+       }
+    }
+
     set_ld_library_path_env_vars
 
     libphobos_maybe_build_wrapper "${objdir}/testglue.o"