This repository was archived by the owner on Mar 7, 2021. It is now read-only.
File tree 3 files changed +9
-7
lines changed
3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
1
obj-m := helloworld.o
2
- helloworld-objs := target/x86_64-linux-kernel-module/debug/libhello_world.a
3
- EXTRA_LDFLAGS += --entry=init_module
2
+ helloworld-objs := hello_world.rust.o
4
3
KDIR ?= /lib/modules/$(shell uname -r) /build
5
4
5
+ % .rust.o : target/x86_64-linux-kernel-module/debug/lib% .a
6
+ $(LD ) -r -o $@ --whole-archive $<
7
+
6
8
all :
7
9
$(MAKE ) -C $(KDIR ) M=$(CURDIR )
8
10
Original file line number Diff line number Diff line change 1
1
obj-m := testmodule.o
2
- testmodule-objs := $(TEST_LIBRARY )
3
- EXTRA_LDFLAGS += --entry=init_module
2
+ testmodule-objs := $(TEST_NAME ) .rust.o
4
3
KDIR ?= /lib/modules/$(shell uname -r) /build
5
4
5
+ % .rust.o : target/x86_64-linux-kernel-module/debug/lib% .a
6
+ $(LD ) -r -o $@ --whole-archive $<
7
+
6
8
all :
7
9
$(MAKE ) -C $(KDIR ) M=$(CURDIR )
8
10
Original file line number Diff line number Diff line change @@ -45,9 +45,7 @@ def main():
45
45
46
46
run (
47
47
"make" , "-C" , BASE_DIR ,
48
- "TEST_LIBRARY=target/x86_64-linux-kernel-module/debug/lib{}_tests.a" .format (
49
- path .replace ("-" , "_" )
50
- ),
48
+ "TEST_NAME={}_tests" .format (path .replace ("-" , "_" )),
51
49
)
52
50
# TODO: qemu
53
51
run (
You can’t perform that action at this time.
0 commit comments