]> gcc.gnu.org Git - gcc.git/commit
testuite: fix libtdc++ libatomic flags
authorDavid Edelsohn <dje.gcc@gmail.com>
Fri, 23 Apr 2021 21:45:10 +0000 (17:45 -0400)
committerDavid Edelsohn <dje.gcc@gmail.com>
Fri, 28 May 2021 20:52:32 +0000 (16:52 -0400)
commit15c41a11ee5c1e917804f57315ba8968852ca016
tree094a86fb9d27cf927b1d5e97efb4c81c232baf8a
parent0be51abf080f1d7515e3777dd5e5a983b47573a8
testuite: fix libtdc++ libatomic flags

Some ports require libatomic for atomic operations, at least for some
data types and widths.  The libstdc++ testsuite previously was updated
to link against libatomic, but the search path was hard-coded to
something that is not always correct, and the shared library search
path was not set.

The search path was hard-coded to the expected location of the
libatomic build directory relative to the libstdc++ testsuite
directory, but if one uses parallelism when invoking the libstdc++
testsuite, the tests are run in the "normalXX" sub-directories, for
which the hard-coded search path is incorrect. The path also is
incorrect for alternative multilib and tool options.

This patch adopts the logic from gcc/testsuite/lib/atomic-dg.exp to
search for the library and adds the logic to the libstdc++ testsuite
libatomic seatch path code.  Previously the libstdc++ testsuite atomic
tests failed depending on the build configuration and if a build of
libatomic was installed in the default search path.

Bootstrapped on powerpc-ibm-aix7.2.3.0.

libstdc++-v3/ChangeLog:

* testsuite/lib/dg-options.exp (atomic_link_flags): New.
(add_options_for_libatomic): Use atomic_link_flags.

(cherry picked from commit fb6b24c66ea5a2ccbf6fb9f299c20a69f962ac9b)
libstdc++-v3/testsuite/lib/dg-options.exp
This page took 0.058479 seconds and 6 git commands to generate.