aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/build/feature/Makefile10
-rw-r--r--tools/build/feature/test-rust.rs4
2 files changed, 6 insertions, 8 deletions
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index e959caa7f1c7..1fbcb3ce74d2 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -113,9 +113,6 @@ __BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(
__BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
-__BUILDRS = $(RUSTC) $(RUSTC_FLAGS) --emit=dep-info=$(patsubst %.bin,%.d,$(@F)),link -o $@ $(patsubst %.bin,%.rs,$(@F))
- BUILDRS = $(__BUILDRS) > $(@:.bin=.make.output) 2>&1
-
###############################
$(OUTPUT)test-all.bin:
@@ -393,8 +390,13 @@ $(OUTPUT)test-bpftool-skeletons.bin:
$(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \
> $(@:.bin=.make.output) 2>&1
+# Testing Rust is special: we don't compile anything, it's enough to check the
+# compiler presence. Compiling a test code for this purposes is problematic,
+# because Rust will emit a dependency file without any external references,
+# meaning that if rustc will be removed the build process will still think it's
+# there.
$(OUTPUT)test-rust.bin:
- $(BUILDRS) > $(@:.bin=.make.output) 2>&1
+ $(RUSTC) --version > /dev/null 2>&1
###############################
diff --git a/tools/build/feature/test-rust.rs b/tools/build/feature/test-rust.rs
deleted file mode 100644
index f2fc91cc4f69..000000000000
--- a/tools/build/feature/test-rust.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-fn main() {
- println!("hi")
-}