Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on Kernel v. 6.12 #86

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mfrischknecht
Copy link

asm/unaligned.h has been moved to linux/unaligned.h since Linux v. 6.12 1, which breaks the build of vendor-reset e.g. on NixOS unstable (and likely other distributions, as soon as those switch to 6.12, too).

On my system, the build fails with this error:

/build/source/src/amd/amdgpu/atom.c:32:10: fatal error: asm/unaligned.h: No such file or directory
   32 | #include <asm/unaligned.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/nix/store/lacdcr5zi7w59f8xsq4cfi41mzgc6dcn-linux-6.12-dev/lib/modules/6.12.0/source/scripts/Makefile.build:229: /build/source/src/amd/amdgpu/atom.o] Error 1

Footnotes

  1. https://github.com/torvalds/linux/commit/5f60d5f6bbc12e782fac78110b0ee62698f3b576

`asm/unaligned.h` has been moved to `linux/unaligned.h` since Linux v. 6.12.
C.f. e.g. torvalds/linux@5f60d5f
@VoodaGod
Copy link

VoodaGod commented Nov 27, 2024

unfortunately this breaks the build on previous kernels, should try to make this change conditional like this:

#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)

…so the module builds for both kernels below 6.12 and above. Thanks, @VoodaGod!

Co-authored-by: Jason Rensburger <l33tjas.0n@gmail.com>
@mfrischknecht
Copy link
Author

@VoodaGod I'm currently out of town, so I've just applied you suggestion through the GitHub mobile interface. I hope that's okay like this. Thanks!

Note: I havent tested this myself yet. I should be able to until friday.

@mfrischknecht
Copy link
Author

For completeness' sake: I've also tested building the module with some older Kernels through my NixOS config and had no issues.

I didn't switch to these Kernels and test the functionality, but as there haven't been many logic related changes in the recent past (and I've used the module through multiple of these older Kernel versions myself), I don't anticipate any problems in that regard.

mfrischknecht added a commit to mfrischknecht/nixpkgs that referenced this pull request Dec 22, 2024
`asm/unaligned.h` has been moved to `linux/unaligned.h` since
Linux v. 6.12 [^1]. This has broken the build for `vendor-reset`
on newer versions.

I've opened a PR with the upstream project [^2], but that has been
sitting unmerged on GitHub for a while now, so I decided to add the
fix temporarily using `fetchpatch` in the NixOS module for now.
When it will (hopefully) eventually be merged, we should be able to
remove the patch and just switch to an up-to-date upstream version.

[^1]: torvalds/linux@5f60d5f
[^2]: gnif/vendor-reset#86
mfrischknecht added a commit to mfrischknecht/nixpkgs that referenced this pull request Dec 22, 2024
`asm/unaligned.h` has been moved to `linux/unaligned.h` since
Linux v. 6.12 [^1]. This has broken the build for `vendor-reset`
on newer versions.

I've opened a PR with the upstream project [^2], but that has been
sitting unmerged on GitHub for a while now, so I decided to add the
fix temporarily using `fetchpatch` in the NixOS module for now.
When it will (hopefully) eventually be merged, we should be able to
remove the patch and just switch to an up-to-date upstream version.

[^1]: torvalds/linux@5f60d5f
[^2]: gnif/vendor-reset#86
mfrischknecht added a commit to mfrischknecht/nixpkgs that referenced this pull request Dec 22, 2024
`asm/unaligned.h` has been moved to `linux/unaligned.h` since
Linux v. 6.12 [^1]. This has broken the build for `vendor-reset`
on newer versions.

I've opened a PR with the upstream project [^2], but that has been
sitting unmerged on GitHub for a while now, so I decided to add the
fix temporarily using `fetchpatch` in the NixOS module for now.
When it will (hopefully) eventually be merged, we should be able to
remove the patch and just switch to an up-to-date upstream version.

[^1]: torvalds/linux@5f60d5f
[^2]: gnif/vendor-reset#86
alyssais pushed a commit to NixOS/nixpkgs that referenced this pull request Dec 23, 2024
`asm/unaligned.h` has been moved to `linux/unaligned.h` since
Linux v. 6.12 [^1]. This has broken the build for `vendor-reset`
on newer versions.

I've opened a PR with the upstream project [^2], but that has been
sitting unmerged on GitHub for a while now, so I decided to add the
fix temporarily using `fetchpatch` in the NixOS module for now.
When it will (hopefully) eventually be merged, we should be able to
remove the patch and just switch to an up-to-date upstream version.

[^1]: torvalds/linux@5f60d5f
[^2]: gnif/vendor-reset#86
@kutukvpavel
Copy link

Kernel 6.12 made it into Debian Stable backports. Had to manually edit the DKMS source for now, can confirm this PR fixes the issue and works for both >=6.12 and <=6.11 kernels.
@gnif Can you merge this, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants