Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 9a7e780

Browse files
committed
Get rid of EXTRA_LDFLAGS (refs #142 and #173)
1 parent 2165751 commit 9a7e780

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

hello-world/Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
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
43
KDIR ?= /lib/modules/$(shell uname -r)/build
54

5+
%.rust.o: target/x86_64-linux-kernel-module/debug/lib%.a
6+
$(LD) -r -o $@ --whole-archive $<
7+
68
all:
79
$(MAKE) -C $(KDIR) M=$(CURDIR)
810

tests/Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
obj-m := testmodule.o
2-
testmodule-objs := $(TEST_LIBRARY)
3-
EXTRA_LDFLAGS += --entry=init_module
2+
testmodule-objs := $(TEST_NAME).rust.o
43
KDIR ?= /lib/modules/$(shell uname -r)/build
54

5+
%.rust.o: target/x86_64-linux-kernel-module/debug/lib%.a
6+
$(LD) -r -o $@ --whole-archive $<
7+
68
all:
79
$(MAKE) -C $(KDIR) M=$(CURDIR)
810

tests/run_tests.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ def main():
4545

4646
run(
4747
"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("-", "_")),
5149
)
5250
# TODO: qemu
5351
run(

0 commit comments

Comments
 (0)