blob: 2849aeda4238997975c5a8096da474e54da26932 [file] [log] [blame]
xf.libdd93d52023-05-12 07:10:14 -07001gnulib-arch = $(elf-objpfx)libgcc-stubs.a
2static-gnulib-arch = $(elf-objpfx)libgcc-stubs.a
3
4# All supported build tools support TLS descriptors, but the OS may not.
5ifndef have-arm-tls-desc
6have-arm-tls-desc = yes
7endif
8
9ifeq ($(subdir),elf)
10sysdep-dl-routines += tlsdesc dl-tlsdesc
11sysdep_routines += aeabi_unwind_cpp_pr1 find_exidx
12sysdep-rtld-routines += aeabi_unwind_cpp_pr1
13shared-only-routines += aeabi_unwind_cpp_pr1
14
15$(objpfx)libgcc-stubs.a: $(objpfx)aeabi_unwind_cpp_pr1.os
16 $(build-extra-lib)
17
18lib-noranlib: $(objpfx)libgcc-stubs.a
19
20ifeq ($(build-shared),yes)
21ifeq ($(have-arm-tls-desc),yes)
22tests += tst-armtlsdescloc tst-armtlsdescextnow tst-armtlsdescextlazy
23modules-names += tst-armtlsdesclocmod
24modules-names += tst-armtlsdescextlazymod tst-armtlsdescextnowmod
25CPPFLAGS-tst-armtlsdescextnowmod.c += -Dstatic=
26CPPFLAGS-tst-armtlsdescextlazymod.c += -Dstatic=
27CFLAGS-tst-armtlsdesclocmod.c += -mtls-dialect=gnu2
28CFLAGS-tst-armtlsdescextnowmod.c += -mtls-dialect=gnu2
29CFLAGS-tst-armtlsdescextlazymod.c += -mtls-dialect=gnu2
30LDFLAGS-tst-armtlsdescextnowmod.so += -Wl,-z,now
31tst-armtlsdescloc-ENV = LD_BIND_NOW=1
32tst-armtlsdescextnow-ENV = LD_BIND_NOW=1
33tst-armtlsdescextlazy-ENV = LD_BIND_NOW=1
34$(objpfx)tst-armtlsdescloc: $(objpfx)tst-armtlsdesclocmod.so
35$(objpfx)tst-armtlsdescextnow: $(objpfx)tst-armtlsdescextnowmod.so
36$(objpfx)tst-armtlsdescextlazy: $(objpfx)tst-armtlsdescextlazymod.so
37endif
38endif
39endif
40
41ifeq ($(subdir),csu)
42# get offset to rtld_global._dl_hwcap
43gen-as-const-headers += rtld-global-offsets.sym tlsdesc.sym
44aeabi_constants = aeabi_lcsts aeabi_sighandlers aeabi_math
45aeabi_routines = aeabi_assert aeabi_localeconv aeabi_errno_addr \
46 aeabi_mb_cur_max aeabi_atexit aeabi_memclr aeabi_memcpy \
47 aeabi_memmove aeabi_memset \
48 aeabi_read_tp libc-aeabi_read_tp
49
50sysdep_routines += $(aeabi_constants) $(aeabi_routines)
51static-only-routines += $(aeabi_constants) aeabi_read_tp
52shared-only-routines += libc-aeabi_read_tp
53
54# In order for unwinding to fail when it falls out of main, we need a
55# cantunwind marker. There's one in start.S. To make sure we reach it, add
56# unwind tables for __libc_start_main.
57CFLAGS-libc-start.c += -fexceptions
58
59sysdep_routines += arm-unwind-resume
60shared-only-routines += arm-unwind-resume
61endif
62
63ifeq ($(subdir),gmon)
64sysdep_routines += arm-mcount
65endif
66
67ifeq ($(subdir),debug)
68CFLAGS-backtrace.c += -funwind-tables
69endif
70
71ifeq ($(subdir),rt)
72librt-sysdep_routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
73librt-shared-only-routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
74endif
75
76ifeq ($(subdir),nptl)
77libpthread-sysdep_routines += pt-arm-unwind-resume
78libpthread-shared-only-routines += pt-arm-unwind-resume
79endif