diff --git a/build/moz.configure/flags.configure b/build/moz.configure/flags.configure index 3d86ee1f3da6..a12d92be0433 100644 --- a/build/moz.configure/flags.configure +++ b/build/moz.configure/flags.configure @@ -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) diff --git a/js/src/old-configure.in b/js/src/old-configure.in index a7dca8feea4c..60fa0a2f6b2a 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -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 diff --git a/old-configure.in b/old-configure.in index a2723ecba081..0f717d7f1465 100644 --- a/old-configure.in +++ b/old-configure.in @@ -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