diff options
author | Haru <haru@dotalux.com> | 2015-08-27 01:26:14 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-08-27 01:28:53 +0200 |
commit | 12c8ae2541b654a09bd6a2f264856f6fc0089a23 (patch) | |
tree | e8f40499272afe76343f7a1f744327dca801419f | |
parent | d2e3acbe3c388d36b8d2311d0f23b38babc1aae5 (diff) | |
download | hercules-12c8ae2541b654a09bd6a2f264856f6fc0089a23.tar.gz hercules-12c8ae2541b654a09bd6a2f264856f6fc0089a23.tar.bz2 hercules-12c8ae2541b654a09bd6a2f264856f6fc0089a23.tar.xz hercules-12c8ae2541b654a09bd6a2f264856f6fc0089a23.zip |
Added an availability check for the -rdynamic linker option
- Fixes an issue preventing to compile on non-ELF systems (i.e. OS X)
using recent gcc versions (such as 5.2) that are unable to filter out
this option where it's not needed.
- Thanks to Smokexyz for reporting the issue.
Signed-off-by: Haru <haru@dotalux.com>
-rwxr-xr-x | configure | 37 | ||||
-rw-r--r-- | configure.in | 29 |
2 files changed, 61 insertions, 5 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in afa7ec2. +# From configure.in d2e3acb. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -4616,8 +4616,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu CFLAGS="$CFLAGS -pipe -ffast-math -fvisibility=hidden -Wall -Wextra -Wno-sign-compare" CPPFLAGS="$CPPFLAGS -I../common" -LDFLAGS="$LDFLAGS -rdynamic" - +LDFLAGS="$LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } @@ -5008,6 +5007,38 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi +# +# Check if the linker supports/accepts -rdynamic +# Generally only needed by the ELF linker, in order to produce backtraces. +# On non-ELF platforms, some compilers (i.e. gcc < 5 and clang on OSX) are able to ignore it, others will error out. +# +OLD_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -rdynamic" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -rdynamic" >&5 +$as_echo_n "checking whether $CC accepts -rdynamic... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int main(int argc, char **argv) + { + return 0; + } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + LDFLAGS="$OLD_LDFLAGS" + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext # # LTO Support test diff --git a/configure.in b/configure.in index de709bede..5bb0dff65 100644 --- a/configure.in +++ b/configure.in @@ -487,8 +487,7 @@ AC_LANG([C]) CFLAGS="$CFLAGS -pipe -ffast-math -fvisibility=hidden -Wall -Wextra -Wno-sign-compare" CPPFLAGS="$CPPFLAGS -I../common" -LDFLAGS="$LDFLAGS -rdynamic" - +LDFLAGS="$LDFLAGS" AC_C_BIGENDIAN( [AC_MSG_ERROR([[bigendian is not supported... stopping]])], @@ -590,6 +589,32 @@ AC_RUN_IFELSE( ] ) +# +# Check if the linker supports/accepts -rdynamic +# Generally only needed by the ELF linker, in order to produce backtraces. +# On non-ELF platforms, some compilers (i.e. gcc < 5 and clang on OSX) are able to ignore it, others will error out. +# +OLD_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -rdynamic" +AC_MSG_CHECKING([whether $CC accepts -rdynamic]) +AC_LINK_IFELSE( + [AC_LANG_SOURCE([ + int main(int argc, char **argv) + { + return 0; + } + ])], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + LDFLAGS="$OLD_LDFLAGS" + ], + [ + AC_MSG_RESULT([guessing no]) + ] +) # # LTO Support test |