bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Ben Pfaff <blp@cs.stanford.edu>
To: bug-gnulib@gnu.org, Bruno Haible <bruno@clisp.org>
Cc: Ben Pfaff <blp@cs.stanford.edu>
Subject: [PATCH] reloc-ldflags: Fix handling of multiple relocatable library directories.
Date: Sun, 13 Sep 2020 17:52:37 -0700	[thread overview]
Message-ID: <20200914005236.3852819-1-blp@cs.stanford.edu> (raw)

Each one needs its own -Wl,-rpath,$dir option, instead of being attached
to a single one in some way.  Otherwise, the build fails at link time.
---
2020-09-13  Ben Pfaff  <blp@cs.stanford.edu>

	* build-aux/reloc-ldflags: Fix handling of multiple relocatable
	library directories.  Each one needs its own -Wl,-rpath,$dir
	option, instead of being attached to a single one.
 
diff --git a/build-aux/reloc-ldflags b/build-aux/reloc-ldflags
index 145e741f8f..b1188a8707 100755
--- a/build-aux/reloc-ldflags
+++ b/build-aux/reloc-ldflags
@@ -90,7 +90,7 @@ if test -n "$origin_token"; then
         done
         dir="$origin_token"`echo "$idir" | sed -e 's,//*[^/]*,/..,g'`"$dir"
         # Add dir to rpath.
-        rpath="${rpath}${rpath:+ }$dir"
+        rpath="${rpath}${rpath:+ }-Wl,-rpath,$dir"
         ;;
       *)
         if test -n "$dir"; then
@@ -106,9 +106,9 @@ if test -n "$origin_token"; then
       # At least some versions of FreeBSD, DragonFly, and OpenBSD need the
       # linker option "-z origin". See <https://lekensteyn.nl/rpath.html>.
       freebsd* | dragonfly* | openbsd*)
-        echo "-Wl,-z,origin -Wl,-rpath,$rpath" ;;
+        echo "-Wl,-z,origin $rpath" ;;
       *)
-        echo "-Wl,-rpath,$rpath" ;;
+        echo "$rpath" ;;
     esac
   fi
 else
-- 
2.28.0



             reply	other threads:[~2020-09-14  0:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14  0:52 Ben Pfaff [this message]
2020-09-20 14:49 ` [PATCH] reloc-ldflags: Fix handling of multiple relocatable library directories Bruno Haible
2020-09-20 23:33   ` Ben Pfaff

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=20200914005236.3852819-1-blp@cs.stanford.edu \
    --to=blp@cs.stanford.edu \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@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).