-
Notifications
You must be signed in to change notification settings - Fork 120
Fixes #177 -- let the kernel build process drive cargo #188
Conversation
cc0a2c5
to
eb2af6f
Compare
hello-world/Makefile
Outdated
obj-m := helloworld.o | ||
helloworld-objs := hello_world.rust.o | ||
KDIR ?= /lib/modules/$(shell uname -r)/build | ||
|
||
$(src)/target/x86_64-linux-kernel/debug/libhello_world.a: $(src)/Cargo.toml $(wildcard $(src)/src/*.c) |
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.
If I'm reading Documentation/kbuild/makefiles.rst right, the target side of this should be $(obj)
, but I guess that involves setting CARGO_TARGET_DIR and some other things (cf. rust-lang/cargo#1657). Doesn't need to be done now but we should do it at some point.
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.
I think that's right.
@@ -9,3 +9,4 @@ Module.symvers | |||
*.mod.c | |||
*.o | |||
modules.order | |||
dummy.c |
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.
Wait, why does this move? We're still doing a make -C kernel-cflags-finder
, no?
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.
I had a dummy.c
somewhere I didn't expect it. It's possible it came from some random intermediate debugging state.
4ce96f1
to
43105da
Compare
43105da
to
02b99ad
Compare
This is #185 minus #188, but with the CONFIG_CC_IS_CLANG fix from #227. Co-authored-by: Geoffrey Thomas <[email protected]>
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]>
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]>
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]>
A more minimal version of #185. Doesn't have all of the benefits, but does work in more cases I believe!