[llvm-commits] [llvm] r66156 - in /llvm/trunk: Makefile.config.in autoconf/configure.ac autoconf/m4/link_options.m4 autoconf/m4/link_use_r.m4

Nick Lewycky nicholas at mxc.ca
Thu Mar 5 00:20:21 PST 2009


Author: nicholas
Date: Thu Mar  5 02:20:21 2009
New Revision: 66156

URL: http://llvm.org/viewvc/llvm-project?rev=66156&view=rev
Log:
Autodetect the availability of -export-dynamic in the linker.

Added:
    llvm/trunk/autoconf/m4/link_options.m4
Removed:
    llvm/trunk/autoconf/m4/link_use_r.m4
Modified:
    llvm/trunk/Makefile.config.in
    llvm/trunk/autoconf/configure.ac

Modified: llvm/trunk/Makefile.config.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=66156&r1=66155&r2=66156&view=diff

==============================================================================
--- llvm/trunk/Makefile.config.in (original)
+++ llvm/trunk/Makefile.config.in Thu Mar  5 02:20:21 2009
@@ -203,6 +203,9 @@
 # What to pass as rpath flag to g++
 RPATH := @RPATH@
 
+# What to pass as -rdynamic flag to g++
+RDYNAMIC := @RDYNAMIC@
+
 # These are options that can either be enabled here, or can be enabled on the
 # make command line (ie, make ENABLE_PROFILING=1):
 

Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=66156&r1=66155&r2=66156&view=diff

==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Thu Mar  5 02:20:21 2009
@@ -636,9 +636,12 @@
 AC_PATH_PROGS(OCAMLDOC, [ocamldoc])
 AC_PATH_PROGS(GAS, [gas as])
 
-dnl Determine if the linker supports the -R option.
+dnl Determine whether the linker supports the -R option.
 AC_LINK_USE_R
 
+dnl Determine whether the linker supports the -export-dynamic option.
+AC_LINK_EXPORT_DYNAMIC
+
 dnl Check for libtool and the library that has dlopen function (which must come
 dnl before the AC_PROG_LIBTOOL check in order to enable dlopening libraries with
 dnl libtool).
@@ -1013,16 +1016,25 @@
   AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings.])
 fi
 
-dnl Determine if the compiler supports -fvisibility-inlines-hidden.
+dnl Determine whether 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
+if test "$llvm_cv_link_use_r" = "yes" ; then
+  RPATH="-Wl,-R"
+else
+  RPATH="-Wl,-rpath"
+fi
 AC_SUBST(RPATH)
 
+dnl Determine linker rdynamic flag
+if test "$llvm_cv_link_use_export_dynamic" = "yes" ; then
+  RDYNAMIC="-Wl,-export-dynamic"
+else
+  RDYNAMIC=""
+fi
+AC_SUBST(RDYNAMIC)
+
 dnl===-----------------------------------------------------------------------===
 dnl===
 dnl=== SECTION 10: Specify the output files and generate it

Added: llvm/trunk/autoconf/m4/link_options.m4
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/m4/link_options.m4?rev=66156&view=auto

==============================================================================
--- llvm/trunk/autoconf/m4/link_options.m4 (added)
+++ llvm/trunk/autoconf/m4/link_options.m4 Thu Mar  5 02:20:21 2009
@@ -0,0 +1,41 @@
+#
+# Determine if the system can handle the -R option being passed to the linker.
+#
+# This macro is specific to LLVM.
+#
+AC_DEFUN([AC_LINK_USE_R],
+[AC_CACHE_CHECK([for compiler -Wl,-R<path> option],[llvm_cv_link_use_r],
+[ AC_LANG_PUSH([C])
+  oldcflags="$CFLAGS"
+  CFLAGS="$CFLAGS -Wl,-R."
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
+    [llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no])
+  CFLAGS="$oldcflags"
+  AC_LANG_POP([C])
+])
+if test "$llvm_cv_link_use_r" = yes ; then
+  AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.])
+  fi
+])
+
+#
+# Determine if the system can handle the -R option being passed to the linker.
+#
+# This macro is specific to LLVM.
+#
+AC_DEFUN([AC_LINK_EXPORT_DYNAMIC],
+[AC_CACHE_CHECK([for compiler -Wl,-export-dynamic option],
+                [llvm_cv_link_use_export_dynamic],
+[ AC_LANG_PUSH([C])
+  oldcflags="$CFLAGS"
+  CFLAGS="$CFLAGS -Wl,-export-dynamic"
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
+    [llvm_cv_link_use_export_dynamic=yes],[llvm_cv_link_use_export_dynamic=no])
+  CFLAGS="$oldcflags"
+  AC_LANG_POP([C])
+])
+if test "$llvm_cv_link_use_export_dynamic" = yes ; then
+  AC_DEFINE([HAVE_LINK_EXPORT_DYNAMIC],[1],[Define if you can use -Wl,-export-dynamic.])
+  fi
+])
+

Removed: llvm/trunk/autoconf/m4/link_use_r.m4
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/m4/link_use_r.m4?rev=66155&view=auto

==============================================================================
--- llvm/trunk/autoconf/m4/link_use_r.m4 (original)
+++ llvm/trunk/autoconf/m4/link_use_r.m4 (removed)
@@ -1,19 +0,0 @@
-#
-# Determine if the system can handle the -R option being passed to the linker.
-#
-# This macro is specific to LLVM.
-#
-AC_DEFUN([AC_LINK_USE_R],
-[AC_CACHE_CHECK([for compiler -Wl,-R<path> option],[llvm_cv_link_use_r],
-[ AC_LANG_PUSH([C])
-  oldcflags="$CFLAGS"
-  CFLAGS="$CFLAGS -Wl,-R."
-  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],
-    [llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no])
-  CFLAGS="$oldcflags"
-  AC_LANG_POP([C])
-])
-if test "$llvm_cv_link_use_r" = yes ; then
-  AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.])
-  fi
-])





More information about the llvm-commits mailing list