mips: increase stack alignment in clone to match the ABI
[glibc.git] / support / Makefile
bloba462781718426d3563c310c5d0f2728969dabf85
1 # Makefile for support library, used only at build and test time
2 # Copyright (C) 2016-2021 Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, see
17 # <https://www.gnu.org/licenses/>.
19 subdir := support
21 include ../Makeconfig
23 extra-libs := libsupport
24 extra-libs-others = $(extra-libs)
25 extra-libs-noinstall := $(extra-libs)
27 libsupport-routines = \
28 blob_repeat \
29 check \
30 check_addrinfo \
31 check_dns_packet \
32 check_hostent \
33 check_netent \
34 delayed_exit \
35 ignore_stderr \
36 next_to_fault \
37 oom_error \
38 resolv_response_context_duplicate \
39 resolv_response_context_free \
40 resolv_test \
41 set_fortify_handler \
42 support_stack_alloc \
43 support-xfstat \
44 support-xfstat-time64 \
45 support-xstat \
46 support-xstat-time64 \
47 support_become_root \
48 support_can_chroot \
49 support_capture_subprocess \
50 support_capture_subprocess_check \
51 support_chroot \
52 support_copy_file \
53 support_copy_file_range \
54 support_create_timer \
55 support_descriptor_supports_holes \
56 support_descriptors \
57 support_enter_mount_namespace \
58 support_enter_network_namespace \
59 support_format_address_family \
60 support_format_addrinfo \
61 support_format_dns_packet \
62 support_format_herrno \
63 support_format_hostent \
64 support_format_netent \
65 support_isolate_in_subprocess \
66 support_path_support_time64 \
67 support_process_state \
68 support_ptrace \
69 support_openpty \
70 support_paths \
71 support_quote_blob \
72 support_quote_string \
73 support_record_failure \
74 support_run_diff \
75 support_select_modifies_timeout \
76 support_select_normalizes_timeout \
77 support_set_small_thread_stack_size \
78 support_shared_allocate \
79 support_small_stack_thread_attribute \
80 support_stat_nanoseconds \
81 support_subprocess \
82 support_test_compare_blob \
83 support_test_compare_failure \
84 support_test_compare_string \
85 support_write_file_string \
86 support_test_main \
87 support_test_verify_impl \
88 temp_file \
89 timespec \
90 timespec-time64 \
91 timespec-add \
92 timespec-add-time64 \
93 timespec-sub \
94 timespec-sub-time64 \
95 write_message \
96 xaccept \
97 xaccept4 \
98 xasprintf \
99 xbind \
100 xcalloc \
101 xchdir \
102 xchroot \
103 xclock_gettime \
104 xclock_gettime_time64 \
105 xclock_settime \
106 xclock_settime_time64 \
107 xclone \
108 xclose \
109 xchmod \
110 xconnect \
111 xcopy_file_range \
112 xdlfcn \
113 xdlmopen \
114 xdup2 \
115 xfchmod \
116 xfclose \
117 xfopen \
118 xfork \
119 xftruncate \
120 xgetline \
121 xgetsockname \
122 xlisten \
123 xlseek \
124 xlstat \
125 xlstat-time64 \
126 xmalloc \
127 xmemstream \
128 xmkdir \
129 xmkdirp \
130 xmmap \
131 xmprotect \
132 xmunmap \
133 xnewlocale \
134 xopen \
135 xpipe \
136 xpoll \
137 xposix_memalign \
138 xpthread_attr_destroy \
139 xpthread_attr_init \
140 xpthread_attr_setdetachstate \
141 xpthread_attr_setguardsize \
142 xpthread_attr_setaffinity_np \
143 xpthread_attr_setstack \
144 xpthread_attr_setstacksize \
145 xpthread_barrier_destroy \
146 xpthread_barrier_init \
147 xpthread_barrier_wait \
148 xpthread_barrierattr_destroy \
149 xpthread_barrierattr_init \
150 xpthread_barrierattr_setpshared \
151 xpthread_cancel \
152 xpthread_check_return \
153 xpthread_cond_wait \
154 xpthread_create \
155 xpthread_detach \
156 xpthread_join \
157 xpthread_key_create \
158 xpthread_key_delete \
159 xpthread_kill \
160 xpthread_mutex_consistent \
161 xpthread_mutex_destroy \
162 xpthread_mutex_init \
163 xpthread_mutex_lock \
164 xpthread_mutex_unlock \
165 xpthread_mutexattr_destroy \
166 xpthread_mutexattr_init \
167 xpthread_mutexattr_setprotocol \
168 xpthread_mutexattr_setpshared \
169 xpthread_mutexattr_setrobust \
170 xpthread_mutexattr_settype \
171 xpthread_once \
172 xpthread_rwlock_init \
173 xpthread_rwlock_destroy \
174 xpthread_rwlock_rdlock \
175 xpthread_rwlock_unlock \
176 xpthread_rwlock_wrlock \
177 xpthread_rwlockattr_init \
178 xpthread_rwlockattr_setkind_np \
179 xpthread_sigmask \
180 xpthread_spin_lock \
181 xpthread_spin_unlock \
182 xraise \
183 xreadlink \
184 xrealloc \
185 xrecvfrom \
186 xsendto \
187 xsetlocale \
188 xsetsockopt \
189 xsigaction \
190 xsignal \
191 xsigstack \
192 xsocket \
193 xposix_spawn \
194 xposix_spawn_file_actions_addclose \
195 xposix_spawn_file_actions_adddup2 \
196 xstrdup \
197 xstrndup \
198 xsymlink \
199 xsysconf \
200 xunlink \
201 xuselocale \
202 xwaitpid \
203 xwrite \
205 libsupport-static-only-routines := $(libsupport-routines)
206 # Only build one variant of the library.
207 libsupport-inhibit-o := .os
208 ifeq ($(build-shared),yes)
209 libsupport-inhibit-o += .o
210 endif
212 CFLAGS-support_paths.c = \
213 -DSRCDIR_PATH=\"`cd .. ; pwd`\" \
214 -DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \
215 -DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \
216 -DINSTDIR_PATH=\"$(prefix)\" \
217 -DLIBDIR_PATH=\"$(libdir)\" \
218 -DBINDIR_PATH=\"$(bindir)\" \
219 -DSBINDIR_PATH=\"$(sbindir)\" \
220 -DSLIBDIR_PATH=\"$(slibdir)\" \
221 -DROOTSBINDIR_PATH=\"$(rootsbindir)\" \
222 -DCOMPLOCALEDIR_PATH=\"$(complocaledir)\"
224 # In support_timespec_check_in_range we may be passed a very tight
225 # range for which we should produce a correct result for expected
226 # being withing the observed range. The code uses double internally
227 # in support_timespec_check_in_range and for that computation we use
228 # -fexcess-precision=standard.
229 CFLAGS-timespec.c += -fexcess-precision=standard
230 CFLAGS-timespec-time64.c += -fexcess-precision=standard
232 ifeq (,$(CXX))
233 LINKS_DSO_PROGRAM = links-dso-program-c
234 else
235 LINKS_DSO_PROGRAM = links-dso-program
236 LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind)
237 endif
239 ifeq (yes,$(have-selinux))
240 LDLIBS-$(LINKS_DSO_PROGRAM) += -lselinux
241 endif
244 LDLIBS-test-container = $(libsupport)
246 others += test-container
247 others-noinstall += test-container
249 others += shell-container echo-container true-container
250 others-noinstall += shell-container echo-container true-container
252 others += $(LINKS_DSO_PROGRAM)
253 others-noinstall += $(LINKS_DSO_PROGRAM)
255 $(objpfx)test-container : $(libsupport)
256 $(objpfx)shell-container : $(libsupport)
257 $(objpfx)echo-container : $(libsupport)
258 $(objpfx)true-container : $(libsupport)
260 tests = \
261 README-testing \
262 tst-support-namespace \
263 tst-support_blob_repeat \
264 tst-support_capture_subprocess \
265 tst-support_descriptors \
266 tst-support_format_dns_packet \
267 tst-support-process_state \
268 tst-support_quote_blob \
269 tst-support_quote_string \
270 tst-support_record_failure \
271 tst-test_compare \
272 tst-test_compare_blob \
273 tst-test_compare_string \
274 tst-timespec \
275 tst-xreadlink \
276 tst-xsigstack \
278 ifeq ($(run-built-tests),yes)
279 tests-special = \
280 $(objpfx)tst-support_record_failure-2.out
282 $(objpfx)tst-support_record_failure-2.out: tst-support_record_failure-2.sh \
283 $(objpfx)tst-support_record_failure
284 $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
285 '$(run-program-env)' '$(test-program-prefix-after-env)' \
286 > $@; \
287 $(evaluate-test)
288 endif
290 $(objpfx)tst-support_format_dns_packet: $(common-objpfx)resolv/libresolv.so
292 tst-support_capture_subprocess-ARGS = -- $(host-test-program-cmd)
294 include ../Rules