From 80a81a80707477df9aadceaec78f256af54d7fa8 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Fri, 31 Oct 2025 17:26:57 -0400 Subject: [PATCH] buildMozillaMach: enable LTO for Darwin --- pkgs/build-support/build-mozilla-mach/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/build-mozilla-mach/default.nix b/pkgs/build-support/build-mozilla-mach/default.nix index 1545c9335cdd..ad35fb74295d 100644 --- a/pkgs/build-support/build-mozilla-mach/default.nix +++ b/pkgs/build-support/build-mozilla-mach/default.nix @@ -130,7 +130,9 @@ in jemallocSupport ? !stdenv.hostPlatform.isMusl, jemalloc, ltoSupport ? ( - stdenv.hostPlatform.isLinux && stdenv.hostPlatform.is64bit && !stdenv.hostPlatform.isRiscV + (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin) + && stdenv.hostPlatform.is64bit + && !stdenv.hostPlatform.isRiscV ), overrideCC, buildPackages, @@ -466,7 +468,7 @@ buildStdenv.mkDerivation { "--host=${buildStdenv.buildPlatform.config}" "--target=${buildStdenv.hostPlatform.config}" ] - # LTO is done using clang and lld on Linux. + # LTO is done using clang and lld. ++ lib.optionals ltoSupport [ "--enable-lto=cross,full" # Cross-Language LTO "--enable-linker=lld"