From 2d86809db6d1d626a9df40c283ec564ac98ff85d Mon Sep 17 00:00:00 2001 From: jacobly0 Date: Tue, 27 Oct 2020 10:00:03 -0400 Subject: [PATCH] Fix read-only .eh_frame section test when CFLAGS contains -flto. (#590) --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3ca1f4f..790274e 100644 --- a/configure.ac +++ b/configure.ac @@ -260,11 +260,13 @@ EOF fi if test "x$GCC" = "xyes"; then + AX_CHECK_COMPILE_FLAG(-fno-lto, libffi_cv_no_lto=-fno-lto) + AC_CACHE_CHECK([whether .eh_frame section should be read-only], libffi_cv_ro_eh_frame, [ libffi_cv_ro_eh_frame=yes echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c - if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then + if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then if readelf -WS conftest.o | grep -q -n 'eh_frame .* WA'; then libffi_cv_ro_eh_frame=no fi -- 2.34.1