summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorjacobly0 <jacobly0@users.noreply.github.com>2020-10-27 10:00:03 -0400
committerGitHub <noreply@github.com>2020-10-27 10:00:03 -0400
commit2d86809db6d1d626a9df40c283ec564ac98ff85d (patch)
treecea90b24198f5d0212c422c61183849e909bdc81 /configure.ac
parentf4435980fa2da335fe388db431d4a7946a99a2b9 (diff)
downloadlibffi-2d86809db6d1d626a9df40c283ec564ac98ff85d.tar.gz
Fix read-only .eh_frame section test when CFLAGS contains -flto. (#590)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac4
1 files changed, 3 insertions, 1 deletions
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