lix: only use LTO with GCC

Enabling LTO causes test failures when compiling for x86_64-darwin (at
least under Rosetta 2). The Nix package only enables LTO when using GCC,
so we'll copy that for now. I don't feel safe leaving it on for
aarch64-darwin unless we can understand why it's failing on
x86_64-darwin in case this is an indication of UB.

Fixes #337036.
This commit is contained in:
Lily Ballard
2024-11-03 20:21:00 -08:00
parent d16349da41
commit 1ed59a4eb8
+1 -1
View File
@@ -190,7 +190,7 @@ stdenv.mkDerivation {
[
# Enable LTO, since it improves eval performance a fair amount
# LTO is disabled on static due to strange linking errors
(lib.mesonBool "b_lto" (!stdenv.hostPlatform.isStatic))
(lib.mesonBool "b_lto" (!stdenv.hostPlatform.isStatic && stdenv.cc.isGNU))
(lib.mesonEnable "gc" true)
(lib.mesonBool "enable-tests" true)
(lib.mesonBool "enable-docs" enableDocumentation)