mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Properly check linker -z XXX support
This commit is contained in:
140
configure
vendored
140
configure
vendored
@ -6235,86 +6235,101 @@ if test $libc_cv_cc_with_libunwind = yes; then
|
||||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z nodelete option" >&5
|
||||
$as_echo_n "checking for -z nodelete option... " >&6; }
|
||||
if ${libc_cv_z_nodelete+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat > conftest.c <<EOF
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z nodelete" >&5
|
||||
$as_echo_n "checking for linker that supports -z nodelete... " >&6; }
|
||||
libc_linker_feature=no
|
||||
if test x"$gnu_ld" = x"yes"; then
|
||||
libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z nodelete"`
|
||||
if test -n "$libc_linker_check"; then
|
||||
cat > conftest.c <<EOF
|
||||
int _start (void) { return 42; }
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-nostartfiles -nostdlib
|
||||
-Wl,--enable-new-dtags,-z,nodelete 1>&5'
|
||||
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-Wl,--enable-new-dtags,-z,nodelete -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=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; }
|
||||
then
|
||||
then
|
||||
libc_linker_feature=yes
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
fi
|
||||
if test $libc_linker_feature = yes; then
|
||||
libc_cv_z_nodelete=yes
|
||||
else
|
||||
as_fn_error $? "linker with -z nodelete support required" "$LINENO" 5
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_nodelete" >&5
|
||||
$as_echo "$libc_cv_z_nodelete" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
|
||||
$as_echo "$libc_linker_feature" >&6; }
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z nodlopen option" >&5
|
||||
$as_echo_n "checking for -z nodlopen option... " >&6; }
|
||||
if ${libc_cv_z_nodlopen+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat > conftest.c <<EOF
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z nodlopen" >&5
|
||||
$as_echo_n "checking for linker that supports -z nodlopen... " >&6; }
|
||||
libc_linker_feature=no
|
||||
if test x"$gnu_ld" = x"yes"; then
|
||||
libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z nodlopen"`
|
||||
if test -n "$libc_linker_check"; then
|
||||
cat > conftest.c <<EOF
|
||||
int _start (void) { return 42; }
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-nostartfiles -nostdlib
|
||||
-Wl,--enable-new-dtags,-z,nodlopen 1>&5'
|
||||
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-Wl,--enable-new-dtags,-z,nodlopen -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=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; }
|
||||
then
|
||||
then
|
||||
libc_linker_feature=yes
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
fi
|
||||
if test $libc_linker_feature = yes; then
|
||||
libc_cv_z_nodlopen=yes
|
||||
else
|
||||
as_fn_error $? "linker with -z nodlopen support required" "$LINENO" 5
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_nodlopen" >&5
|
||||
$as_echo "$libc_cv_z_nodlopen" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
|
||||
$as_echo "$libc_linker_feature" >&6; }
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z initfirst option" >&5
|
||||
$as_echo_n "checking for -z initfirst option... " >&6; }
|
||||
if ${libc_cv_z_initfirst+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat > conftest.c <<EOF
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z initfirst" >&5
|
||||
$as_echo_n "checking for linker that supports -z initfirst... " >&6; }
|
||||
libc_linker_feature=no
|
||||
if test x"$gnu_ld" = x"yes"; then
|
||||
libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z initfirst"`
|
||||
if test -n "$libc_linker_check"; then
|
||||
cat > conftest.c <<EOF
|
||||
int _start (void) { return 42; }
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-nostartfiles -nostdlib
|
||||
-Wl,--enable-new-dtags,-z,initfirst 1>&5'
|
||||
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-Wl,--enable-new-dtags,-z,initfirst -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=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; }
|
||||
then
|
||||
then
|
||||
libc_linker_feature=yes
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
fi
|
||||
if test $libc_linker_feature = yes; then
|
||||
libc_cv_z_initfirst=yes
|
||||
else
|
||||
as_fn_error $? "linker with -z initfirst support required" "$LINENO" 5
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_initfirst" >&5
|
||||
$as_echo "$libc_cv_z_initfirst" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
|
||||
$as_echo "$libc_linker_feature" >&6; }
|
||||
|
||||
# Add-on fragments can set these for other machines.
|
||||
libc_commonpagesize=${libc_commonpagesize:-no}
|
||||
@ -6511,32 +6526,37 @@ if test "$libc_cv_z_combreloc" = yes; then
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z execstack" >&5
|
||||
$as_echo_n "checking for -z execstack... " >&6; }
|
||||
if ${libc_cv_z_execstack+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat > conftest.c <<EOF
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker that supports -z execstack" >&5
|
||||
$as_echo_n "checking for linker that supports -z execstack... " >&6; }
|
||||
libc_linker_feature=no
|
||||
if test x"$gnu_ld" = x"yes"; then
|
||||
libc_linker_check=`$LD -v --help 2>/dev/null | grep "\-z execstack"`
|
||||
if test -n "$libc_linker_check"; then
|
||||
cat > conftest.c <<EOF
|
||||
int _start (void) { return 42; }
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-fPIC -shared -o conftest.so conftest.c
|
||||
-Wl,-z,execstack -nostdlib
|
||||
1>&5'
|
||||
if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
|
||||
-Wl,-z,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=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; }
|
||||
then
|
||||
then
|
||||
libc_linker_feature=yes
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
fi
|
||||
if test $libc_linker_feature = yes; then
|
||||
libc_cv_z_execstack=yes
|
||||
else
|
||||
libc_cv_z_execstack=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_execstack" >&5
|
||||
$as_echo "$libc_cv_z_execstack" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5
|
||||
$as_echo "$libc_linker_feature" >&6; }
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fpie" >&5
|
||||
|
Reference in New Issue
Block a user