Bug 1882554 - Move check for -Wl,--ignore-unresolved-symbol,environ to python configure r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D203014
This commit is contained in:
serge-sans-paille 2024-03-04 19:49:01 +00:00
parent ef9aed3ef2
commit a95cbb8f40
2 changed files with 10 additions and 10 deletions

View file

@ -169,6 +169,15 @@ check_and_add_linker_flag("-Wl,-z,nocopyreloc", when=building_with_gnu_cc)
check_and_add_linker_optimize_flag("-Wl,-dead_strip", when=target_is_darwin & ~dtrace)
have_linker_support_ignore_unresolved = try_link(
flags=["-Wl,--ignore-unresolved-symbol,environ"],
check_msg="for --ignore-unresolved-symbol option to the linker",
when=building_with_gnu_cc & gcc_use_gnu_ld,
)
add_old_configure_assignment(
"HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED", have_linker_support_ignore_unresolved
)
@depends("--enable-address-sanitizer", building_with_gnu_cc)
def check_Bsymbolic(enable_asan, building_with_gnu_cc):

View file

@ -186,15 +186,6 @@ if test "$GNU_CC"; then
ASFLAGS="$ASFLAGS -fPIC"
fi
AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
_SAVE_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ"
AC_TRY_LINK(,,AC_MSG_RESULT([yes])
[HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=1],
AC_MSG_RESULT([no]))
LDFLAGS=$_SAVE_LDFLAGS
DSO_LDOPTS='-shared'
if test "$GCC_USE_GNU_LD"; then
# Some tools like ASan use a runtime library that is only
@ -207,7 +198,7 @@ if test "$GNU_CC"; then
# BSDs need `environ' exposed for posix_spawn (bug 753046)
case "$OS_TARGET" in
DragonFly|FreeBSD|NetBSD|OpenBSD)
if test -n "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED"; then
if test "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED" = 1; then
DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ"
else
DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"