perf: apply patch to fix 4.9 build when inheriting kernel make flags#34068
Merged
dezgeg merged 2 commits intoNixOS:masterfrom Jan 21, 2018
Merged
perf: apply patch to fix 4.9 build when inheriting kernel make flags#34068dezgeg merged 2 commits intoNixOS:masterfrom
dezgeg merged 2 commits intoNixOS:masterfrom
Conversation
Contributor
|
Makes sense. I can mail the stable maintainer. |
orivej
approved these changes
Jan 20, 2018
Contributor
|
The patch has been applied to the 4.9.y queue. |
Member
|
@GrahamcOfBorg build linuxPackages_4_9.perf |
GrahamcOfBorg
left a comment
There was a problem hiding this comment.
Failure for system: x86_64-darwin
while evaluating 'makeOverridable' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/lib/customisation.nix:72:24, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/lib/customisation.nix:117:8:
while evaluating anonymous function at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/os-specific/linux/kernel/perf.nix:1:1, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/lib/customisation.nix:74:12:
while evaluating 'versionAtLeast' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/lib/strings.nix:371:24, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/os-specific/linux/kernel/perf.nix:9:8:
while evaluating 'versionOlder' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/lib/strings.nix:359:22, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/lib/strings.nix:371:29:
while evaluating the attribute 'linux_4_9' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/top-level/all-packages.nix:12853:3:
while evaluating 'callPackageWith' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/lib/customisation.nix:113:35, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/top-level/all-packages.nix:12853:15:
while evaluating 'makeOverridable' at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/lib/customisation.nix:72:24, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/lib/customisation.nix:117:8:
while evaluating anonymous function at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/os-specific/linux/kernel/linux-4.9.nix:1:1, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/lib/customisation.nix:74:12:
while evaluating anonymous function at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/os-specific/linux/kernel/generic.nix:1:1, called from /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/os-specific/linux/kernel/linux-4.9.nix:3:1:
assertion failed at /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/os-specific/linux/kernel/generic.nix:33:1
GrahamcOfBorg
left a comment
There was a problem hiding this comment.
Success for system: x86_64-linux
/nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77/libexec/perf-core/scripts/python/bin/syscall-counts-by-pid-record: interpreter directive changed from "/bin/bash" to "/nix/store/i0ay05pqkbnvpfijm52mmlrp6kmkl80c-bash-4.4-p12/bin/bash"
/nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77/libexec/perf-core/scripts/python/bin/syscall-counts-by-pid-report: interpreter directive changed from "/bin/bash" to "/nix/store/i0ay05pqkbnvpfijm52mmlrp6kmkl80c-bash-4.4-p12/bin/bash"
/nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77/libexec/perf-core/scripts/python/bin/syscall-counts-record: interpreter directive changed from "/bin/bash" to "/nix/store/i0ay05pqkbnvpfijm52mmlrp6kmkl80c-bash-4.4-p12/bin/bash"
/nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77/libexec/perf-core/scripts/python/bin/syscall-counts-report: interpreter directive changed from "/bin/bash" to "/nix/store/i0ay05pqkbnvpfijm52mmlrp6kmkl80c-bash-4.4-p12/bin/bash"
/nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77/libexec/perf-core/scripts/python/call-graph-from-postgresql.py: interpreter directive changed from "/usr/bin/python2" to "/nix/store/87l8l9w3x8saxqz9sfcfw2i3jiilmxfi-python-2.7.14/bin/python2"
/nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77/libexec/perf-core/scripts/python/sched-migration.py: interpreter directive changed from "/usr/bin/python" to "/nix/store/87l8l9w3x8saxqz9sfcfw2i3jiilmxfi-python-2.7.14/bin/python"
/nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77/libexec/perf-core/scripts/python/stat-cpi.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/87l8l9w3x8saxqz9sfcfw2i3jiilmxfi-python-2.7.14/bin/python"
checking for references to /tmp/nix-build-perf-linux-4.9.77.drv-0 in /nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77...
moving /nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77/lib64/* to /nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77/lib
/nix/store/a2cxjs1lklbpd87vh2a9mnc5kkkgzspm-perf-linux-4.9.77
GrahamcOfBorg
left a comment
There was a problem hiding this comment.
Success for system: aarch64-linux
/nix/store/b142kba37smljipy21jjs1ln09lgipqs-perf-linux-4.9.77/libexec/perf-core/scripts/perl/bin/check-perf-trace-record: interpreter directive changed from "/bin/bash" to "/nix/store/rc78viijga8i0m4imrnqk8d1csyqr8yx-bash-4.4-p12/bin/bash"
/nix/store/b142kba37smljipy21jjs1ln09lgipqs-perf-linux-4.9.77/libexec/perf-core/scripts/perl/wakeup-latency.pl: interpreter directive changed from "/usr/bin/perl -w" to "/nix/store/vdz41jczh8p1gbb051drb9fwi6ym3gm4-perl-5.24.3/bin/perl -w"
/nix/store/b142kba37smljipy21jjs1ln09lgipqs-perf-linux-4.9.77/libexec/perf-core/scripts/perl/rwtop.pl: interpreter directive changed from "/usr/bin/perl -w" to "/nix/store/vdz41jczh8p1gbb051drb9fwi6ym3gm4-perl-5.24.3/bin/perl -w"
/nix/store/b142kba37smljipy21jjs1ln09lgipqs-perf-linux-4.9.77/libexec/perf-core/scripts/perl/rw-by-pid.pl: interpreter directive changed from "/usr/bin/perl -w" to "/nix/store/vdz41jczh8p1gbb051drb9fwi6ym3gm4-perl-5.24.3/bin/perl -w"
/nix/store/b142kba37smljipy21jjs1ln09lgipqs-perf-linux-4.9.77/libexec/perf-core/scripts/perl/rw-by-file.pl: interpreter directive changed from "/usr/bin/perl -w" to "/nix/store/vdz41jczh8p1gbb051drb9fwi6ym3gm4-perl-5.24.3/bin/perl -w"
/nix/store/b142kba37smljipy21jjs1ln09lgipqs-perf-linux-4.9.77/libexec/perf-core/perf-with-kcore: interpreter directive changed from "/bin/bash" to "/nix/store/rc78viijga8i0m4imrnqk8d1csyqr8yx-bash-4.4-p12/bin/bash"
/nix/store/b142kba37smljipy21jjs1ln09lgipqs-perf-linux-4.9.77/libexec/perf-core/perf-archive: interpreter directive changed from "/bin/bash" to "/nix/store/rc78viijga8i0m4imrnqk8d1csyqr8yx-bash-4.4-p12/bin/bash"
/nix/store/b142kba37smljipy21jjs1ln09lgipqs-perf-linux-4.9.77/libexec/perf-core/tests/attr.py: interpreter directive changed from " /usr/bin/python" to "/nix/store/dynp7j2rilfs54bq22i7ihv2647vrcrk-python-2.7.14/bin/python"
checking for references to /build in /nix/store/b142kba37smljipy21jjs1ln09lgipqs-perf-linux-4.9.77...
/nix/store/b142kba37smljipy21jjs1ln09lgipqs-perf-linux-4.9.77
alyssais
added a commit
to alyssais/nixpkgs
that referenced
this pull request
Jul 31, 2025
This reverts commit 94276da. 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: NixOS#34068 [1] Fixes: e9b2edb ("linux: un-simplify toolchain selection")
13 tasks
alyssais
added a commit
that referenced
this pull request
Aug 4, 2025
This reverts commit 94276da. 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: #34068 [1] Fixes: e9b2edb ("linux: un-simplify toolchain selection")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change
This PR adds a patch for the 4.9 kernel which fixes the perf build when the
ARCH=x86_64flag is passed to make. This bug was introduced in 4.8 and fixed in 4.12. I backported the fix to 4.9 and conditionally applied it to 4.9 only.This issue was triggered by my patch which inherited
makeFlagsfrom the kernel derivation (which includesARCH). The reason I wanted to do this was because it reduces unnecessary code duplication and should help with cross compilation (although this cannot be tested yet because some dependencies fail).IMO, applying this patch is the best way of fixing this bug, because it actually fixes the problem rather than working around it. Alternatively, we could exclude the
ARCHflag frommakeFlagsfor 4.9, or we could just forget about this issue until cross compilation actually becomes possible.This patch could possibly be accepted to the 4.9 upstream stable branch, if someone were willing to submit it to the mailing list.
Things done
build-use-sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)