On Fri, Jan 30, 2026 at 07:54:12PM -0500, Pietro Monteiro wrote:
> Libitm C++ tests pass -B/full/path/to/build/libstc++/src/.libs on the
> options argument to dg-runtest and the libstdc++ include paths as
> the default-extra-options. This causes 2 problems:
>
> 1) If a test uses `dg-options' then the libstdc++ include paths are
> not passed to the compiler.
>
> 2) The `-B/full/path/to/build/libstc++/src/.libs' gets added to the
> test name. This makes comparing build done in different directories
> harder because the hardcoded full path.
>
> Stop passing options and default-extra-options to dg-runtest and move
> dealing with the path-releated flags to libitm_target_compile in
> libitm.exp, where they are added to additional_flags.
>
> Also change the FSF address to the website in the license text.
>
> libitm/ChangeLog:
> PR libitm/69018
> * testsuite/lib/libitm.exp (libitm_target_compile): Add
> lang_include_flags and `-B${blddir}/${lang_library_paths}' to
> additional_flags.
> * testsuite/libitm.c++/c++.exp: Set lang_library_paths and
> lang_include_flags.
This regressed pretty much all the libitm tests in our distro testing.
See below. Testing with make check
RUNTESTFLAGS=--target_board=unix/-fstack-protector-strong
works though, so it is not about the extra option, but about modifying
variables which are not reset to their previous values.
So I think any testing where libitm.exp runs the c.exp tests, then c++.exp
tests and then c.exp tests with a different set of flags will be broken.
Looking at the log file, the first alloc-1.c compilation is
Executing on host: /home/jakub/src/gcc/obj92/gcc/xgcc
-B/home/jakub/src/gcc/obj92/gcc/
../../../../libitm/testsuite/libitm.c/alloc-1.c
-B/home/jakub/src/gcc/obj92/x86_64-pc-linux-gnu/./libitm/
-I/home/jakub/src/gcc/obj92/x86_64-pc-linux-gnu/./libitm
-I../../../../libitm/testsuite/.. -fmessage-length=0 -fgnu-tm
-fdiagnostics-color=never -O2
-L/home/jakub/src/gcc/obj92/x86_64-pc-linux-gnu/./libitm/.libs -lm -o
./alloc-1.exe (timeout = 300)
but the second one is
Executing on host: /home/jakub/src/gcc/obj92/gcc/xgcc
-B/home/jakub/src/gcc/obj92/gcc/
../../../../libitm/testsuite/libitm.c/alloc-1.c -fstack-protector-strong
-B/home/jakub/src/gcc/obj92/x86_64-pc-linux-gnu/./libitm/
-I/home/jakub/src/gcc/obj92/x86_64-pc-linux-gnu/./libitm
-I../../../../libitm/testsuite/.. -fmessage-length=0 -fgnu-tm
-fdiagnostics-color=never -O2
-L/home/jakub/src/gcc/obj92/x86_64-pc-linux-gnu/./libitm/.libs -shared-libgcc
-lstdc++ -lm -o ./alloc-1.exe (timeout = 300)
So, in addition to -fstack-protector-strong added (that is expected and
correct) it also adds -shared-libgcc -lstdc++ and that is obviously not
correct.
make check RUNTESTFLAGS='--target_board=unix\{,-fstack-protector-strong\}'
Making check in testsuite
make[1]: Entering directory
'/home/jakub/src/gcc/obj92/x86_64-pc-linux-gnu/libitm/testsuite'
make check-DEJAGNU
make[2]: Entering directory
'/home/jakub/src/gcc/obj92/x86_64-pc-linux-gnu/libitm/testsuite'
srcdir='../../../../libitm/testsuite'; export srcdir; \
EXPECT=expect; export EXPECT; \
if /bin/sh -c "runtest --version" > /dev/null 2>&1; then \
exit_status=0; l='libitm'; for tool in $l; do \
if runtest --tool $tool --srcdir $srcdir
--target_board=unix\{,-fstack-protector-strong\}; \
then :; else exit_status=1; fi; \
done; \
else echo "WARNING: could not find 'runtest '" 1>&2; :;\
fi; \
exit $exit_status
WARNING: Couldn't find the global config file.
Using ../../../../libitm/testsuite/lib/libitm.exp as tool init file.
Test run by jakub on Wed Feb 11 12:55:20 2026
Native configuration is x86_64-pc-linux-gnu
=== libitm tests ===
Schedule of variations:
unix
unix/-fstack-protector-strong
Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ../../../../libitm/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running ../../../../libitm/testsuite/libitm.c/c.exp ...
Running ../../../../libitm/testsuite/libitm.c++/c++.exp ...
=== libitm Summary for unix ===
# of expected passes 44
# of expected failures 3
# of unsupported tests 1
Running target unix/-fstack-protector-strong
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for
target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ../../../../libitm/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running ../../../../libitm/testsuite/libitm.c/c.exp ...
FAIL: libitm.c/alloc-1.c (test for excess errors)
FAIL: libitm.c/cancel.c (test for excess errors)
FAIL: libitm.c/clone-1.c (test for excess errors)
FAIL: libitm.c/dropref-2.c (test for excess errors)
FAIL: libitm.c/dropref.c (test for excess errors)
FAIL: libitm.c/memcpy-1.c (test for excess errors)
FAIL: libitm.c/memset-1.c (test for excess errors)
FAIL: libitm.c/notx.c (test for excess errors)
FAIL: libitm.c/priv-1.c (test for excess errors)
FAIL: libitm.c/reentrant.c (test for excess errors)
FAIL: libitm.c/simple-1.c (test for excess errors)
FAIL: libitm.c/simple-2.c (test for excess errors)
FAIL: libitm.c/stackundo.c (test for excess errors)
FAIL: libitm.c/txrelease.c (test for excess errors)
Running ../../../../libitm/testsuite/libitm.c++/c++.exp ...
=== libitm Summary for unix/-fstack-protector-strong ===
# of expected passes 18
# of unexpected failures 14
# of expected failures 1
# of unresolved testcases 14
# of unsupported tests 1
=== libitm Summary ===
# of expected passes 62
# of unexpected failures 14
# of expected failures 4
# of unresolved testcases 14
# of unsupported tests 2
make[2]: *** [Makefile:337: check-DEJAGNU] Error 1
make[2]: Leaving directory
'/home/jakub/src/gcc/obj92/x86_64-pc-linux-gnu/libitm/testsuite'
make[1]: *** [Makefile:380: check-am] Error 2
make[1]: Leaving directory
'/home/jakub/src/gcc/obj92/x86_64-pc-linux-gnu/libitm/testsuite'
make: *** [Makefile:843: check-recursive] Error 1
Jakub