Revert "perf: inherit makeFlags from kernel"

This reverts commit 94276da9e9.

Original justification[1] was:

> it reduces unnecessary code duplication and should help with cross
> compilation (although this cannot be tested yet because some
> dependencies fail).

However, as time as gone on its become increasingly clear that the
kernels make flags are going to be specific to building a kernel, not
a userspace program, hence them having been renamed to
kernelModuleMakeFlags in the meantime.  This has become even more
apparent now that we're using unwrapped compilers for the kernel,
which doesn't go at all well with building a userspace program like
perf, so we stop inheriting any make flags from the kernel, and
instead just set the two flags necessary for cross compilation to
work.

Link: https://github.com/NixOS/nixpkgs/pull/34068 [1]
Fixes: e9b2edb491 ("linux: un-simplify toolchain selection")
This commit is contained in:
Alyssa Ross
2025-08-04 14:19:20 +02:00
parent 3e95b50d0f
commit c0e42f6d95
@@ -3,7 +3,6 @@
stdenv,
fetchurl,
kernel,
kernelModuleMakeFlags,
elfutils,
python3,
perl,
@@ -103,8 +102,9 @@ stdenv.mkDerivation {
"prefix=$(out)"
"WERROR=0"
"ASCIIDOC8=1"
"ARCH=${stdenv.hostPlatform.linuxArch}"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
]
++ kernelModuleMakeFlags
++ lib.optional (!withGtk) "NO_GTK2=1"
++ lib.optional (!withZstd) "NO_LIBZSTD=1"
++ lib.optional (!withLibcap) "NO_LIBCAP=1";