Alexandre Julliard : configure: Add .cfi_startproc/ endproc directives to assembly functions if supported.

Alexandre Julliard julliard at winehq.org
Fri Jun 12 10:41:09 CDT 2009


Module: wine
Branch: master
Commit: ccea0ae9e2fb4a73da542c05222705adf301513a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ccea0ae9e2fb4a73da542c05222705adf301513a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Jun 11 19:46:19 2009 +0200

configure: Add .cfi_startproc/endproc directives to assembly functions if supported.

---

 configure    |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac |   10 ++++++++++
 2 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 90b82a7..3130f70 100755
--- a/configure
+++ b/configure
@@ -17865,12 +17865,69 @@ fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_c_dot_previous" >&5
 $as_echo "$ac_cv_c_dot_previous" >&6; }
 
+{ $as_echo "$as_me:$LINENO: checking whether CFI directives are supported in assembly code" >&5
+$as_echo_n "checking whether CFI directives are supported in assembly code... " >&6; }
+if test "${ac_cv_c_cfi_support+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+asm(".text\nac_test:\t.cfi_startproc\n\t.long 0\n\t.cfi_endproc");
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_cfi_support="yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_c_cfi_support="no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_cfi_support" >&5
+$as_echo "$ac_cv_c_cfi_support" >&6; }
+
 asm_func_header=".globl $asm_name_prefix\" #name \"\\n\\t$asm_func_header\\n$asm_name_prefix\" #name \":\\n\\t"
 asm_func_trailer=""
 if test "$ac_cv_c_dot_previous" = "yes"
 then
    asm_func_trailer="\\n\\t.previous"
 fi
+if test "$ac_cv_c_cfi_support" = "yes"
+then
+   asm_func_header="$asm_func_header.cfi_startproc\\n\\t"
+   asm_func_trailer="\\n\\t.cfi_endproc$asm_func_trailer"
+fi
+
 asm_func_code="$asm_func_header\" code \"$asm_func_trailer"
 
 
diff --git a/configure.ac b/configure.ac
index 4f74d71..4b89c19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1438,12 +1438,22 @@ AC_CACHE_CHECK([whether .previous is supported in assembly code], ac_cv_c_dot_pr
     WINE_TRY_ASM_LINK([".text\nac_test:\t.long 0\n\t.previous"],,,
                       ac_cv_c_dot_previous="yes",ac_cv_c_dot_previous="no"))
 
+AC_CACHE_CHECK([whether CFI directives are supported in assembly code], ac_cv_c_cfi_support,
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[asm(".text\nac_test:\t.cfi_startproc\n\t.long 0\n\t.cfi_endproc");]])],
+                      ac_cv_c_cfi_support="yes",ac_cv_c_cfi_support="no"))
+
 asm_func_header=".globl $asm_name_prefix\" #name \"\\n\\t$asm_func_header\\n$asm_name_prefix\" #name \":\\n\\t"
 asm_func_trailer=""
 if test "$ac_cv_c_dot_previous" = "yes"
 then
    asm_func_trailer="\\n\\t.previous"
 fi
+if test "$ac_cv_c_cfi_support" = "yes"
+then
+   asm_func_header="$asm_func_header.cfi_startproc\\n\\t"
+   asm_func_trailer="\\n\\t.cfi_endproc$asm_func_trailer"
+fi
+
 asm_func_code="$asm_func_header\" code \"$asm_func_trailer"
 
 AH_TEMPLATE(__ASM_GLOBAL_FUNC,[Define to a macro to generate an assembly function])




More information about the wine-cvs mailing list