Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Dmitrii Dolgov and committed by
Arnaldo Carvalho de Melo
6a32fa5c ff9aeb6b

+27 -2
+4 -2
tools/build/Makefile.feature
··· 100 100 disassembler-four-args \ 101 101 disassembler-init-styled \ 102 102 file-handle \ 103 - libopenssl 103 + libopenssl \ 104 + rust 104 105 105 106 # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list 106 107 # of all feature tests ··· 150 149 bpf \ 151 150 libaio \ 152 151 libzstd \ 153 - libopenssl 152 + libopenssl \ 153 + rust 154 154 155 155 # 156 156 # Declare group members of a feature to display the logical OR of the detection
+7
tools/build/feature/Makefile
··· 112 112 __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS) 113 113 BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1 114 114 115 + __BUILDRS = $(RUSTC) $(RUSTC_FLAGS) -o $@ $(patsubst %.bin,%.rs,$(@F)) 116 + BUILDRS = $(__BUILDRS) > $(@:.bin=.make.output) 2>&1 117 + 115 118 ############################### 116 119 117 120 $(OUTPUT)test-all.bin: ··· 391 388 $(OUTPUT)test-bpftool-skeletons.bin: 392 389 $(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \ 393 390 > $(@:.bin=.make.output) 2>&1 391 + 392 + $(OUTPUT)test-rust.bin: 393 + $(BUILDRS) > $(@:.bin=.make.output) 2>&1 394 + 394 395 ############################### 395 396 396 397 clean:
+4
tools/build/feature/test-rust.rs
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + fn main() { 3 + println!("hi") 4 + }
+11
tools/perf/Makefile.config
··· 1153 1153 endif 1154 1154 endif 1155 1155 1156 + ifndef NO_RUST 1157 + ifneq ($(feature-rust), 1) 1158 + $(warning Rust is not found. Test workloads with rust are disabled.) 1159 + NO_RUST := 1 1160 + else 1161 + NO_RUST := 0 1162 + CFLAGS += -DHAVE_RUST_SUPPORT 1163 + $(call detected,CONFIG_RUST_SUPPORT) 1164 + endif 1165 + endif 1166 + 1156 1167 # Among the variables below, these: 1157 1168 # perfexecdir 1158 1169 # libbpf_include_dir
+1
tools/perf/builtin-check.c
··· 60 60 FEATURE_STATUS("numa_num_possible_cpus", HAVE_LIBNUMA_SUPPORT), 61 61 FEATURE_STATUS("zlib", HAVE_ZLIB_SUPPORT), 62 62 FEATURE_STATUS("zstd", HAVE_ZSTD_SUPPORT), 63 + FEATURE_STATUS("rust", HAVE_RUST_SUPPORT), 63 64 64 65 /* this should remain at end, to know the array end */ 65 66 FEATURE_STATUS(NULL, _)