diff options
| author | H.J. Lu <hjl.tools@gmail.com> | 2024-12-16 19:20:54 +0800 |
|---|---|---|
| committer | H.J. Lu <hjl.tools@gmail.com> | 2024-12-22 12:55:50 +0800 |
| commit | d9d30f6cb582fbd3932aa4731061c6335ffc5a70 (patch) | |
| tree | 74b702da46a9377a9adf61f1f4dce3182f5025e2 /configure.ac | |
| parent | f5fb9fa011f242bfd8c291fe876532ebd252397e (diff) | |
| download | glibc-d9d30f6cb582fbd3932aa4731061c6335ffc5a70.tar.xz glibc-d9d30f6cb582fbd3932aa4731061c6335ffc5a70.zip | |
Enable execstack tests only if compiler supports trampoline
Since trampoline is required to test execstack, enable execstack tests
only if compiler supports trampoline.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 6eaf83b8dc..d4c1c7c916 100644 --- a/configure.ac +++ b/configure.ac @@ -1527,6 +1527,28 @@ LIBC_CONFIG_VAR([cc-option-wimplicit-fallthrough], [$libc_cv_cc_wimplicit_fallthrough]) AC_SUBST(libc_cv_test_cc_wimplicit_fallthrough) +conftest_code=" +void bar (void (*callback) (void)); +int foo (void) +{ + int var = 0; + void callback (void) { var = 1; } + bar (callback); + return var; +} +" + +dnl Check if TEST_CC support trampolines. +LIBC_TRY_TEST_CC_COMMAND([support for trampolines], + [$conftest_code], + [-c -Werror], + libc_cv_test_cc_trampolines, + [libc_cv_test_cc_trampolines=yes], + [libc_cv_test_cc_trampolines=no] +) +LIBC_CONFIG_VAR([have-test-cc-trampoline], + [$libc_cv_test_cc_trampolines]) + dnl Check if TEST_CC supports -finput-charset=ascii. LIBC_TRY_TEST_CC_OPTION([-finput-charset=ascii], [-c -Werror -finput-charset=ascii], |
