diff options
-rw-r--r-- | autoconf/configure.ac | 3 | ||||
-rw-r--r-- | autoconf/m4/link_options.m4 | 21 | ||||
-rwxr-xr-x | configure | 27 | ||||
-rw-r--r-- | include/llvm/Config/config.h.in | 3 |
4 files changed, 53 insertions, 1 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 29a57b8385..7211fe1972 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -1041,6 +1041,9 @@ AC_PATH_PROGS(OCAMLDEP, [ocamldep]) AC_PATH_PROGS(OCAMLDOC, [ocamldoc]) AC_PATH_PROGS(GAS, [gas as]) +dnl Get the version of the linker in use. +AC_LINK_GET_VERSION + dnl Determine whether the linker supports the -R option. AC_LINK_USE_R diff --git a/autoconf/m4/link_options.m4 b/autoconf/m4/link_options.m4 index b48710c094..4c5f2f435d 100644 --- a/autoconf/m4/link_options.m4 +++ b/autoconf/m4/link_options.m4 @@ -1,4 +1,25 @@ # +# Get the linker version string. +# +# This macro is specific to LLVM. +# +AC_DEFUN([AC_LINK_GET_VERSION], + [AC_CACHE_CHECK([for linker version],[llvm_cv_link_version], + [ + version_string="$(ld -v 2>&1 | head -1)" + + # Check for ld64. + if (echo "$version_string" | grep -q "ld64"); then + llvm_cv_link_version=$(echo "$version_string" | sed -e "s#.*ld64-\([^ ]*\)#\1#") + else + llvm_cv_link_version=$(echo "$version_string" | sed -e "s#[^0-9]*\([0-9.]*\).*#\1#") + fi + ]) + AC_DEFINE_UNQUOTED([HOST_LINK_VERSION],"$llvm_cv_link_version", + [Linker version detected at compile time.]) +]) + +# # Determine if the system can handle the -R option being passed to the linker. # # This macro is specific to LLVM. @@ -8729,6 +8729,31 @@ fi done +{ echo "$as_me:$LINENO: checking for linker version" >&5 +echo $ECHO_N "checking for linker version... $ECHO_C" >&6; } +if test "${llvm_cv_link_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + version_string="$(ld -v 2>&1 | head -1)" + + # Check for ld64. + if (echo "$version_string" | grep -q "ld64"); then + llvm_cv_link_version=$(echo "$version_string" | sed -e "s#.*ld64-\([^ ]*\)#\1#") + else + llvm_cv_link_version=$(echo "$version_string" | sed -e "s#[^0-9]*\([0-9.]*\).*#\1#") + fi + +fi +{ echo "$as_me:$LINENO: result: $llvm_cv_link_version" >&5 +echo "${ECHO_T}$llvm_cv_link_version" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HOST_LINK_VERSION "$llvm_cv_link_version" +_ACEOF + + + { echo "$as_me:$LINENO: checking for compiler -Wl,-R<path> option" >&5 echo $ECHO_N "checking for compiler -Wl,-R<path> option... $ECHO_C" >&6; } if test "${llvm_cv_link_use_r+set}" = set; then @@ -11395,7 +11420,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<EOF -#line 11398 "configure" +#line 11423 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in index 5fe3da2570..d0612fe652 100644 --- a/include/llvm/Config/config.h.in +++ b/include/llvm/Config/config.h.in @@ -467,6 +467,9 @@ /* Define to 1 if you have the `__dso_handle' function. */ #undef HAVE___DSO_HANDLE +/* Linker version detected at compile time. */ +#undef HOST_LINK_VERSION + /* Installation directory for binary executables */ #undef LLVM_BINDIR |