diff options
| author | Sam James <sam@gentoo.org> | 2025-02-18 18:49:09 +0000 |
|---|---|---|
| committer | Sam James <sam@gentoo.org> | 2025-03-04 20:08:50 +0000 |
| commit | a2bd5008a99032830add3e4005c25b61e3207112 (patch) | |
| tree | ceb139b81bdce2b243059469208aa40fd8c76cc4 /configure | |
| parent | 4cf2d869367e3813c6c8f662915dedb1f3830c53 (diff) | |
| download | glibc-a2bd5008a99032830add3e4005c25b61e3207112.tar.xz glibc-a2bd5008a99032830add3e4005c25b61e3207112.zip | |
Pass -Wl,--no-error-execstack for tests where -Wl,-z,execstack is used [PR32717]
When GNU Binutils is configured with --enable-error-execstack=yes, a handful
of our tests which rely on -Wl,-z,execstack fail. Pass --Wl,--no-error-execstack
to override the behaviour and get a warning instead.
Bug: https://sourceware.org/PR32717
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -659,6 +659,7 @@ libc_cv_has_glob_dat libc_cv_fpie libc_cv_test_static_pie libc_cv_z_execstack +libc_cv_no_error_execstack ASFLAGS_config libc_cv_cc_with_libunwind libc_cv_insert @@ -7114,6 +7115,40 @@ if test $libc_cv_as_noexecstack = yes; then fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for linker that supports --no-error-execstack" >&5 +printf %s "checking for linker that supports --no-error-execstack... " >&6; } +libc_linker_feature=no +cat > conftest.c <<EOF +int _start (void) { return 42; } +EOF +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp + -Wl,-no-error-execstack -nostdlib -nostartfiles + -fPIC -shared -o conftest.so conftest.c + 1>&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-no-error-execstack -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: --no-error-execstack ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes + fi +fi +rm -f conftest* +if test $libc_linker_feature = yes; then + libc_cv_no_error_execstack=yes +else + libc_cv_no_error_execstack=no +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5 +printf "%s\n" "$libc_linker_feature" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z execstack" >&5 printf %s "checking for linker that supports -z execstack... " >&6; } libc_linker_feature=no |
