-
Notifications
You must be signed in to change notification settings - Fork 122
Remove kernel-cflags-finder (fixes #191) #236
Conversation
@@ -1,6 +1,5 @@ | |||
matrix: | |||
include: | |||
- dist: xenial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't have clang-9 in repo, and it uses the same kernel anyway (see #229). If we think it's valuable I can use apt.llvm.org
@@ -3,8 +3,11 @@ helloworld-objs := hello_world.rust.o | |||
|
|||
CARGO ?= cargo | |||
|
|||
export c_flags | |||
export abs_srctree ?= ${CURDIR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exported by v5.2+ (torvalds/linux@25b146c) but it's pretty easy to keep compatibility with older ones.
hello-world/Kbuild
Outdated
$(src)/target/x86_64-linux-kernel/debug/libhello_world.a: $(src)/Cargo.toml $(wildcard $(src)/src/*.rs) | ||
cd $(src); env -u MAKE -u MAKEFLAGS $(CARGO) build -Z build-std=core,alloc --target=x86_64-linux-kernel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't seem to be necessary.
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. |
Sigh, we now need to call clippy from inside Kbuild. |
That's enough churn that I spun it out into #237. Will rebase once that lands. |
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 <[email protected]>
a337e7f
to
a4d1e80
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wooo! I think the next step here will be to figure out how to factor out teh common bits of all the KBuilds.
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 [email protected]