public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r12-6768] libstdc++: Only add valid -L paths to testsuite linker options
Date: Thu, 20 Jan 2022 12:30:14 +0000 (GMT)	[thread overview]
Message-ID: <20220120123014.103193858D35@sourceware.org> (raw)

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}
       ;;
     *)


                 reply	other threads:[~2022-01-20 12:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220120123014.103193858D35@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).