tracy: force-disable LTO for darwin

This commit is contained in:
Robert Scott 2021-04-05 16:26:01 +01:00
parent 3dc4351159
commit 59d8cd8cb6

View file

@ -1,6 +1,8 @@
{ stdenv, lib, darwin, fetchFromGitHub, tbb, gtk3, glfw, pkg-config, freetype, Carbon, AppKit, capstone }:
stdenv.mkDerivation rec {
let
disableLTO = stdenv.cc.isClang && stdenv.isDarwin; # workaround issue #19098
in stdenv.mkDerivation rec {
pname = "tracy";
version = "0.7.7";
@ -19,7 +21,10 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = [ ]
++ lib.optional stdenv.isLinux "-ltbb"
++ lib.optional stdenv.cc.isClang "-faligned-allocation";
++ lib.optional stdenv.cc.isClang "-faligned-allocation"
++ lib.optional disableLTO "-fno-lto";
NIX_CFLAGS_LINK = lib.optional disableLTO "-fno-lto";
buildPhase = ''
make -j $NIX_BUILD_CORES -C profiler/build/unix release