Pass $GOLIBS to compilation in DejaGNU testing like with direct compiler 
invocation from `libgo/testsuite/gotest', removing link problems in 
cross-toolchain testing like:

.../bin/riscv64-linux-gnu-ld: _gotest_.o: in function 
`cmd..z2fgo..z2finternal..z2fcache.Cache.get':
.../riscv64-linux-gnu/libgo/gotest24771/test/cache.go:182: undefined reference 
to `cmd..z2fgo..z2finternal..z2frenameio.ReadFile'

due to `libgotool.a' missing from the linker invocation command and 
improving 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 133 PASSes and 26 FAILs to 145 
PASSes and 29 FAILs.
---
 libgo/testsuite/libgo.testmain/testmain.exp |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

gcc-test-libgo-dejagnu-golibs.diff
Index: gcc/libgo/testsuite/libgo.testmain/testmain.exp
===================================================================
--- gcc.orig/libgo/testsuite/libgo.testmain/testmain.exp
+++ gcc/libgo/testsuite/libgo.testmain/testmain.exp
@@ -47,7 +47,11 @@ if [info exists gluefile] {
     regsub $gluefile $object_files "" object_files
 }
 
-set comp_output [go_target_compile "$object_files _testmain.go" \
+set golibs ""
+if [info exists env(GOLIBS)] {
+    set golibs "$env(GOLIBS)"
+}
+set comp_output [go_target_compile "$object_files _testmain.go $golibs" \
                         "./a.exe" "executable" $options]
 if ![ string match "" $comp_output ] {
     verbose -log $comp_output

Reply via email to