Commit 817a43fbc1d6d1c702c492e926f158b17ae988e4

Anthony Green 2022-09-28T09:05:45

Revert to previous cfi check. (#735)

diff --git a/configure.ac b/configure.ac
index 2cb26f9..b5ae3d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,20 +124,7 @@ AC_SUBST(HAVE_LONG_DOUBLE_VARIANT)
 
 AC_C_BIGENDIAN
 
-AC_CACHE_CHECK([compiler generates .cfi pseudo-ops],
-  gcc_cv_cc_cfi_pseudo_op, [
-	gcc_cv_cc_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_cc_cfi_pseudo_op=yes
-            fi
-	fi
-	])
-if test "x$gcc_cv_cc_cfi_pseudo_op" = xyes; then
-   AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1,
-      [Define if your assembler supports .cfi_* directives.])
-fi
+GCC_AS_CFI_PSEUDO_OP
 
 case "$TARGET" in
   SPARC)
diff --git a/m4/asmcfi.m4 b/m4/asmcfi.m4
new file mode 100644
index 0000000..3e28602
--- /dev/null
+++ b/m4/asmcfi.m4
@@ -0,0 +1,13 @@
+AC_DEFUN([GCC_AS_CFI_PSEUDO_OP],
+[AC_CACHE_CHECK([assembler .cfi pseudo-op support],
+    gcc_cv_as_cfi_pseudo_op, [
+    gcc_cv_as_cfi_pseudo_op=unknown
+    AC_TRY_COMPILE([asm (".cfi_sections\n\t.cfi_startproc\n\t.cfi_endproc");],,
+		   [gcc_cv_as_cfi_pseudo_op=yes],
+		   [gcc_cv_as_cfi_pseudo_op=no])
+ ])
+ 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.])
+ fi
+])