[php-src] master: Check asm goto support with AC_LINK_IFELSE (#13716)
| From: | Peter Kokot via GitHub | Date: | Fri, 15 Mar 2024 05:58:16 +0000 |
| Subject: | [php-src] master: Check asm goto support with AC_LINK_IFELSE (#13716) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-127741@lists.php.net to get a copy of this message | ||
Author: Peter Kokot (petk)
Committer: GitHub (web-flow)
Pusher: petk
Date: 2024-03-15T06:44:27+01:00
Commit: https://github.com/php/php-src/commit/d2eb3e54ea3a4ef13898154b52e640c82d82efae
Raw diff: https://github.com/php/php-src/commit/d2eb3e54ea3a4ef13898154b52e640c82d82efae.diff
Check asm goto support with AC_LINK_IFELSE (#13716)
The '__asm__ goto' support is properly recognized by a simpler linking
check instead of a run check for easier cross-compilation. The
compile only check (AC_COMPILE_IFELSE) might produce false positives
results with certain compiler options.
Changed paths:
M configure.ac
Diff:
diff --git a/configure.ac b/configure.ac
index bcf655ed4dc5..715734fa8c17 100644
--- a/configure.ac
+++ b/configure.ac
@@ -744,20 +744,8 @@ if test "$ac_cv_func___crc32d" = "yes"; then
fi
dnl Check for asm goto support.
-AC_CACHE_CHECK([for asm goto], ac_cv__asm_goto,
-[AC_RUN_IFELSE([AC_LANG_SOURCE([[
-int main(void) {
-#if defined(__x86_64__) || defined(__i386__)
- __asm__ goto("jmp %l0\n" :::: end);
-#elif defined(__aarch64__)
- __asm__ goto("b %l0\n" :::: end);
-#endif
-end:
- return 0;
-}
- ]])], [ac_cv__asm_goto=yes], [ac_cv__asm_goto=no], [
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-int main(void) {
+AC_CACHE_CHECK([for asm goto], [ac_cv__asm_goto],
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
#if defined(__x86_64__) || defined(__i386__)
__asm__ goto("jmp %l0\n" :::: end);
#elif defined(__aarch64__)
@@ -765,12 +753,9 @@ int main(void) {
#endif
end:
return 0;
-}
- ]])], [ac_cv__asm_goto=yes], [ac_cv__asm_goto=no])
-])])
-
+]])], [ac_cv__asm_goto=yes], [ac_cv__asm_goto=no])])
if test "$ac_cv__asm_goto" = yes; then
- AC_DEFINE(HAVE_ASM_GOTO,1,[Define if asm goto support])
+ AC_DEFINE([HAVE_ASM_GOTO], [1], [Define if asm goto support is available.])
fi
dnl Check valgrind support.