summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAnthony Green <green@moxielogic.com>2022-09-01 08:05:01 -0400
committerAnthony Green <green@moxielogic.com>2022-09-01 08:05:01 -0400
commitbcb42e432b5372b1876e8c8db68837d92d1f94ae (patch)
treee0a79af2a4aa31910ecd1e903fda4f69fc53c250 /configure.ac
parent0eb91425f355be19939507d4d4d056bdad12c9dd (diff)
downloadlibffi-bcb42e432b5372b1876e8c8db68837d92d1f94ae.tar.gz
Fix .cfi pseudo-ops test.
The existing tests were failing because the GCC was wrapping the test asm in cfi directives, which gas doesn't like. So now we test if the compiler emits them first, and assume that the assembler will accept them. If that doesn't work, then we test if the assembler will accept them assuming the compiler doesn't emit them.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 17 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index e427584..43fc03f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,7 +124,22 @@ AC_SUBST(HAVE_LONG_DOUBLE_VARIANT)
AC_C_BIGENDIAN
-GCC_AS_CFI_PSEUDO_OP
+AC_CACHE_CHECK([compiler generates .cfi pseudo-ops],
+ gcc_cv_as_cfi_pseudo_op, [
+ gcc_cv_as_cfi_pseudo_op=no
+ echo 'void foo(void) { foo(); }' > conftest.c
+ if $CC $CFLAGS -S conftest.c > /dev/null 2>&1; then
+ if grep -q cfi_startproc conftest.s; then
+ gcc_cv_as_cfi_pseudo_op=yes
+ fi
+ fi
+ ])
+if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then
+ AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1,
+ [Define if your assembler supports .cfi_* directives.])
+else
+ GCC_AS_CFI_PSEUDO_OP
+fi
case "$TARGET" in
SPARC)
@@ -391,7 +406,7 @@ AC_ARG_ENABLE(purify-safety,
AC_ARG_ENABLE(multi-os-directory,
[ --disable-multi-os-directory
disable use of gcc --print-multi-os-directory to change the library installation directory])
-
+
# These variables are only ever used when we cross-build to X86_WIN32.
# And we only support this with GCC, so...
if test "x$GCC" = "xyes"; then