fishinabarrel / linux-kernel-module-rust

Framework for writing Linux kernel modules in safe Rust
GNU General Public License v2.0
1.33k stars 120 forks source link

Remove kernel-cflags-finder (fixes #191) #236

Closed geofft closed 4 years ago

geofft commented 4 years ago

The bulk of this is the changes from #185 that didn't make it into #188.

We also upgrade Travis's Clang/LLVM version to 9 to pick up some sort of bugfix in relocation processing. With older versions, we get

[ 1827.072410] module: x86/modules: Skipping invalid relocation target, existing value is nonzero for type 1, loc 00000000197e607d, val ffffffffc0703520

(where that "loc" seems to be random/garbage data, disconcertingly). Clang 9 is already required by kernels 5.0+ so this shouldn't be too much of a problem.

Co-authored-by: Alex Gaynor alex.gaynor@gmail.com

geofft commented 4 years ago

The weird relocation problem seems to be the same as https://lists.linuxfoundation.org/pipermail/llvmlinux/2018-July/001589.html , which implies it's alternatively solved by newer kernels than 4.15. That gives you a very narrow window of kernel versions because 5.0 wants clang 9 for asm goto, so I figured we just just formally drop support for older versions.

geofft commented 4 years ago

Sigh, we now need to call clippy from inside Kbuild.

geofft commented 4 years ago

That's enough churn that I spun it out into #237. Will rebase once that lands.