]> git.ipfire.org Git - thirdparty/gcc.git/commit
testsuite, asan, hwsan: Add libstdc++ deps where required.
authorIain Sandoe <iain@sandoe.co.uk>
Fri, 26 Jan 2024 15:22:44 +0000 (15:22 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 2 Feb 2024 15:45:47 +0000 (15:45 +0000)
commita6afa0d06b0559b22be829ff197495d5c8653b96
tree850654223600448d4ded5d453b15d3b638b2cef2
parent2c27aa8d75113f404bf9cd39364611af386d9719
testsuite, asan, hwsan: Add libstdc++ deps where required.

We use the shared asan/hwasan rom both C,C++,D and Fortran.
The sanitizer libraries link to libstdc++.

When we are using the C/gdc/gfortran driver, and the target might
require a path to the libstdc++ (e.g. for handing -static-xxxx or
for embedded runpaths), we need to add a suitable option (or we get
fails at execution time because of the missing paths).

Conversely, we do not want to add multiple instances of these
paths (since that leads to failures on tools that report warnings
for duplicate runpaths).

This patch modifies the _init function to allow a single parameter
that determines whether the *asan_init should add a path for
libstdc++ (yes for C driver, no for C++ driver).

gcc/testsuite/ChangeLog:

* g++.dg/asan/asan.exp: Add a parameter to init to say that
we expect the C++ driver to provide paths for libstdc++.
* g++.dg/hwasan/hwasan.exp: Likewise
* gcc.dg/asan/asan.exp: Add a parameter to init to say that
we need a path added for libstdc++.
* gcc.dg/hwasan/hwasan.exp: Likewise.
* gdc.dg/asan/asan.exp: Likewise.
* gfortran.dg/asan/asan.exp: Likewise.
* lib/asan-dg.exp: Handle a single parameter to init that
requests addition of a path to libstdc++ to link flags.
* lib/hwasan-dg.exp: Likewise.
gcc/testsuite/g++.dg/asan/asan.exp
gcc/testsuite/g++.dg/hwasan/hwasan.exp
gcc/testsuite/gcc.dg/asan/asan.exp
gcc/testsuite/gcc.dg/hwasan/hwasan.exp
gcc/testsuite/gdc.dg/asan/asan.exp
gcc/testsuite/gfortran.dg/asan/asan.exp
gcc/testsuite/lib/asan-dg.exp
gcc/testsuite/lib/hwasan-dg.exp