From c8e759b4215ba4b376c9d468aeffe163b3d520f0 Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sun, 22 Dec 2019 00:41:36 +0000 Subject: [PATCH] libgomp/test: Fix compilation for build sysroot Fix a problem with the libgomp testsuite using a method to determine the compiler to use resulting in the tool being different from one the library has been built with, and causing a catastrophic failure from the lack of a suitable `--sysroot=' option where the `--with-build-sysroot=' configuration option has been used to build the compiler resulting in the inability to link executables. Address this problem by defining the compiler to use, via the GCC_UNDER_TEST TCL variable, set in the DejaGNU configuration file from $CC by autoconf, which will have all the required options set for the target compiler to build executables in the environment configured, removing failures like: .../bin/riscv64-linux-gnu-ld: cannot find crt1.o: No such file or directory .../bin/riscv64-linux-gnu-ld: cannot find -lm .../bin/riscv64-linux-gnu-ld: cannot find -lpthread .../bin/riscv64-linux-gnu-ld: cannot find -lc .../bin/riscv64-linux-gnu-ld: cannot find -latomic collect2: error: ld returned 1 exit status compiler exited with status 1 FAIL: libgomp.c/../libgomp.c-c++-common/atomic-18.c (test for excess errors) Excess errors: .../bin/riscv64-linux-gnu-ld: cannot find crt1.o: No such file or directory .../bin/riscv64-linux-gnu-ld: cannot find -lm .../bin/riscv64-linux-gnu-ld: cannot find -lpthread .../bin/riscv64-linux-gnu-ld: cannot find -lc .../bin/riscv64-linux-gnu-ld: cannot find -latomic UNRESOLVED: libgomp.c/../libgomp.c-c++-common/atomic-18.c compilation failed to produce executable and bringing 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: === libgomp Summary === # of expected passes 44 # of unexpected failures 3274 # of unresolved testcases 3241 # of unsupported tests 548 to: === libgomp Summary === # of expected passes 6834 # of unexpected failures 4 # of expected failures 4 # of unsupported tests 518 libgomp/ * testsuite/libgomp-test-support.exp.in (GCC_UNDER_TEST): New variable. From-SVN: r279708 --- libgomp/ChangeLog | 5 +++++ libgomp/testsuite/libgomp-test-support.exp.in | 2 ++ 2 files changed, 7 insertions(+) diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 7bc7d41da42..c557aa436f2 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2019-12-22 Maciej W. Rozycki + + * testsuite/libgomp-test-support.exp.in (GCC_UNDER_TEST): New + variable. + 2019-12-21 Thomas Schwinge * target.c (gomp_map_vars_internal): Restore 'omp declare target diff --git a/libgomp/testsuite/libgomp-test-support.exp.in b/libgomp/testsuite/libgomp-test-support.exp.in index 98fb442b537..6ec10c728a3 100644 --- a/libgomp/testsuite/libgomp-test-support.exp.in +++ b/libgomp/testsuite/libgomp-test-support.exp.in @@ -1,3 +1,5 @@ +set GCC_UNDER_TEST {@CC@} + set cuda_driver_include "@CUDA_DRIVER_INCLUDE@" set cuda_driver_lib "@CUDA_DRIVER_LIB@" set hsa_runtime_lib "@HSA_RUNTIME_LIB@" -- 2.30.2