• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1AM_CPPFLAGS = -I$(top_srcdir)/include
2AM_CFLAGS = -fno-optimize-sibling-calls
3
4EXTRA_DIST =	run-ia64-test-dyn1 run-ptrace-mapper run-ptrace-misc	\
5		run-check-namespace run-coredump-unwind \
6		run-coredump-unwind-mdi check-namespace.sh.in \
7		Gtest-nomalloc.c
8
9MAINTAINERCLEANFILES = Makefile.in
10
11noinst_PROGRAMS_arch =
12noinst_PROGRAMS_cdep =
13noinst_PROGRAMS_common =
14check_PROGRAMS_arch =
15check_PROGRAMS_cdep =
16check_PROGRAMS_common = test-proc-info test-static-link \
17			test-strerror
18check_SCRIPTS_arch =
19check_SCRIPTS_cdep =
20check_SCRIPTS_common =	run-check-namespace
21
22if REMOTE_ONLY
23
24perf:
25
26else
27 LIBUNWIND_local = $(top_builddir)/src/libunwind.la
28if ARCH_IA64
29 noinst_PROGRAMS_arch += ia64-test-dyn1
30 check_SCRIPTS_arch +=	run-ia64-test-dyn1
31 check_PROGRAMS_arch +=	Gia64-test-stack Lia64-test-stack		\
32			Gia64-test-nat Lia64-test-nat			\
33			Gia64-test-rbs Lia64-test-rbs			\
34			Gia64-test-readonly Lia64-test-readonly		\
35			ia64-test-setjmp ia64-test-sig
36else #!ARCH_IA64
37if ARCH_PPC64
38if USE_ALTIVEC
39 noinst_PROGRAMS_arch += ppc64-test-altivec
40endif #USE_ALTIVEC
41else  #!ARCH_PPC64
42if ARCH_X86_64
43 check_PROGRAMS_arch +=	Gx64-test-dwarf-expressions Lx64-test-dwarf-expressions x64-unwind-badjmp-signal-frame
44endif #ARCH X86_64
45endif #!ARCH_PPC64
46endif #!ARCH_IA64
47 check_PROGRAMS_cdep +=	Gtest-bt Ltest-bt Gtest-exc Ltest-exc		 \
48			Gtest-init Ltest-init				 \
49			Gtest-concurrent Ltest-concurrent		 \
50			Gtest-resume-sig Ltest-resume-sig		 \
51			Gtest-resume-sig-rt Ltest-resume-sig-rt		 \
52			Gtest-trace Ltest-trace				 \
53			Ltest-init-local-signal				 \
54			Ltest-mem-validate				 \
55			test-async-sig test-flush-cache test-init-remote \
56			test-mem test-reg-state Ltest-varargs		 \
57			Ltest-nomalloc Ltest-nocalloc Lrs-race
58 noinst_PROGRAMS_cdep += forker Gperf-simple Lperf-simple \
59			Gperf-trace Lperf-trace
60
61if BUILD_PTRACE
62 check_SCRIPTS_cdep += run-ptrace-mapper run-ptrace-misc
63 check_PROGRAMS_cdep += test-ptrace
64 noinst_PROGRAMS_cdep += mapper test-ptrace-misc
65endif
66
67if BUILD_SETJMP
68 check_PROGRAMS_cdep += test-setjmp
69endif
70
71if SUPPORT_CXX_EXCEPTIONS
72 check_PROGRAMS_cdep += Ltest-cxx-exceptions
73endif
74
75if OS_LINUX
76if BUILD_COREDUMP
77 check_SCRIPTS_cdep += run-coredump-unwind
78 noinst_PROGRAMS_cdep += crasher test-coredump-unwind
79
80if HAVE_LZMA
81 check_SCRIPTS_cdep += run-coredump-unwind-mdi
82endif # HAVE_LZMA
83endif # BUILD_COREDUMP
84endif # OS_LINUX
85
86perf: perf-startup Gperf-simple Lperf-simple Lperf-trace
87	@echo "########## Basic performance of generic libunwind:"
88	@./Gperf-simple
89	@echo "########## Basic performance of local-only libunwind:"
90	@./Lperf-simple
91	@echo "########## Performance of fast unwind:"
92	@./Lperf-trace
93	@echo "########## Startup overhead:"
94	@$(srcdir)/perf-startup @arch@
95
96endif
97
98check_PROGRAMS = $(check_PROGRAMS_common) $(check_PROGRAMS_cdep) \
99		 $(check_PROGRAMS_arch)
100check_SCRIPTS =	$(check_SCRIPTS_common) $(check_SCRIPTS_cdep) \
101		$(check_SCRIPTS_arch)
102
103
104TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
105XFAIL_TESTS =
106
107if ARCH_IA64
108 check_PROGRAMS_cdep += Gtest-dyn1 Ltest-dyn1
109endif
110
111# Use if arch defines but does not support PTRACE_SINGLESTEP
112# ptrace request used in the tests.
113XFAIL_TESTS_PTRACE_SINGLESTEP = run-ptrace-mapper run-ptrace-misc
114
115if ARCH_MIPS
116XFAIL_TESTS += $(XFAIL_TESTS_PTRACE_SINGLESTEP)
117endif
118
119if ARCH_RISCV
120XFAIL_TESTS += $(XFAIL_TESTS_PTRACE_SINGLESTEP)
121endif
122
123if ARCH_ARM
124# ARM Linux kernel >=2.6.39 removed PTRACE_SINGLESTEP emulation
125XFAIL_TESTS += $(XFAIL_TESTS_PTRACE_SINGLESTEP)
126endif
127
128# This is meant for multilib binaries, -m32.
129# ptrace gives EBADREG when testing,
130# but generally everything else works.
131if NO_PTRACE_TEST
132 XFAIL_TESTS += run-ptrace-mapper test-ptrace Ltest-init-local-signal
133endif
134
135noinst_PROGRAMS = $(noinst_PROGRAMS_common) $(noinst_PROGRAMS_cdep) \
136	$(noinst_PROGRAMS_arch)
137
138Lia64_test_readonly_SOURCES = Lia64-test-readonly.c ia64-test-readonly-asm.S
139Gia64_test_readonly_SOURCES = Gia64-test-readonly.c ia64-test-readonly-asm.S
140Lia64_test_stack_SOURCES = Lia64-test-stack.c ia64-test-stack-asm.S \
141				ia64-test-stack.h
142Gia64_test_stack_SOURCES = Gia64-test-stack.c ia64-test-stack-asm.S \
143				ia64-test-stack.h
144Lia64_test_rbs_SOURCES = Lia64-test-rbs.c ia64-test-rbs-asm.S ia64-test-rbs.h
145Gia64_test_rbs_SOURCES = Gia64-test-rbs.c ia64-test-rbs-asm.S ia64-test-rbs.h
146Lia64_test_nat_SOURCES = Lia64-test-nat.c ia64-test-nat-asm.S
147Gia64_test_nat_SOURCES = Gia64-test-nat.c ia64-test-nat-asm.S
148ia64_test_dyn1_SOURCES = ia64-test-dyn1.c ia64-dyn-asm.S flush-cache.S \
149				flush-cache.h
150ppc64_test_altivec_SOURCES = ppc64-test-altivec.c  ppc64-test-altivec-utils.c
151
152
153Gx64_test_dwarf_expressions_SOURCES =  Gx64-test-dwarf-expressions.c \
154																			 x64-test-dwarf-expressions.S
155Lx64_test_dwarf_expressions_SOURCES =  Lx64-test-dwarf-expressions.c \
156																			 x64-test-dwarf-expressions.S
157
158
159Gtest_init_SOURCES = Gtest-init.cxx
160Ltest_init_SOURCES = Ltest-init.cxx
161Ltest_cxx_exceptions_SOURCES = Ltest-cxx-exceptions.cxx
162
163Ltest_init_local_signal_SOURCES = Ltest-init-local-signal.c Ltest-init-local-signal-lib.c
164
165x64_unwind_badjmp_signal_frame_SOURCES = x64-unwind-badjmp-signal-frame.c
166Gtest_dyn1_SOURCES = Gtest-dyn1.c flush-cache.S flush-cache.h
167Ltest_dyn1_SOURCES = Ltest-dyn1.c flush-cache.S flush-cache.h
168test_static_link_SOURCES = test-static-link-loc.c test-static-link-gen.c
169test_static_link_LDFLAGS = -static
170forker_LDFLAGS = -static
171Gtest_bt_SOURCES = Gtest-bt.c ident.c
172Ltest_bt_SOURCES = Ltest-bt.c ident.c
173test_ptrace_misc_SOURCES = test-ptrace-misc.c ident.c
174Ltest_nomalloc_SOURCES = Ltest-nomalloc.c
175Ltest_nocalloc_SOURCES = Ltest-nocalloc.c
176Gtest_trace_SOURCES = Gtest-trace.c ident.c
177Ltest_trace_SOURCES = Ltest-trace.c ident.c
178Ltest_mem_validate_SOURCES = Ltest-mem-validate.c
179
180LIBUNWIND = $(top_builddir)/src/libunwind-$(arch).la
181LIBUNWIND_ptrace = $(top_builddir)/src/libunwind-ptrace.la
182LIBUNWIND_coredump = $(top_builddir)/src/libunwind-coredump.la
183
184if USE_ELF32
185LIBUNWIND_ELF = $(top_builddir)/src/libunwind-elf32.la
186endif
187if USE_ELF64
188LIBUNWIND_ELF = $(top_builddir)/src/libunwind-elf64.la
189endif
190if USE_ELFXX
191LIBUNWIND_ELF = $(top_builddir)/src/libunwind-elfxx.la
192endif
193
194LIBUNWIND_setjmp = $(top_builddir)/src/libunwind-setjmp.la	\
195		   $(LIBUNWIND_ELF) $(LIBUNWIND)
196
197test_async_sig_LDADD = $(LIBUNWIND_local) -lpthread
198test_flush_cache_LDADD = $(LIBUNWIND_local)
199test_init_remote_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
200test_mem_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
201test_reg_state_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
202test_ptrace_LDADD = $(LIBUNWIND_ptrace) $(LIBUNWIND)
203test_proc_info_LDADD = $(LIBUNWIND)
204test_static_link_LDADD = $(LIBUNWIND)
205test_strerror_LDADD = $(LIBUNWIND)
206Lrs_race_LDADD = $(LIBUNWIND_local) -lpthread
207Ltest_varargs_LDADD = $(LIBUNWIND_local)
208Ltest_init_local_signal_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
209
210Gtest_bt_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
211Gtest_concurrent_LDADD = $(LIBUNWIND) $(LIBUNWIND_local) -lpthread
212x64_unwind_badjmp_signal_frame_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
213Gtest_dyn1_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
214Gtest_exc_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
215Gtest_init_LDADD = $(LIBUNWIND) $(LIBUNWIND_local) @BACKTRACELIB@
216Gtest_resume_sig_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
217Gtest_resume_sig_rt_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
218Gperf_simple_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
219Gtest_trace_LDADD=$(LIBUNWIND) $(LIBUNWIND_local)
220Gperf_trace_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
221
222Ltest_bt_LDADD = $(LIBUNWIND_local)
223Ltest_concurrent_LDADD = $(LIBUNWIND_local) -lpthread
224Ltest_cxx_exceptions_LDADD = $(LIBUNWIND_local)
225Ltest_dyn1_LDADD = $(LIBUNWIND_local)
226Ltest_exc_LDADD = $(LIBUNWIND_local)
227Ltest_init_LDADD = $(LIBUNWIND_local)
228Ltest_nomalloc_LDADD = $(LIBUNWIND_local) @DLLIB@
229Ltest_nocalloc_LDADD = $(LIBUNWIND_local) @DLLIB@ -lpthread
230Ltest_resume_sig_LDADD = $(LIBUNWIND_local)
231Ltest_resume_sig_rt_LDADD = $(LIBUNWIND_local)
232Lperf_simple_LDADD = $(LIBUNWIND_local)
233Ltest_trace_LDADD = $(LIBUNWIND_local)
234Lperf_trace_LDADD = $(LIBUNWIND_local)
235Ltest_mem_validate_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
236
237test_setjmp_LDADD = $(LIBUNWIND_setjmp)
238ia64_test_setjmp_LDADD = $(LIBUNWIND_setjmp)
239
240if BUILD_COREDUMP
241test_coredump_unwind_LDADD = $(LIBUNWIND_coredump) $(LIBUNWIND) @BACKTRACELIB@
242endif
243
244Gia64_test_nat_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
245Gia64_test_stack_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
246Gia64_test_rbs_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
247Gia64_test_readonly_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
248Lia64_test_nat_LDADD = $(LIBUNWIND_local)
249Lia64_test_stack_LDADD = $(LIBUNWIND_local)
250Lia64_test_rbs_LDADD = $(LIBUNWIND_local)
251Lia64_test_readonly_LDADD = $(LIBUNWIND_local)
252ia64_test_dyn1_LDADD = $(LIBUNWIND)
253ia64_test_sig_LDADD = $(LIBUNWIND)
254ppc64_test_altivec_LDADD = $(LIBUNWIND)
255
256Gx64_test_dwarf_expressions_LDADD = $(LIBUNWIND) $(LIBUNWIND_local)
257Lx64_test_dwarf_expressions_LDADD = $(LIBUNWIND_local)
258