Hi, This is v2 of patch series, originally posted here:
<https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00767.html> <https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00768.html> <https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00769.html> <https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00770.html> meant to address a problem with the testsuite compiler being set up across libatomic, libffi, libgo, libgomp with no correlation whatsoever to the target compiler being used in GCC compilation. Consequently there in no arrangement made to set up the compilation sysroot according to the build sysroot specified for GCC compilation, causing a catastrophic failure across the testsuites affected from the inability to link executables. Julian reported an issue triggered in his standalone test environment by the original version of the libgomp part of this patch series, which is one of the two patches from the series that have been already applied. The cause has been the newly-added definition of GCC_UNDER_TEST embedded in the generated libgomp/testsuite/libgomp-test-support.exp configuration file, which is used in Julian's setup which also relies on the invocation of `[find_gcc]' to locate the correct compiler to use. This invocation is unsuitable for in-tree testing as we want to use exactly the same compiler invocation, as recorded in $(CC), as used to build the library. So I have worked with Chung-Lin on a replacement version, which would work with such standalone testing while still satisfying the original requirement to use $(CC). In the end I have decided to use the documented `--tool_exec' option to `runtest' to contain the change within the testsuite's Makefile and its `check' goal, which is inherent to the build tree and as such not supposed to be used in standalone testing, like with `contrib/test_installed'. I am quite sure the problem is specific to libgomp only, as it's the only of the four libraries handled that had a preexisting *-test-support.exp test configuration file, and the remaining three only got one with the changes from the series. However to keep things consistent across the tree I propose to use the `--tool_exec' option for all four libraries. This in particular means reverting the whole of the libgomp change as well as a part of the libgo change, both already applied, in addition to making further adjustments. For libatomic and libffi this updated proposal merely replaces the original one. Verified with a cross-compiler configured for the `riscv-linux-gnu' target and the `x86_64-linux-gnu' host and using RISC-V/Linux QEMU in the user emulation mode as the target board. Also no change in results with `x86_64-linux-gnu' native regression testing. See individual change descriptions for details. I'm assuming Ian will take care of the 3/4 libgo change; OK to apply the remaining ones to the GCC repo? Maciej