[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] reloc-ldflags: Fix handling of multiple relocatable library dire
From: |
Ben Pfaff |
Subject: |
[PATCH] reloc-ldflags: Fix handling of multiple relocatable library directories. |
Date: |
Sun, 13 Sep 2020 17:52:37 -0700 |
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
- [PATCH] reloc-ldflags: Fix handling of multiple relocatable library directories.,
Ben Pfaff <=