diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2022-01-02 06:01:21 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2022-01-03 05:12:34 -0800 |
commit | bd1616c6bee625a2726d0f8b477881b4b25697d8 (patch) | |
tree | b3dae5efabfe793bcd72173eaab4a9dec1d06871 /configure | |
parent | a51faeee6ae68da63e65eb0a1eb6c9ec2ce2148b (diff) | |
download | glibc-bd1616c6bee625a2726d0f8b477881b4b25697d8.zip glibc-bd1616c6bee625a2726d0f8b477881b4b25697d8.tar.gz glibc-bd1616c6bee625a2726d0f8b477881b4b25697d8.tar.bz2 |
Properly check linker option in LIBC_LINKER_FEATURE [BZ #28738]
Update LIBC_LINKER_FEATURE to also check linker warning message since
unknown linker -z option may be ignored by linker:
$ touch x.c
$ gcc -shared -Wl,-z,foobar x.c
/usr/bin/ld: warning: -z foobar ignored
$ echo $?
0
$
This fixes BZ #28738.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 32 |
1 files changed, 28 insertions, 4 deletions
@@ -6009,7 +6009,13 @@ EOF $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - libc_linker_feature=yes + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,execstack -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: -z execstack ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes + fi fi rm -f conftest* fi @@ -6039,7 +6045,13 @@ EOF $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - libc_linker_feature=yes + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,-z,start-stop-gc -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: -z start-stop-gc ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes + fi fi rm -f conftest* fi @@ -6070,7 +6082,13 @@ EOF $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - libc_linker_feature=yes + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--depaudit,x -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: --depaudit ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes + fi fi rm -f conftest* fi @@ -6101,7 +6119,13 @@ EOF $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then - libc_linker_feature=yes + if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS $no_ssp -Wl,--no-dynamic-linker -nostdlib \ + -nostartfiles -fPIC -shared -o conftest.so conftest.c 2>&1 \ + | grep "warning: --no-dynamic-linker ignored" > /dev/null 2>&1; then + true + else + libc_linker_feature=yes + fi fi rm -f conftest* fi |