Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tools/build/Makefile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ FEATURE_TESTS_BASIC := \

# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
# of all feature tests

LIBUNWIND_ARCHS:=aarch64 arm loongarch64 mips ppc32 ppc64 riscv s390x x86 x86_64

FEATURE_TESTS_EXTRA := \
bionic \
compile-32 \
Expand All @@ -127,7 +130,10 @@ FEATURE_TESTS_EXTRA := \
libpfm4 \
libdebuginfod \
clang-bpf-co-re \
bpftool-skeletons
bpftool-skeletons \
libunwind \
libunwind-debug-frame \
$(foreach arch,$(LIBUNWIND_ARCHS),libunwind-$(arch) libunwind-debug-frame-$(arch))


FEATURE_TESTS ?= $(FEATURE_TESTS_BASIC)
Expand Down Expand Up @@ -212,6 +218,10 @@ ifeq ($(feature-all), 1)
$(call feature_check,compile-x32)
$(call feature_check,bionic)
$(call feature_check,libbabeltrace)
$(call feature_check,libunwind)
$(call feature_check,libunwind-debug-frame)
$(foreach arch,$(LIBUNWIND_ARCHS),$(call feature_check,libunwind-$(arch)))
$(foreach arch,$(LIBUNWIND_ARCHS),$(call feature_check,libunwind-debug-frame-$(arch)))
else
$(foreach feat,$(FEATURE_TESTS),$(call feature_check,$(feat)))
endif
Expand Down
46 changes: 21 additions & 25 deletions tools/build/feature/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
include ../../scripts/Makefile.include

LIBUNWIND_ARCHS:=aarch64 arm loongarch64 mips ppc32 ppc64 riscv s390x x86 x86_64

FILES= \
test-all.bin \
test-backtrace.bin \
Expand Down Expand Up @@ -38,12 +40,7 @@ FILES= \
test-libtracefs.bin \
test-libunwind.bin \
test-libunwind-debug-frame.bin \
test-libunwind-x86.bin \
test-libunwind-x86_64.bin \
test-libunwind-arm.bin \
test-libunwind-aarch64.bin \
test-libunwind-debug-frame-arm.bin \
test-libunwind-debug-frame-aarch64.bin \
$(foreach arch,$(LIBUNWIND_ARCHS),test-libunwind-$(arch).bin test-libunwind-debug-frame-$(arch).bin) \
test-pthread-attr-setaffinity-np.bin \
test-pthread-barrier.bin \
test-stackprotector-all.bin \
Expand Down Expand Up @@ -211,27 +208,26 @@ $(OUTPUT)test-numa_num_possible_cpus.bin:
$(BUILD) -lnuma

$(OUTPUT)test-libunwind.bin:
$(BUILD) -lelf -llzma
$(BUILD) -include libunwind.h -lelf -llzma -lunwind

$(OUTPUT)test-libunwind-debug-frame.bin:
$(BUILD) -lelf -llzma
$(OUTPUT)test-libunwind-x86.bin:
$(BUILD) -lelf -llzma -lunwind-x86

$(OUTPUT)test-libunwind-x86_64.bin:
$(BUILD) -lelf -llzma -lunwind-x86_64

$(OUTPUT)test-libunwind-arm.bin:
$(BUILD) -lelf -llzma -lunwind-arm

$(OUTPUT)test-libunwind-aarch64.bin:
$(BUILD) -lelf -llzma -lunwind-aarch64

$(OUTPUT)test-libunwind-debug-frame-arm.bin:
$(BUILD) -lelf -llzma -lunwind-arm

$(OUTPUT)test-libunwind-debug-frame-aarch64.bin:
$(BUILD) -lelf -llzma -lunwind-aarch64
$(BUILD) -include libunwind.h -lelf -llzma -lunwind

define LIBUNWIND_RULE
$$(OUTPUT)test-libunwind-$(1).bin:
$$(CC) $$(CFLAGS) -MD -Wall -Werror -include libunwind-$(1).h -o $$@ \
test-libunwind.c $$(LDFLAGS) -lelf -llzma -lunwind-$(1) \
> $$(@:.bin=.make.output) 2>&1

$$(OUTPUT)test-libunwind-debug-frame-$(1).bin:
$$(CC) $$(CFLAGS) -MD -Wall -Werror -include libunwind-$(1).h -o $$@ \
test-libunwind-debug-frame.c $$(LDFLAGS) -lelf -llzma -lunwind-$(1) \
> $$(@:.bin=.make.output) 2>&1

endef
$(foreach arch,$(LIBUNWIND_ARCHS), \
$(eval $(call LIBUNWIND_RULE,$(arch))) \
)

$(OUTPUT)test-libslang.bin:
$(BUILD) -lslang
Expand Down
27 changes: 0 additions & 27 deletions tools/build/feature/test-libunwind-aarch64.c

This file was deleted.

28 changes: 0 additions & 28 deletions tools/build/feature/test-libunwind-arm.c

This file was deleted.

17 changes: 0 additions & 17 deletions tools/build/feature/test-libunwind-debug-frame-aarch64.c

This file was deleted.

17 changes: 0 additions & 17 deletions tools/build/feature/test-libunwind-debug-frame-arm.c

This file was deleted.

1 change: 0 additions & 1 deletion tools/build/feature/test-libunwind-debug-frame.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
#include <libunwind.h>
#include <stdlib.h>

extern int
Expand Down
28 changes: 0 additions & 28 deletions tools/build/feature/test-libunwind-x86.c

This file was deleted.

28 changes: 0 additions & 28 deletions tools/build/feature/test-libunwind-x86_64.c

This file was deleted.

1 change: 0 additions & 1 deletion tools/build/feature/test-libunwind.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
#include <libunwind.h>
#include <stdlib.h>

extern int UNW_OBJ(dwarf_search_unwind_table) (unw_addr_space_t as,
Expand Down
Loading
Loading