]> git.ipfire.org Git - thirdparty/glibc.git/blob - support/Makefile
Add crt1-2.0.o for glibc 2.0 compatibility tests
[thirdparty/glibc.git] / support / Makefile
1 # Makefile for support library, used only at build and test time
2 # Copyright (C) 2016-2019 Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
4
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.
9
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.
14
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 # <http://www.gnu.org/licenses/>.
18
19 subdir := support
20
21 include ../Makeconfig
22
23 extra-libs := libsupport
24 extra-libs-others = $(extra-libs)
25 extra-libs-noinstall := $(extra-libs)
26
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_openpty \
60 support_paths \
61 support_quote_blob \
62 support_quote_string \
63 support_record_failure \
64 support_run_diff \
65 support_shared_allocate \
66 support_subprocess \
67 support_test_compare_blob \
68 support_test_compare_failure \
69 support_test_compare_string \
70 support_write_file_string \
71 support_test_main \
72 support_test_verify_impl \
73 temp_file \
74 write_message \
75 xaccept \
76 xaccept4 \
77 xasprintf \
78 xbind \
79 xcalloc \
80 xchroot \
81 xclose \
82 xconnect \
83 xcopy_file_range \
84 xdlfcn \
85 xdlmopen \
86 xdup2 \
87 xfclose \
88 xfopen \
89 xfork \
90 xftruncate \
91 xgetsockname \
92 xlisten \
93 xlseek \
94 xmalloc \
95 xmemstream \
96 xmkdir \
97 xmkdirp \
98 xmmap \
99 xmprotect \
100 xmunmap \
101 xopen \
102 xpipe \
103 xpoll \
104 xposix_memalign \
105 xpthread_attr_destroy \
106 xpthread_attr_init \
107 xpthread_attr_setdetachstate \
108 xpthread_attr_setguardsize \
109 xpthread_attr_setstack \
110 xpthread_attr_setstacksize \
111 xpthread_barrier_destroy \
112 xpthread_barrier_init \
113 xpthread_barrier_wait \
114 xpthread_barrierattr_destroy \
115 xpthread_barrierattr_init \
116 xpthread_barrierattr_setpshared \
117 xpthread_cancel \
118 xpthread_check_return \
119 xpthread_cond_wait \
120 xpthread_create \
121 xpthread_detach \
122 xpthread_join \
123 xpthread_mutex_consistent \
124 xpthread_mutex_destroy \
125 xpthread_mutex_init \
126 xpthread_mutex_lock \
127 xpthread_mutex_unlock \
128 xpthread_mutexattr_destroy \
129 xpthread_mutexattr_init \
130 xpthread_mutexattr_setprotocol \
131 xpthread_mutexattr_setpshared \
132 xpthread_mutexattr_setrobust \
133 xpthread_mutexattr_settype \
134 xpthread_once \
135 xpthread_rwlock_init \
136 xpthread_rwlock_destroy \
137 xpthread_rwlock_rdlock \
138 xpthread_rwlock_unlock \
139 xpthread_rwlock_wrlock \
140 xpthread_rwlockattr_init \
141 xpthread_rwlockattr_setkind_np \
142 xpthread_sigmask \
143 xpthread_spin_lock \
144 xpthread_spin_unlock \
145 xraise \
146 xreadlink \
147 xrealloc \
148 xrecvfrom \
149 xsendto \
150 xsetsockopt \
151 xsigaction \
152 xsignal \
153 xsigstack \
154 xsocket \
155 xposix_spawn \
156 xposix_spawn_file_actions_addclose \
157 xposix_spawn_file_actions_adddup2 \
158 xstrdup \
159 xstrndup \
160 xsymlink \
161 xsysconf \
162 xunlink \
163 xwaitpid \
164 xwrite \
165
166 libsupport-static-only-routines := $(libsupport-routines)
167 # Only build one variant of the library.
168 libsupport-inhibit-o := .os
169 ifeq ($(build-shared),yes)
170 libsupport-inhibit-o += .o
171 endif
172
173 CFLAGS-support_paths.c = \
174 -DSRCDIR_PATH=\"`cd .. ; pwd`\" \
175 -DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \
176 -DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \
177 -DINSTDIR_PATH=\"$(prefix)\" \
178 -DLIBDIR_PATH=\"$(libdir)\"
179
180 ifeq (,$(CXX))
181 LINKS_DSO_PROGRAM = links-dso-program-c
182 else
183 LINKS_DSO_PROGRAM = links-dso-program
184 LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind)
185 endif
186
187 LDLIBS-test-container = $(libsupport)
188
189 others += test-container
190 others-noinstall += test-container
191
192 others += shell-container echo-container true-container
193 others-noinstall += shell-container echo-container true-container
194
195 others += $(LINKS_DSO_PROGRAM)
196 others-noinstall += $(LINKS_DSO_PROGRAM)
197
198 $(objpfx)test-container : $(libsupport)
199 $(objpfx)shell-container : $(libsupport)
200 $(objpfx)echo-container : $(libsupport)
201 $(objpfx)true-container : $(libsupport)
202
203 tests = \
204 README-testing \
205 tst-support-namespace \
206 tst-support_blob_repeat \
207 tst-support_capture_subprocess \
208 tst-support_descriptors \
209 tst-support_format_dns_packet \
210 tst-support_quote_blob \
211 tst-support_quote_string \
212 tst-support_record_failure \
213 tst-test_compare \
214 tst-test_compare_blob \
215 tst-test_compare_string \
216 tst-xreadlink \
217 tst-xsigstack \
218
219 ifeq ($(run-built-tests),yes)
220 tests-special = \
221 $(objpfx)tst-support_record_failure-2.out
222
223 $(objpfx)tst-support_record_failure-2.out: tst-support_record_failure-2.sh \
224 $(objpfx)tst-support_record_failure
225 $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
226 '$(run-program-env)' '$(test-program-prefix-after-env)' \
227 > $@; \
228 $(evaluate-test)
229 endif
230
231 $(objpfx)tst-support_format_dns_packet: $(common-objpfx)resolv/libresolv.so
232
233 tst-support_capture_subprocess-ARGS = -- $(host-test-program-cmd)
234
235 include ../Rules