mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 06:20:06 +00:00
LoongArch: Further refine the condition to enable static PIE
Before GCC r13-2728, it would produce a normal dynamic-linked executable with -static-pie. I mistakely believed it would produce a static-linked executable, so failed to detect the breakage. Then with Binutils 2.40 and (vanilla) GCC 12, libc_cv_static_pie_on_loongarch is mistakenly enabled and cause a building failure with "undefined reference to _DYNAMIC". Fix the issue by disabling static PIE if -static-pie creates something with a INTERP header.
This commit is contained in:
parent
0d41182e0e
commit
a2ef941b2d
6
sysdeps/loongarch/configure
vendored
6
sysdeps/loongarch/configure
vendored
@ -47,6 +47,12 @@ EOF
|
||||
(eval $ac_try) 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; } \
|
||||
&& ! { ac_try='LC_ALL=C $READELF -Wl conftest1 | grep -q INTERP'
|
||||
{ { 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; }; } \
|
||||
&& { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -shared -fPIC -o conftest2.so conftest2.S'
|
||||
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
|
||||
|
@ -41,6 +41,7 @@ EOF
|
||||
libc_cv_static_pie_on_loongarch=no
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static-pie -nostdlib -fPIE -o conftest1 conftest1.S]) \
|
||||
&& AC_TRY_COMMAND([LC_ALL=C $READELF -Wr conftest1 | grep -q R_LARCH_RELATIVE]) \
|
||||
&& ! AC_TRY_COMMAND([LC_ALL=C $READELF -Wl conftest1 | grep -q INTERP]) \
|
||||
&& AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -shared -fPIC -o conftest2.so conftest2.S]) \
|
||||
&& AC_TRY_COMMAND([LC_ALL=C $READELF -Wr conftest2.so | grep -q 'R_LARCH_JUMP_SLOT.*external_func'])
|
||||
then
|
||||
|
Loading…
Reference in New Issue
Block a user