diff options
| author | Dmitrii Dolgov <9erthalion6@gmail.com> | 2026-02-08 13:22:23 +0100 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-02-08 11:30:45 -0300 |
| commit | 6a32fa5ccd33da5d187ec6e78f3b45683399ab66 (patch) | |
| tree | 6b7d5a8521528c8aac81cf9a51be1581617425c8 /tools/build | |
| parent | ff9aeb6bd14dbc70651971c81e81fa8269c3101a (diff) | |
tools build: Add a feature test for rust compiler
Add a feature test to identify if the rust compiler is available, so
that perf could build rust based worloads based on that.
Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/build')
| -rw-r--r-- | tools/build/Makefile.feature | 6 | ||||
| -rw-r--r-- | tools/build/feature/Makefile | 7 | ||||
| -rw-r--r-- | tools/build/feature/test-rust.rs | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index 7f119eafc7c4..64d21152fc81 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -100,7 +100,8 @@ FEATURE_TESTS_BASIC := \ disassembler-four-args \ disassembler-init-styled \ file-handle \ - libopenssl + libopenssl \ + rust # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list # of all feature tests @@ -149,7 +150,8 @@ FEATURE_DISPLAY ?= \ bpf \ libaio \ libzstd \ - libopenssl + libopenssl \ + rust # # Declare group members of a feature to display the logical OR of the detection diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 5c15572d505e..9ae69d857166 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -112,6 +112,9 @@ __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) -o $@ $(patsubst %.bin,%.rs,$(@F)) + BUILDRS = $(__BUILDRS) > $(@:.bin=.make.output) 2>&1 + ############################### $(OUTPUT)test-all.bin: @@ -388,6 +391,10 @@ $(OUTPUT)test-libopenssl.bin: $(OUTPUT)test-bpftool-skeletons.bin: $(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \ > $(@:.bin=.make.output) 2>&1 + +$(OUTPUT)test-rust.bin: + $(BUILDRS) > $(@:.bin=.make.output) 2>&1 + ############################### clean: diff --git a/tools/build/feature/test-rust.rs b/tools/build/feature/test-rust.rs new file mode 100644 index 000000000000..f2fc91cc4f69 --- /dev/null +++ b/tools/build/feature/test-rust.rs @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 +fn main() { + println!("hi") +} |
