From c0e42f6d95b8dca4d852ee1c59205db05cac6880 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 31 Jul 2025 10:53:26 +0200 Subject: [PATCH] Revert "perf: inherit makeFlags from kernel" This reverts commit 94276da9e98691be7d083b06301c3e434ba2cfa4. 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: e9b2edb49163 ("linux: un-simplify toolchain selection") --- pkgs/os-specific/linux/kernel/perf/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/perf/default.nix b/pkgs/os-specific/linux/kernel/perf/default.nix index d0caa28e1432..f3338cf51cf9 100644 --- a/pkgs/os-specific/linux/kernel/perf/default.nix +++ b/pkgs/os-specific/linux/kernel/perf/default.nix @@ -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";