linux/tools/build/feature
Dmitrii Dolgov 804490c3eb tools build: Fix feature test for rust compiler
Currently a dummy rust code is compiled to detect if the rust feature
could be enabled. It turns out that in this case rust emits a dependency
file without any external references:

    /perf/feature/test-rust.d: test-rust.rs

    /perf/feature/test-rust.bin: test-rust.rs

    test-rust.rs:

This can lead to a situation, when rustc was removed after a successful build,
but the build process still thinks it's there and the feature is enabled on
subsequent runs.

Instead simply check the compiler presence to detect the feature, as
suggested by Arnaldo.

This way no actual test-rust.bin will be created, meaning the feature
check will not be cached and always performed. That's exactly what we
want, and the overhead of doing this every time is minimal.

Tested with multiple rounds of install/remove of the rust package.

Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Suggested-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-02-12 17:45:22 -03:00
..
.gitignore
Makefile tools build: Fix feature test for rust compiler 2026-02-12 17:45:22 -03:00
test-all.c tools/build: Add a feature test for libopenssl 2025-12-17 05:44:24 -08:00
test-backtrace.c tools build: Fix a number of Wconversion warnings 2025-02-12 20:23:05 -08:00
test-bionic.c
test-bpf.c tools build: Fix a number of Wconversion warnings 2025-02-12 20:23:05 -08:00
test-clang-bpf-co-re.c
test-compile.c
test-cplus-demangle.c
test-cxa-demangle.cpp tools build: Add feature test for abi::__cxa_demangle 2023-03-14 08:29:46 -03:00
test-disassembler-four-args.c
test-disassembler-init-styled.c tools build: Add feature test for init_disassemble_info API changes 2022-08-01 15:29:10 -03:00
test-eventfd.c
test-file-handle.c
test-fortify-source.c
test-gettid.c
test-glibc.c tools build: Fix a number of Wconversion warnings 2025-02-12 20:23:05 -08:00
test-gtk2-infobar.c
test-gtk2.c
test-hello.c
test-jvmti-cmlr.c
test-jvmti.c
test-libaio.c
test-libbabeltrace.c
test-libbfd-threadsafe.c perf build: Feature test for libbfd thread safety API 2026-01-06 19:14:46 -03:00
test-libbfd.c
test-libbpf.c tools build: Pass libbpf feature only if libbpf 1.0+ 2023-03-14 08:29:33 -03:00
test-libcap.c Revert "tools build: Remove leftover libcap tests that prevents fast path feature detection from working" 2024-08-29 11:51:43 -03:00
test-libcapstone.c perf: build: introduce the libcapstone 2024-02-20 18:06:25 -08:00
test-libcpupower.c tools/build: Add libcpupower dependency detection 2024-10-17 17:13:15 -04:00
test-libdebuginfod.c tools build: Fix a number of Wconversion warnings 2025-02-12 20:23:05 -08:00
test-libdw.c tools build: Fix a number of Wconversion warnings 2025-02-12 20:23:05 -08:00
test-libelf-gelf_getnote.c tools build: Fix a number of Wconversion warnings 2025-02-12 20:23:05 -08:00
test-libelf-getphdrnum.c
test-libelf-getshdrstrndx.c
test-libelf-zstd.c tools build: Add feature test for libelf with ZSTD 2024-12-18 16:24:32 -03:00
test-libelf.c tools build: Fix a number of Wconversion warnings 2025-02-12 20:23:05 -08:00
test-libnuma.c
test-libopencsd.c perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present 2023-11-27 10:21:27 -03:00
test-libopenssl.c tools/build: Add a feature test for libopenssl 2025-12-17 05:44:24 -08:00
test-libperl.c
test-libpfm4.c
test-libpython.c
test-libslang.c
test-libtraceevent.c perf build: Include libtraceevent headers directly indicated by pkg-config 2024-11-08 22:42:57 -08:00
test-libtracefs.c perf build: Use pkg-config for feature check for libtrace{event,fs} 2024-06-21 16:19:03 -07:00
test-libunwind-aarch64.c
test-libunwind-arm.c
test-libunwind-debug-frame-aarch64.c
test-libunwind-debug-frame-arm.c
test-libunwind-debug-frame.c
test-libunwind-x86.c
test-libunwind-x86_64.c
test-libunwind.c
test-libzstd.c
test-llvm-perf.cpp perf build: Autodetect minimum required llvm-dev version 2024-09-10 17:32:46 -03:00
test-llvm.cpp tools build: Fix llvm feature detection, still used by bpftool 2023-10-19 22:33:58 -03:00
test-lzma.c tools build: Fix a number of Wconversion warnings 2025-02-12 20:23:05 -08:00
test-numa_num_possible_cpus.c
test-pthread-attr-setaffinity-np.c
test-pthread-barrier.c
test-reallocarray.c
test-scandirat.c tools build: Add a feature test for scandirat(), that is not implemented so far in musl and uclibc 2023-04-04 13:18:17 -03:00
test-sched_getcpu.c
test-sdt.c
test-setns.c
test-stackprotector-all.c
test-timerfd.c
test-zlib.c