This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] [LIBPHOBOS] Fix multi-lib RUNTESTFLAGS handling
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Iain Buclaw <ibuclaw at gdcproject dot org>
- Date: Tue, 3 Sep 2019 06:10:31 +0000
- Subject: [PATCH] [LIBPHOBOS] Fix multi-lib RUNTESTFLAGS handling
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r8k+B9L8r7GUQRmS/kE+rwwD1WmOJUgXsOKqiXvLNGA=; b=X4TH1VAf4qOhlCs/e9g0wGQ4yli36+3s+12kYfVLoeT5pXxx+o/dWDtsCVq5CO2inHLGAcOnnQtRjpVgTOMbmuRjg1MWHG92DvCUZ+85Mv7FNWDnDZu9SBoh7n1hsjAEk7Yb900GtLu+PjXT2O637K0alpx2H8GSR9QbxARApyNBcPdI7MNUYPHthM4in2uYlZkIO5V3509I9++OhMALvaymGaZcdUDIiflRSIIMNJFWDG4bSnub4lcTv1kgq+AstXEhffULIw21BZNW1W+3ioKcDfSMEGiZjDecpxXNtsbjhl49AhMfmpqK0iiVzuvJ7GXzzQCiqdhsUksPCRV7UA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BRe/nFQ2YMtN1Dfjd7rayb2/S5vlG95eYheOcDlmrDs5iFFPAJyzEZxM3/XcBN1BnRO5xMY1Ojvmed5FMExRUFMdq+l0kPk135/wPscTSe8XzPQ182tvJPqGreGsMgsrIQym4eVqOmDQgRt3jokTcia51dPAUMM5bWrtf7dWMvZGtSRvF0qrG2QreH2ngpjKq5efRC7p3qijiwEFPCBgp2mVmCQqo1plz7Wy+ldbUks8gCNgVvtRG3ucf3oEGaCwIR8V6iAFbwfHz2+BBL3f4xQw9wUqqnJRP/RDH+9qCK2VRKGE6H1Wm1m+Qss7Qd2y/pLPmYdw3rD+oZg3bdHYxg==
Hi,
I've noticed that 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, see attached patch.
Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?
Thanks
Bernd.
2019-09-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
* testsuite/lib/libphobos.exp (libphobos_init): Add multi-lib libgcc dirs
to the ld_library_path var.
Index: libphobos/testsuite/lib/libphobos.exp
===================================================================
--- libphobos/testsuite/lib/libphobos.exp (revision 275320)
+++ libphobos/testsuite/lib/libphobos.exp (working copy)
@@ -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"