public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6768] libstdc++: Only add valid -L paths to testsuite linker options
@ 2022-01-20 12:30 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2022-01-20 12:30 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:5929f253fcdbf24fd47706dd11aafdeac5e9ecb6

commit r12-6768-g5929f253fcdbf24fd47706dd11aafdeac5e9ecb6
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jan 20 11:15:27 2022 +0000

    libstdc++: Only add valid -L paths to testsuite linker options
    
    The MacOS linker warns about -L arguments that don't exist, which causes
    all tests to fail for the defauly configuration (because libbacktrace
    isn't built).
    
    libstdc++-v3/ChangeLog:
    
            * scripts/testsuite_flags.in: Only add src/filesystem/.libs and
            src/libbacktrace/.libs to LDFLAGS if those directories exist.

Diff:
---
 libstdc++-v3/scripts/testsuite_flags.in | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/libstdc++-v3/scripts/testsuite_flags.in b/libstdc++-v3/scripts/testsuite_flags.in
index 40dd3d3465e..18748f0f9ce 100755
--- a/libstdc++-v3/scripts/testsuite_flags.in
+++ b/libstdc++-v3/scripts/testsuite_flags.in
@@ -77,9 +77,15 @@ case ${query} in
       echo ${PCHFLAGS}
       ;;
     --cxxldflags)
-      SECTIONLDFLAGS="@SECTION_LDFLAGS@ @LIBICONV@
-                      -L${BUILD_DIR}/src/filesystem/.libs
-                      -L${BUILD_DIR}/src/libbacktrace/.libs"
+      FS_LDFLAGS=
+      BT_LDFLAGS=
+      if [ -d ${BUILD_DIR}/src/filesystem/.libs ]; then
+        FS_LDFLAGS=-L${BUILD_DIR}/src/filesystem/.libs
+      fi
+      if [ -d ${BUILD_DIR}/src/libbacktrace/.libs ]; then
+        BT_LDFLAGS=-L${BUILD_DIR}/src/libbacktrace/.libs
+      fi
+      SECTIONLDFLAGS="@SECTION_LDFLAGS@ @LIBICONV@ $FS_LDFLAGS $BT_LDFLAGS"
       echo ${SECTIONLDFLAGS}
       ;;
     *)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-20 12:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 12:30 [gcc r12-6768] libstdc++: Only add valid -L paths to testsuite linker options Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).