commit 960f4bb8e1556ef46a61d49529fc51229a94d59c
parent 0a62115f893835e7237dde8fe6b7cc9398a8973c
Author: serge-sans-paille <sguelton@mozilla.com>
Date: Tue, 14 Oct 2025 23:08:24 +0000
Bug 1993097 - Disable fat-lto when it's incompatible with static stdlibc++ linking r=RyanVM,firefox-build-system-reviewers,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D268526
Diffstat:
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo.configure
@@ -260,19 +260,13 @@ option(
imply_option("MOZ_LD64_KNOWN_GOOD", moz_automation)
-
-@depends("--enable-lto", c_compiler, select_linker, target, enable_tests)
-def use_fat_lto(lto, c_compiler, linker, target, enable_tests):
- if not lto:
- return False
- if not enable_tests:
- return False
- if c_compiler.type not in ("clang", "clang-cl"):
- return False
- if c_compiler.version < "18.0.0":
- return False
-
- return linker and linker.KIND == "lld" and target.os != "OSX"
+use_fat_lto = cxx_compiler.try_link(
+ ldflags=depends(stlport_libs)(
+ lambda extra: ["-flto", "-ffat-lto-objects"] + (extra or [])
+ ),
+ check_msg="whether the C++ compiler supports fat lto objects",
+ when=depends("--enable-lto", enable_tests)(lambda lto, tests: lto and not tests),
+)
@depends(