bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: "CHIGOT, CLEMENT" <clement.chigot@atos.net>
To: "bug-gnulib@gnu.org" <bug-gnulib@gnu.org>
Subject: [PATCH] m4: fix --disable-rpath for AIX
Date: Mon, 10 Feb 2020 15:38:27 +0000	[thread overview]
Message-ID: <DB7PR02MB4075C4CE66BCB28F811E6E60EA190@DB7PR02MB4075.eurprd02.prod.outlook.com> (raw)

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




             reply	other threads:[~2020-02-10 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 15:38 CHIGOT, CLEMENT [this message]
2020-02-17  2:22 ` [PATCH] m4: fix --disable-rpath for AIX Bruno Haible
2020-02-17  9:40   ` CHIGOT, CLEMENT

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=DB7PR02MB4075C4CE66BCB28F811E6E60EA190@DB7PR02MB4075.eurprd02.prod.outlook.com \
    --to=clement.chigot@atos.net \
    --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).