2 # Copyright (C) 1994-2024 Free Software Foundation, Inc.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
27 libpthread-routines
:= \
30 pt-attr-getguardsize \
33 pt-attr-getstackaddr \
34 pt-attr-getstacksize \
36 pt-attr-setguardsize \
37 pt-attr-setschedparam \
40 pt-attr-setstackaddr \
41 pt-attr-setstacksize \
46 pt-barrierattr-destroy \
48 pt-barrierattr-getpshared \
49 pt-barrierattr-setpshared \
72 pt-mutexattr-destroy \
74 pt-mutexattr-getprioceiling \
75 pt-mutexattr-getprotocol \
76 pt-mutexattr-getpshared \
77 pt-mutexattr-gettype \
78 pt-mutexattr-setprioceiling \
79 pt-mutexattr-setprotocol \
80 pt-mutexattr-setpshared \
81 pt-mutexattr-settype \
82 pt-mutexattr-getrobust \
83 pt-mutexattr-setrobust \
86 pt-mutex-checklocked \
91 pt-mutex-transfer-np \
92 pt-mutex-getprioceiling \
93 pt-mutex-setprioceiling \
97 pt-rwlockattr-destroy \
98 pt-rwlockattr-getpshared \
99 pt-rwlockattr-setpshared \
103 pt-rwlock-tryrdlock \
104 pt-rwlock-trywrlock \
106 pt-rwlock-timedrdlock \
107 pt-rwlock-timedwrlock \
111 pt-condattr-destroy \
112 pt-condattr-getclock \
113 pt-condattr-getpshared \
114 pt-condattr-setclock \
115 pt-condattr-setpshared \
123 pt-hurd-cond-timedwait \
127 pt-thread-terminate \
142 pt-sigstate-destroy \
170 bits
/pthreadtypes-arch.h \
171 bits
/pthreadtypes.h \
173 bits
/spin-lock-inline.h \
174 bits
/thread-shared-types.h \
175 bits
/types
/__pthread_key.h \
176 bits
/types
/__pthread_spinlock_t.h \
177 bits
/types
/__pthread_t.h \
178 bits
/types
/__thrd_t.h \
179 bits
/types
/struct___pthread_attr.h \
180 bits
/types
/struct___pthread_barrier.h \
181 bits
/types
/struct___pthread_barrierattr.h \
182 bits
/types
/struct___pthread_cond.h \
183 bits
/types
/struct___pthread_condattr.h \
184 bits
/types
/struct___pthread_mutex.h \
185 bits
/types
/struct___pthread_mutexattr.h \
186 bits
/types
/struct___pthread_once.h \
187 bits
/types
/struct___pthread_rwlock.h \
188 bits
/types
/struct___pthread_rwlockattr.h \
200 pt-attr-getdetachstate \
201 pt-attr-getinheritsched \
202 pt-attr-getschedparam \
203 pt-attr-getschedpolicy \
204 pt-attr-setdetachstate \
205 pt-attr-setinheritsched \
206 pt-attr-setschedpolicy \
213 shared-only-routines
= forward
215 extra-libs
:= libpthread
216 extra-libs-others
:= $(extra-libs
)
217 install-lib
:= libpthread.so
218 install-lib-ldscripts
:= libpthread_syms.a
220 include ..
/Makeconfig
222 CFLAGS-lockfile.c
= -D_IO_MTSAFE_IO
224 all: # Make this the default target; it will be defined in Rules.
226 subdir_install
: $(inst_libdir
)/libpthread2.a
$(inst_libdir
)/libpthread_syms.a
228 # XXX: If $(inst_libdir)/libpthread2.a is installed and
229 # $(inst_libdir)/libpthread is not, we can have some issues.
230 .PHONY
: $(inst_libdir
)/libpthread.a
$(inst_libdir
)/libpthread_pic.a
232 # XXX: These rules are a hack. But it is better than messing with
233 # ../Makeconf at the moment. Note that the linker scripts
234 # $(srcdir)/libpthread.a and $(srcdir)/libpthread_pic.a get overwritten
235 # when building in $(srcdir) and not a separate build directory.
236 $(inst_libdir
)/libpthread2.a
: $(inst_libdir
)/libpthread.a
238 $(INSTALL_DATA
) $(srcdir)/libpthread.a
$<
240 $(inst_libdir
)/libpthread2_pic.a
: $(inst_libdir
)/libpthread_pic.a
242 $(INSTALL_DATA
) $(srcdir)/libpthread_pic.a
$<
244 $(inst_libdir
)/libpthread_syms.a
: $(srcdir)/libpthread_syms.a
$(+force)
247 libc-link.so
= $(common-objpfx
)libc.so
249 extra-B-pthread.so
= -B
$(common-objpfx
)htl
/
250 LDFLAGS-pthread.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
,-z
,initfirst
254 # Make sure we link with the thread library.
255 ifeq ($(build-shared
),yes
)
256 $(addprefix $(objpfx
), \
257 $(filter-out $(tests-static
) $(xtests-static
) $(tests-reverse
) \
258 $(tests-nolibpthread
), \
259 $(tests
) $(tests-internal
) $(xtests
) $(test-srcs
) $(tests-container
))): \
260 $(objpfx
)libpthread.so
261 # $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
262 # since otherwise libpthread.so comes before libc.so when linking.
263 $(addprefix $(objpfx
), $(tests-reverse
)): \
264 $(objpfx
)..
/libc.so
$(objpfx
)libpthread.so
265 $(objpfx
)..
/libc.so
: $(common-objpfx
)libc.so
;
266 $(addprefix $(objpfx
),$(tests-static
) $(xtests-static
)): $(srcdir)/libpthread_syms.a
$(objpfx
)libpthread.a
268 $(addprefix $(objpfx
),$(tests
) $(test-srcs
)): $(srcdir)/libpthread_syms.a
$(objpfx
)libpthread.a