summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAnthony Green <green@moxielogic.com>2014-03-14 16:54:31 -0400
committerAnthony Green <green@moxielogic.com>2014-03-14 16:54:31 -0400
commit76d19d004e36e99d261ee78261e2f52cea5e4ab1 (patch)
treef640032426977072a14bd33fd9e90cb27080eff9 /configure.ac
parentc86d9b6cc6e16ee262844a33b40441374400758c (diff)
parenta1a6f71bfe4199293043b2e4cfb4c8d3cb1112f9 (diff)
downloadlibffi-76d19d004e36e99d261ee78261e2f52cea5e4ab1.tar.gz
Ensure the linker supports @unwind sections in libffi.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 21 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index bf003fa..90a11f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -460,12 +460,28 @@ AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
if test x$TARGET = xX86_64; then
- AC_CACHE_CHECK([assembler supports unwind section type],
+ AC_CACHE_CHECK([toolchain supports unwind section type],
libffi_cv_as_x86_64_unwind_section_type, [
- libffi_cv_as_x86_64_unwind_section_type=yes
- echo '.section .eh_frame,"a",@unwind' > conftest.s
- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
- libffi_cv_as_x86_64_unwind_section_type=no
+ cat > conftest1.s << EOF
+.text
+.globl foo
+foo:
+jmp bar
+.section .eh_frame,"a",@unwind
+bar:
+EOF
+
+ cat > conftest2.c << EOF
+extern void foo();
+int main(){foo();}
+EOF
+
+ libffi_cv_as_x86_64_unwind_section_type=no
+ # we ensure that we can compile _and_ link an assembly file containing an @unwind section
+ # since the compiler can support it and not the linker (ie old binutils)
+ if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \
+ $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then
+ libffi_cv_as_x86_64_unwind_section_type=yes
fi
])
if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then