3 # All library objects contain FreeBSD revision strings by default; they may be
4 # excluded as a space-saving measure. To produce a library that does
5 # not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
11 .include <src.opts.mk>
17 NO_WCAST_ALIGN.gcc=1 # for gcc 4.2
18 CFLAGS+=-DPTHREAD_KERNEL
19 CFLAGS+=-I${SRCTOP}/lib/libc/include
20 CFLAGS+=-I${SRCTOP}/lib/libc/${MACHINE_CPUARCH}
21 CFLAGS+=-I${.CURDIR}/thread
22 CFLAGS+=-I${SRCTOP}/include
23 CFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include
24 CFLAGS+=-I${.CURDIR}/sys
25 CFLAGS+=-I${SRCTOP}/libexec/rtld-elf
26 CFLAGS+=-I${SRCTOP}/libexec/rtld-elf/${MACHINE_CPUARCH}
27 CFLAGS+=-I${SRCTOP}/lib/libthread_db
29 CFLAGS.thr_stack.c+= -Wno-cast-align
30 CFLAGS.rtld_malloc.c+= -Wno-cast-align
31 CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations
32 .if ${MK_ASAN} != "no"
33 # False-positive ASAN error claiming the local "struct sigaction act;" is
34 # overflowed by handle_signal() reading from the ucontext_t argument. This
35 # could be caused by ASAN not treating this function as a signal handler.
36 CFLAGS.thr_sig.c+= -fno-sanitize=address
39 .ifndef NO_THREAD_UNWIND_STACK
41 CFLAGS+=-D_PTHREAD_FORCED_UNWIND
44 LDFLAGS+=-Wl,-znodelete
46 VERSION_DEF=${SRCTOP}/lib/libc/Versions.def
47 SYMBOL_MAPS=${.CURDIR}/pthread.map
51 # enable extra internal consistency checks
52 CFLAGS+=-D_PTHREADS_INVARIANTS
56 .PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
57 .PATH: ${SRCTOP}/libexec/rtld-elf
59 .if exists(${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc)
60 .include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
62 .include "${.CURDIR}/sys/Makefile.inc"
63 .include "${.CURDIR}/thread/Makefile.inc"
66 .if ${MK_INSTALLLIB} != "no"
67 SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a
70 SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so
72 .if ${MK_PROFILE} != "no"
73 SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a
77 SUBDIR.${MK_TESTS}+= tests