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