Bug 1871386 - Move -Wl,-build-id check from old-configure to moz.configure r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D197069
This commit is contained in:
serge-sans-paille 2024-02-06 09:54:12 +00:00
parent 1b9ef3e953
commit bf2b4a82a9
3 changed files with 19 additions and 26 deletions

View File

@ -144,6 +144,25 @@ def file_prefix_map_flags(path_remapping, path_remappings, compiler):
set_config("MOZ_FILE_PREFIX_MAP_FLAGS", file_prefix_map_flags)
@depends(c_compiler)
def is_gnu_cc(c_compiler):
return c_compiler.type != "clang-cl"
@depends(developer_options, when=is_gnu_cc)
def check_build_id_uuid(developer_options):
return developer_options
@depends(developer_options, when=is_gnu_cc)
def check_build_id_sha1(developer_options):
return not developer_options
check_and_add_linker_flag("-Wl,--build-id=uuid", when=check_build_id_uuid)
check_and_add_linker_flag("-Wl,--build-id=sha1", when=check_build_id_uuid)
# Please keep these last in this file.
add_old_configure_assignment("_COMPILATION_LDFLAGS", linker_flags.ldflags)
add_old_configure_assignment("_COMPILATION_HOST_LDFLAGS", linker_flags.host_ldflags)

View File

@ -243,19 +243,6 @@ if test "$GNU_CC"; then
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)
# While sha1 is deterministic, it is slower.
if test -z "$DEVELOPER_OPTIONS"; then
build_id=sha1
else
build_id=uuid
fi
AC_MSG_CHECKING([for --build-id=$build_id option to ld])
_SAVE_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--build-id=$build_id"
AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)
_DEFINES_CFLAGS="-include $jsconfdefs -DMOZILLA_CLIENT"
fi

View File

@ -242,19 +242,6 @@ if test "$GNU_CC"; then
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)
# While sha1 is deterministic, it is slower.
if test -z "$DEVELOPER_OPTIONS"; then
build_id=sha1
else
build_id=uuid
fi
AC_MSG_CHECKING([for --build-id=$build_id option to ld])
_SAVE_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--build-id=$build_id"
AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
LDFLAGS=$_SAVE_LDFLAGS)
AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
_SAVE_LDFLAGS=$LDFLAGS