GNU bug report logs - #17747
Potential bug on Mac OS X 10.9 ignoring -rpath

Previous Next

Package: libtool;

Reported by: Pekka Nikander <pekka.nikander <at> iki.fi>

Date: Tue, 10 Jun 2014 15:39:03 UTC

Severity: normal

To reply to this bug, email your comments to 17747 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-libtool <at> gnu.org:
bug#17747; Package libtool. (Tue, 10 Jun 2014 15:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pekka Nikander <pekka.nikander <at> iki.fi>:
New bug report received and forwarded. Copy sent to bug-libtool <at> gnu.org. (Tue, 10 Jun 2014 15:39:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pekka Nikander <pekka.nikander <at> iki.fi>
To: bug-libtool <at> gnu.org
Subject: Potential bug on Mac OS X 10.9 ignoring -rpath
Date: Tue, 10 Jun 2014 14:01:33 +0300
[Message part 1 (text/plain, inline)]
I am trying to compile the TCE LLVM backend (http://tce.cs.tut.fi) under Mac OS X Maverics.  The hardest problem I've encountered so far is that in addition to the LLVM 3.4 installed as a part of Mac OS X, the TCE environment requires its own, slightly patched version of LLVM 3.4.  Both of these are needed, as the native Mac OS X LLVM is needed to compile the TCE source code in native MachO binaries, while the TCE-internal LLVM is needed to compile source code for the TCE targets, including newlib.

Now, since both of them are LLVM 3.4, they both have identically named shared libraries, with identical APIs.  Hence, the two versions need to be differentiated with an embedded rpath.  Using the DYLD_LIBRARY_PATH will not work, as independent of which of the two versions I place into the DYLD_LIBRARY_PATH, some of the binaries fail at the dynamic linking phase due to library incompatibilities.

Now, it appears that libtool 2.4.2 is ignoring the -rpath option for darwin, i.e. Mac OS X.  I have no information why.

I'm enclosing a minimal patch that seems to fix this problem, allowing -rpath to be used from the libtool command line and be preserved all the way down to calling the compiler.

Please note that I'm a complete newbie to libtool internals.  Hence, this patch may well break something else.

--Pekka Nikander
  http://www.pnr.iki.fi

diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 44e0ecf..6cee273 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1084,6 +1084,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
 [
   m4_require([_LT_REQUIRED_DARWIN_CHECKS])
   _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_automatic, $1)=yes
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -1102,14 +1103,14 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   esac
   if test "$_lt_dar_can_shared" = "yes"; then
     output_verbose_link_cmd=func_echo_all
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
     _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -instal
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -instal
     _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_
     m4_if([$1], [CXX],
 [   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_nam
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$al
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_nam
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$al
     fi
 ],[])
   else


[smime.p7s (application/pkcs7-signature, attachment)]

This bug report was last modified 11 years and 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.