From fbde0fb7491e46520ece4ec64966cae422212720 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 22 Sep 2019 20:05:48 -0400 Subject: [PATCH] Undefine these if upstream has it --- hello-world/Kbuild | 3 +++ tests/Kbuild | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hello-world/Kbuild b/hello-world/Kbuild index d2114c47..27a9f4d6 100644 --- a/hello-world/Kbuild +++ b/hello-world/Kbuild @@ -1,6 +1,8 @@ obj-m := helloworld.o helloworld-objs := hello_world.rust.o +# Don't define these if the kernel we're compiling against already has them. +ifndef CONFIG_RUST CARGO ?= cargo $(src)/target/x86_64-linux-kernel/debug/libhello_world.a: $(src)/Cargo.toml $(wildcard $(src)/src/*.rs) @@ -8,3 +10,4 @@ $(src)/target/x86_64-linux-kernel/debug/libhello_world.a: $(src)/Cargo.toml $(wi %.rust.o: target/x86_64-linux-kernel/debug/lib%.a $(LD) -r -o $@ --whole-archive $< +endif diff --git a/tests/Kbuild b/tests/Kbuild index 4f910bd2..0e2999cd 100644 --- a/tests/Kbuild +++ b/tests/Kbuild @@ -1,6 +1,8 @@ obj-m := testmodule.o testmodule-objs := $(TEST_NAME).rust.o +# Don't define these if the kernel we're compiling against already has them. +ifndef CONFIG_RUST CARGO ?= cargo $(src)/target/x86_64-linux-kernel/debug/lib%.a: $(src)/$(TEST_PATH)/Cargo.toml $(wildcard $(src)/$(TEST_PATH)/src/*.rs) @@ -8,3 +10,4 @@ $(src)/target/x86_64-linux-kernel/debug/lib%.a: $(src)/$(TEST_PATH)/Cargo.toml $ %.rust.o: target/x86_64-linux-kernel/debug/lib%.a $(LD) -r -o $@ --whole-archive $< +endif