On 2020/1/6 11:25 PM, Maciej W. Rozycki wrote: > Overall if libgomp-test-support.exp is considered appropriate for > standalone testing, then I think two solutions are possible here: > > 1. An option is added to libgomp's $CC such that the compiler is able to > make builds involving the offload compiler where requested, and this > then propagates to GCC_UNDER_TEST as it stands. > > 2. The definition of GCC_UNDER_TEST in libgomp-test-support.exp is only > made if inexistent, and then you can predefine the variable in site.exp > however you find appropriate. Hi Maciej, I understand your situation with --with-build-sysroot/--without-sysroot, but the way you set GCC_UNDER_TEST in libgomp-test-support.exp appears to override too much of the machinery in libgomp/testsuite/lib/libgomp.exp that sets GCC_UNDER_TEST using DejaGNU find_gcc, etc. Can you test if the attached patch works for you? The patch exports the build sysroot setting from the toplevel to target library subdirs, and adds the --sysroot= option when doing build-tree testing (I assume that blddir != "" test is sufficient from the surrounding comments) I can only verify that it no longer "interferes" with our installed-mode testing. Also, if this does work, then other library testsuites (e.g. libatomic.exp) might also need considering updating, I think. Thanks, Chung-Lin 2020-01-14 Chung-Lin Tang * Makefile.tpl (NORMAL_TARGET_EXPORTS): Add export of SYSROOT_CFLAGS_FOR_TARGET variable. * Makefile.in: Regenerate. libgomp/ * testsuite/lib/libgomp.exp (ALWAYS_CFLAGS): Add --sysroot=$SYSROOT_CFLAGS_FOR_TARGET option when doing build-tree testing. Fix comment typo. * testsuite/libgomp-test-support.exp.in (GCC_UNDER_TEST): Delete definition.