foot: fix PGO build with clang

The way we need to do PGO builds for foot changed. The gcc build was
unaffected by this, but has been updated to the new instructions. For
clang using the outdated introduction meant that the PGO build was
broken when using clang for building foot with PGO enabled.

This has been fixed by updating to the new build instructions for both
gcc and clang when using PGO:
https://codeberg.org/dnkl/foot/pulls/420

foot.override { stdenv = llvmPackages_11.stdenv; } now works as expected.
This commit is contained in:
sternenseemann 2021-03-28 12:57:08 +02:00 committed by sterni
parent 2c0c4d222a
commit 68a1f6f391

View File

@ -67,8 +67,8 @@ let
# https://codeberg.org/dnkl/foot/src/branch/master/INSTALL.md#performance-optimized-pgo
pgoCflags = {
"clang" = "-O3 -Wno-ignored-optimization-argument -Wno-profile-instr-out-of-date -Wno-profile-instr-unprofiled";
"gcc" = "-O3 -Wno-missing-profile";
"clang" = "-O3 -Wno-ignored-optimization-argument";
"gcc" = "-O3";
}."${compilerName}";
# ar with lto support
@ -130,6 +130,10 @@ stdenv.mkDerivation rec {
preBuild = lib.optionalString doPgo ''
meson configure -Db_pgo=generate
ninja
# make sure there is _some_ profiling data on all binaries
./footclient --version
./foot --version
# generate pgo data of wayland independent code
./pgo ${stimuliFile} ${stimuliFile} ${stimuliFile}
meson configure -Db_pgo=use
'' + lib.optionalString (doPgo && stdenv.cc.cc.pname == "clang") ''