Skip to content

Check asm goto support with AC_LINK_IFELSE #13716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -744,33 +744,18 @@ 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__)
__asm__ goto("b %l0\n" :::: end);
#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.
Expand Down