diff mbox series

libgo/test: Pass $GOLIBS to compilation in DejaGNU testing

Message ID alpine.LFD.2.21.1911130025310.13542@redsun52.ssa.fujisawa.hgst.com
State Accepted
Headers show
Series libgo/test: Pass $GOLIBS to compilation in DejaGNU testing | expand

Commit Message

Maciej W. Rozycki Nov. 13, 2019, 12:43 a.m. UTC
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

Comments

Ian Lance Taylor Nov. 15, 2019, 9:14 p.m. UTC | #1
On Tue, Nov 12, 2019 at 4:43 PM Maciej W. Rozycki <macro@wdc.com> wrote:
>
> 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.

Thanks.  Committed to trunk.

Ian
diff mbox series

Patch

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