Switch to using -Wl,-R on Solaris.
authorNick Lewycky <nicholas@mxc.ca>
Tue, 3 Mar 2009 04:55:15 +0000 (04:55 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Tue, 3 Mar 2009 04:55:15 +0000 (04:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65927 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.config.in
Makefile.rules
autoconf/configure.ac

index 6f91bee930012f3e4df949adff5a363bf6d4cbe9..ad490712138e2a13088caa0b6758af94ab1854de 100644 (file)
@@ -200,6 +200,9 @@ LLVMGCC_LANGS := @LLVMGCC_LANGS@
 # object files.
 OBJ_ROOT := .
 
+# What to pass as rpath flag to g++
+RPATH := @RPATH@
+
 # These are options that can either be enabled here, or can be enabled on the
 # make command line (ie, make ENABLE_PROFILING=1):
 
index 21403e0be169a96c4413f06e25374c03c983c60f..1dc329d046fa6c100907f5822fadb4a454d3c930 100644 (file)
@@ -428,7 +428,7 @@ ifdef LOADABLE_MODULE
 endif
 
 ifdef SHARED_LIBRARY
-  LD.Flags += -Wl,-rpath -Wl,$(LibDir)
+  LD.Flags += $(RPATH) -Wl,$(LibDir)
 endif
 
 ifdef TOOL_VERBOSE
@@ -458,9 +458,9 @@ endif
 ifneq ($(OS),Darwin)
 ifdef TOOLNAME
 ifdef EXAMPLE_TOOL
-  LD.Flags += -Wl,-rpath -Wl,$(ExmplDir) -export-dynamic
+  LD.Flags += $(RPATH) -Wl,$(ExmplDir) -export-dynamic
 else
-  LD.Flags += -Wl,-rpath -Wl,$(ToolDir) -export-dynamic
+  LD.Flags += $(RPATH) -Wl,$(ToolDir) -export-dynamic
 endif
 endif
 endif
index 9b852d970ff372c4edd786d18a417ca04252af53..e58dc66765a2c718ee7ebf927db22013dcbc9bdb 100644 (file)
@@ -1016,6 +1016,13 @@ fi
 dnl Determine if the compiler supports -fvisibility-inlines-hidden.
 AC_CXX_USE_VISIBILITY_INLINES_HIDDEN
 
+dnl Determine linker rpath flag
+case $llvm_cv_os_type in
+  SunOS) RPATH="-Wl,-R" ;;
+  *) RPATH="-Wl,-rpath" ;;
+esac
+AC_SUBST(RPATH)
+
 dnl===-----------------------------------------------------------------------===
 dnl===
 dnl=== SECTION 10: Specify the output files and generate it