diff options
author | Sergei Trofimovich <slyich@gmail.com> | 2024-02-08 20:51:54 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyich@gmail.com> | 2024-02-08 20:52:44 +0000 |
commit | 410d15e1568c6191d43fd726e61ddbc8c5af3cb0 (patch) | |
tree | 60ff466d31933b6645bbe73e2d9ba778c52112ee /pkgs/os-specific | |
parent | a5d28c9bffb49868ca5688e5767d0782a995163b (diff) | |
download | nixlib-410d15e1568c6191d43fd726e61ddbc8c5af3cb0.tar nixlib-410d15e1568c6191d43fd726e61ddbc8c5af3cb0.tar.gz nixlib-410d15e1568c6191d43fd726e61ddbc8c5af3cb0.tar.bz2 nixlib-410d15e1568c6191d43fd726e61ddbc8c5af3cb0.tar.lz nixlib-410d15e1568c6191d43fd726e61ddbc8c5af3cb0.tar.xz nixlib-410d15e1568c6191d43fd726e61ddbc8c5af3cb0.tar.zst nixlib-410d15e1568c6191d43fd726e61ddbc8c5af3cb0.zip |
linuxPackages_latest.perf: add `-O1` workaround for `gcc-13`
Without the change `perf top` just crashes early as: $ perf top perf: Segmentation fault -------- backtrace -------- /<<NIX>>/perf-linux-6.7.4/bin/perf[0x627382] /<<NIX>>/glibc-2.38-27/lib/libc.so.6(+0x3deb0)[0x7f423a054eb0] /<<NIX>>/perf-linux-6.7.4/bin/perf(__dsos__findnew_link_by_longname_id+0x34b)[0x53655b] /<<NIX>>/perf-linux-6.7.4/bin/perf(map__new+0x35f)[0x55884f] /<<NIX>>/perf-linux-6.7.4/bin/perf(machine__process_mmap2_event+0xb7)[0x557b27] /<<NIX>>/perf-linux-6.7.4/bin/perf(perf_tool__process_synth_event+0x7e)[0x59e86e] /<<NIX>>/perf-linux-6.7.4/bin/perf(perf_event__synthesize_mmap_events+0x370)[0x59f0e0] /<<NIX>>/perf-linux-6.7.4/bin/perf[0x59fd5c] /<<NIX>>/perf-linux-6.7.4/bin/perf[0x59ffcc] /<<NIX>>/perf-linux-6.7.4/bin/perf[0x5a0093] /<<NIX>>/glibc-2.38-27/lib/libc.so.6(+0x8b333)[0x7f423a0a2333] /<<NIX>>/glibc-2.38-27/lib/libc.so.6(+0x10defc)[0x7f423a124efc] It's a known `gcc-12+` bug not yet fixed in `gcc-13`: https://gcc.gnu.org/PR111009 Let's demote optimizations from `-O2` down to `-O1` to disable any VRP-related effects for affected `gcc-13`.
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/linux/kernel/perf/default.nix | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/os-specific/linux/kernel/perf/default.nix b/pkgs/os-specific/linux/kernel/perf/default.nix index ad8f2608d936..172965f2a78f 100644 --- a/pkgs/os-specific/linux/kernel/perf/default.nix +++ b/pkgs/os-specific/linux/kernel/perf/default.nix @@ -129,12 +129,17 @@ stdenv.mkDerivation { ++ lib.optional (lib.versionAtLeast kernel.version "5.8") libpfm ++ lib.optional (lib.versionAtLeast kernel.version "6.0") python3.pkgs.setuptools; - env.NIX_CFLAGS_COMPILE = toString [ + env.NIX_CFLAGS_COMPILE = toString ([ "-Wno-error=cpp" "-Wno-error=bool-compare" "-Wno-error=deprecated-declarations" "-Wno-error=stringop-truncation" - ]; + ] ++ lib.optionals (stdenv.cc.isGNU && lib.versions.major stdenv.cc.version == "13") [ + # Workaround gcc bug that causes enev simplest `perf top` runs to + # crash: https://gcc.gnu.org/PR111009. + # Can be removed once gcc-13 is updated past 13.2.0. + "-O1" + ]); doCheck = false; # requires "sparse" |