]> git.ipfire.org Git - thirdparty/gcc.git/commit
testsuite, Objective-C++: Update link flags [PR112863].
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 24 Jan 2024 08:05:41 +0000 (08:05 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 2 Feb 2024 09:01:22 +0000 (09:01 +0000)
commitbec7100445f07259d5df69c9f442ea72a90fc37e
tree0372bdf49cc78ca3f3d125f9744a2ee802f76af7
parente439c7827f5c5723fdd7df9c5fac55319db204af
testsuite, Objective-C++: Update link flags [PR112863].

These regressions are caused by missing or duplicate runpaths which
now fire linker warnings.

We need to add options to locate libobjc (and on Darwin libobjc-gnu)
along with libstdc++.
Usually '-L' options are added to point to the relevant directories for
the uninstalled libraries.

In cases where libraries are available as both shared and convenience
some additional checks are made.

For some targets -static-xxxx options are handled by specs substitution
and need a '-B' option rather than '-L'.  For Darwin, when embedded
runpaths are in use (the default for all versions after macOS 10.11),
'-B' is also needed to provide the runpath.

When '-B' is used, this results in a '-L' for each path that exists (so
that appending a '-L' as well is a needless duplicate).  There are also
cases where tools warn for duplicates, leading to spurious fails.

PR target/112863

gcc/testsuite/ChangeLog:

* lib/obj-c++.exp: Decide on whether to present -B or -L to
reference the paths to uninstalled libobjc/libobjc-gnu and
libstdc++ and use that to generate the link flags.
gcc/testsuite/lib/obj-c++.exp