Fix memory leak in __printf_fp_l (bug 26215).
[glibc.git] / support / Makefile
blob764b471033350b05c692fd6e2099f328a298e457
1 # Makefile for support library, used only at build and test time
2 # Copyright (C) 2016-2020 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_test \
39 set_fortify_handler \
40 support-xfstat \
41 support-xstat \
42 support_become_root \
43 support_can_chroot \
44 support_capture_subprocess \
45 support_capture_subprocess_check \
46 support_chroot \
47 support_copy_file_range \
48 support_descriptor_supports_holes \
49 support_descriptors \
50 support_enter_mount_namespace \
51 support_enter_network_namespace \
52 support_format_address_family \
53 support_format_addrinfo \
54 support_format_dns_packet \
55 support_format_herrno \
56 support_format_hostent \
57 support_format_netent \
58 support_isolate_in_subprocess \
59 support_process_state \
60 support_ptrace \
61 support_openpty \
62 support_paths \
63 support_quote_blob \
64 support_quote_string \
65 support_record_failure \
66 support_run_diff \
67 support_set_small_thread_stack_size \
68 support_shared_allocate \
69 support_small_stack_thread_attribute \
70 support_subprocess \
71 support_test_compare_blob \
72 support_test_compare_failure \
73 support_test_compare_string \
74 support_write_file_string \
75 support_test_main \
76 support_test_verify_impl \
77 temp_file \
78 timespec \
79 timespec-add \
80 timespec-sub \
81 write_message \
82 xaccept \
83 xaccept4 \
84 xasprintf \
85 xbind \
86 xcalloc \
87 xchroot \
88 xclock_gettime \
89 xclose \
90 xconnect \
91 xcopy_file_range \
92 xdlfcn \
93 xdlmopen \
94 xdup2 \
95 xfclose \
96 xfopen \
97 xfork \
98 xftruncate \
99 xgetline \
100 xgetsockname \
101 xlisten \
102 xlseek \
103 xlstat \
104 xmalloc \
105 xmemstream \
106 xmkdir \
107 xmkdirp \
108 xmmap \
109 xmprotect \
110 xmunmap \
111 xnewlocale \
112 xopen \
113 xpipe \
114 xpoll \
115 xposix_memalign \
116 xpthread_attr_destroy \
117 xpthread_attr_init \
118 xpthread_attr_setdetachstate \
119 xpthread_attr_setguardsize \
120 xpthread_attr_setstack \
121 xpthread_attr_setstacksize \
122 xpthread_barrier_destroy \
123 xpthread_barrier_init \
124 xpthread_barrier_wait \
125 xpthread_barrierattr_destroy \
126 xpthread_barrierattr_init \
127 xpthread_barrierattr_setpshared \
128 xpthread_cancel \
129 xpthread_check_return \
130 xpthread_cond_wait \
131 xpthread_create \
132 xpthread_detach \
133 xpthread_join \
134 xpthread_key_create \
135 xpthread_key_delete \
136 xpthread_mutex_consistent \
137 xpthread_mutex_destroy \
138 xpthread_mutex_init \
139 xpthread_mutex_lock \
140 xpthread_mutex_unlock \
141 xpthread_mutexattr_destroy \
142 xpthread_mutexattr_init \
143 xpthread_mutexattr_setprotocol \
144 xpthread_mutexattr_setpshared \
145 xpthread_mutexattr_setrobust \
146 xpthread_mutexattr_settype \
147 xpthread_once \
148 xpthread_rwlock_init \
149 xpthread_rwlock_destroy \
150 xpthread_rwlock_rdlock \
151 xpthread_rwlock_unlock \
152 xpthread_rwlock_wrlock \
153 xpthread_rwlockattr_init \
154 xpthread_rwlockattr_setkind_np \
155 xpthread_sigmask \
156 xpthread_spin_lock \
157 xpthread_spin_unlock \
158 xraise \
159 xreadlink \
160 xrealloc \
161 xrecvfrom \
162 xsendto \
163 xsetlocale \
164 xsetsockopt \
165 xsigaction \
166 xsignal \
167 xsigstack \
168 xsocket \
169 xposix_spawn \
170 xposix_spawn_file_actions_addclose \
171 xposix_spawn_file_actions_adddup2 \
172 xstrdup \
173 xstrndup \
174 xsymlink \
175 xsysconf \
176 xunlink \
177 xuselocale \
178 xwaitpid \
179 xwrite \
181 libsupport-static-only-routines := $(libsupport-routines)
182 # Only build one variant of the library.
183 libsupport-inhibit-o := .os
184 ifeq ($(build-shared),yes)
185 libsupport-inhibit-o += .o
186 endif
188 CFLAGS-support_paths.c = \
189 -DSRCDIR_PATH=\"`cd .. ; pwd`\" \
190 -DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \
191 -DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \
192 -DINSTDIR_PATH=\"$(prefix)\" \
193 -DLIBDIR_PATH=\"$(libdir)\" \
194 -DBINDIR_PATH=\"$(bindir)\" \
195 -DSBINDIR_PATH=\"$(sbindir)\" \
196 -DROOTSBINDIR_PATH=\"$(rootsbindir)\" \
197 -DCOMPLOCALEDIR_PATH=\"$(complocaledir)\"
199 ifeq (,$(CXX))
200 LINKS_DSO_PROGRAM = links-dso-program-c
201 else
202 LINKS_DSO_PROGRAM = links-dso-program
203 LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind)
204 endif
206 ifeq (yes,$(have-selinux))
207 LDLIBS-$(LINKS_DSO_PROGRAM) += -lselinux
208 endif
211 LDLIBS-test-container = $(libsupport)
213 others += test-container
214 others-noinstall += test-container
216 others += shell-container echo-container true-container
217 others-noinstall += shell-container echo-container true-container
219 others += $(LINKS_DSO_PROGRAM)
220 others-noinstall += $(LINKS_DSO_PROGRAM)
222 $(objpfx)test-container : $(libsupport)
223 $(objpfx)shell-container : $(libsupport)
224 $(objpfx)echo-container : $(libsupport)
225 $(objpfx)true-container : $(libsupport)
227 tests = \
228 README-testing \
229 tst-support-namespace \
230 tst-support_blob_repeat \
231 tst-support_capture_subprocess \
232 tst-support_descriptors \
233 tst-support_format_dns_packet \
234 tst-support-process_state \
235 tst-support_quote_blob \
236 tst-support_quote_string \
237 tst-support_record_failure \
238 tst-test_compare \
239 tst-test_compare_blob \
240 tst-test_compare_string \
241 tst-xreadlink \
242 tst-xsigstack \
244 ifeq ($(run-built-tests),yes)
245 tests-special = \
246 $(objpfx)tst-support_record_failure-2.out
248 $(objpfx)tst-support_record_failure-2.out: tst-support_record_failure-2.sh \
249 $(objpfx)tst-support_record_failure
250 $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
251 '$(run-program-env)' '$(test-program-prefix-after-env)' \
252 > $@; \
253 $(evaluate-test)
254 endif
256 $(objpfx)tst-support_format_dns_packet: $(common-objpfx)resolv/libresolv.so
258 tst-support_capture_subprocess-ARGS = -- $(host-test-program-cmd)
260 include ../Rules