[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] m4: fix --disable-rpath for AIX
From: |
CHIGOT, CLEMENT |
Subject: |
[PATCH] m4: fix --disable-rpath for AIX |
Date: |
Mon, 10 Feb 2020 15:38:27 +0000 |
Currently, --disable-rpath will add directly $found_so to the compilation
line. However, on AIX, this will result on the path being hardcoded in
the built binaries.
The only way to avoid hardcoded paths without using linker flags (like
-Wl,-bnoipath) is to add -l$name.
---
m4/lib-link.m4 | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
index 0ff10731f..01bcfd5ee 100644
--- a/m4/lib-link.m4
+++ b/m4/lib-link.m4
@@ -377,7 +377,12 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
|| test "X$found_dir" = "X/usr/$acl_libdirstem" \
|| test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
dnl No hardcoding is needed.
- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+ case $host_os in
+ dnl Using directly $found_so on AIX will result into
+ dnl hardcoded libraries' path inside binaries.
+ aix*) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir
-l$name" ;;
+ *) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" ;;
+ esac
else
dnl Use an explicit option to hardcode DIR into the resulting
dnl binary.
--
2.17.1
- [PATCH] m4: fix --disable-rpath for AIX,
CHIGOT, CLEMENT <=