Re: [PATCH] [LIBPHOBOS] Fix multi-lib RUNTESTFLAGS handling

2019-10-30 Thread Thomas Schwinge
Hi!

On 2019-09-03T10:04:14+0200, Iain Buclaw  wrote:
> On Tue, 3 Sep 2019 at 08:10, Bernd Edlinger  wrote:
>> 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?
>
> OK.

The very same problem existed since the beginning of D language support
in GCC, so I backported this to gcc-9-branch in r277611 "[LIBPHOBOS] Fix
multi-lib RUNTESTFLAGS handling", see attached.


Grüße
 Thomas


From 2dba914d0a00623209ce8f9ceaf28e2d5e2ceb06 Mon Sep 17 00:00:00 2001
From: tschwinge 
Date: Wed, 30 Oct 2019 11:51:15 +
Subject: [PATCH] [LIBPHOBOS] Fix multi-lib RUNTESTFLAGS handling

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  

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-9-branch@277611 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libphobos/ChangeLog   |  9 +
 libphobos/testsuite/lib/libphobos.exp | 19 +++
 2 files changed, 28 insertions(+)

diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog
index 24de0ab9bd8..becd8b1ec86 100644
--- a/libphobos/ChangeLog
+++ b/libphobos/ChangeLog
@@ -1,3 +1,12 @@
+2019-10-30  Thomas Schwinge  
+
+	Backport from trunk:
+
+	2019-09-03  Bernd Edlinger  
+
+	* 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.
diff --git a/libphobos/testsuite/lib/libphobos.exp b/libphobos/testsuite/lib/libphobos.exp
index d3fe75358c8..056e8f1d444 100644
--- a/libphobos/testsuite/lib/libphobos.exp
+++ b/libphobos/testsuite/lib/libphobos.exp
@@ -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"
-- 
2.17.1



signature.asc
Description: PGP signature


Re: [PATCH] [LIBPHOBOS] Fix multi-lib RUNTESTFLAGS handling

2019-09-03 Thread Iain Buclaw
On Tue, 3 Sep 2019 at 08:10, Bernd Edlinger  wrote:
>
> 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?
>

OK.

-- 
Iain


[PATCH] [LIBPHOBOS] Fix multi-lib RUNTESTFLAGS handling

2019-09-03 Thread Bernd Edlinger
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  

	* 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"