3
  #   ˆl–Ü4ý( ©³( 	Å€fàB¦-ÿ¿„yÏÂÁ (’    # SPDX-License-Identifier: GPL-2.0-only
feature_dir := $(srctree)/tools/build/feature

ifneq ($(OUTPUT),)
  OUTPUT_FEATURES = $(OUTPUT)feature/
  $(shell mkdir -p $(OUTPUT_FEATURES))
endif

feature_check = $(eval $(feature_check_code))
define feature_check_code
  feature-$(1) := $(shell $(MAKE) OUTPUT=$(OUTPUT_FEATURES) CC="$(CC)" CXX="$(CXX)" CFLAGS="$(EXTRA_CFLAGS) $(FEATURE_CHECK_CFLAGS-$(1))" CXXFLAGS="$(EXTRA_CXXFLAGS) $(FEATURE_CHECK_CXXFLAGS-$(1))" LDFLAGS="$(LDFLAGS) $(FEATURE_CHECK_LDFLAGS-$(1))" -C $(feature_dir) $(OUTPUT_FEATURES)test-$1.bin >/dev/null 2>/dev/null && echo 1 || echo 0)
endef

feature_set = $(eval $(feature_set_code))
define feature_set_code
  feature-$(1) := 1
endef

#
# Build the feature check binaries in parallel, ignore errors, ignore return value and suppress output:
#

#
# Note that this is not a complete list of all feature tests, just
# those that are typically built on a fully configured system.
#
# [ Feature tests not mentioned here have to be built explicitly in
#   the rule that uses them - an example for that is the 'bionic'
#   feature check. ]
#
FEATURE_TESTS_BASIC :=                  \
        backtrace                       \
        dwarf                           \
        dwarf_getlocations              \
        dwarf_getcfi                    \
        eventfd                         \
        fortify-source                  \
        get_current_dir_name            \
        gettid				\
        glibc                           \
        libbfd                          \
        libbfd-buildid			\
        libcap                          \
        libelf                          \
        libelf-getphdrnum               \
        libelf-gelf_getnote             \
        libelf-getshdrstrndx            \
        libnuma                         \
        numa_num_possible_cpus          \
        libperl                         \
        libpython                       \
        libslang                        \
        libslang-include-subdir         \
        libtraceevent                   \
        libtracefs                      \
        libcpupower                     \
        libcrypto                       \
        libunwind                       \
        pthread-attr-setaffinity-np     \
        pthread-barrier     		\
        reallocarray                    \
        stackprotector-all              \
        timerfd                         \
        libdw-dwarf-unwind              \
        zlib                            \
        lzma                            \
        get_cpuid                       \
        bpf                             \
        scandirat			\
        sched_getcpu			\
        sdt				\
        setns				\
        libaio				\
        libzstd				\
        disassembler-four-args		\
        file-handle

# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
# of all feature tests
FEATURE_TESTS_EXTRA :=                  \
         bionic                         \
         compile-32                     \
         compile-x32                    \
         cplus-demangle                 \
         cxa-demangle                   \
         gtk2                           \
         gtk2-infobar                   \
         hello                          \
         libbabeltrace                  \
         libcapstone                    \
         libbfd-liberty                 \
         libbfd-liberty-z               \
         libopencsd                     \
         libunwind-x86                  \
         libunwind-x86_64               \
         libunwind-arm                  \
         libunwind-aarch64              \
         libunwind-debug-frame          \
         libunwind-debug-frame-arm      \
         libunwind-debug-frame-aarch64  \
         cxx                            \
         llvm                           \
         clang                          \
         libbpf                         \
         libbpf-btf__load_from_kernel_by_id \
         libbpf-bpf_prog_l