From 1ed59a4eb8a0d5694bc7f67b3770e664433730e7 Mon Sep 17 00:00:00 2001 From: Lily Ballard Date: Sun, 3 Nov 2024 20:14:31 -0800 Subject: [PATCH] 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. --- pkgs/tools/package-management/lix/common.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/package-management/lix/common.nix b/pkgs/tools/package-management/lix/common.nix index 521c27b7e7bcf..73853738d882f 100644 --- a/pkgs/tools/package-management/lix/common.nix +++ b/pkgs/tools/package-management/lix/common.nix @@ -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)