6 LIBC_SRCTOP?= ${.CURDIR}/../libc
7 LIBSYS_SRCTOP?= ${.CURDIR}
9 # Pick the current architecture directory for libsys. In general, this is named
10 # MACHINE_CPUARCH, but some ABIs are different enough to require their own
11 # libsys, so allow a directory named MACHINE_ARCH to override this (though
12 # treat powerpc64le and powerpc64 the same).
13 # Note: This is copied from libc/Makefile
14 M=${MACHINE_ARCH:S/powerpc64le/powerpc64/}
15 .if exists(${LIBC_SRCTOP}/${M})
18 LIBC_ARCH=${MACHINE_CPUARCH}
26 INCS= libsys.h _libsys.h
28 CFLAGS+=-I${LIBSYS_SRCTOP}/include -I${LIBC_SRCTOP}/include
29 CFLAGS+=-I${LIBSYS_SRCTOP}/${LIBC_ARCH}
30 CFLAGS+=-I${LIBC_SRCTOP}/${LIBC_ARCH}
32 .PATH: ${LIBC_SRCTOP}/string
33 SRCS+= memcpy.c memset.c strlcpy.c
37 #XXX? BUILD_NOSSP_PIC_ARCHIVE=
40 # Use a more efficient TLS model for libc since we can reasonably assume that
41 # it will be loaded during program startup.
42 CFLAGS+= -ftls-model=initial-exec
45 # Link with static libcompiler_rt.a.
47 LDFLAGS+= -nodefaultlibs
48 LDFLAGS+= -Wl,-Bsymbolic
51 .if ${MK_SSP} != "no" && \
52 (${LIBC_ARCH} == "i386" || ${LIBC_ARCH:Mpowerpc*} != "")
53 LIBADD+= ssp_nonshared
56 # Define (empty) variables so that make doesn't give substitution
57 # errors if the included makefiles don't change these:
62 SYM_MAPS+= ${LIBSYS_SRCTOP}/Symbol.map
65 .include "${LIBSYS_SRCTOP}/Makefile.sys"
67 SYM_MAPS+= ${LIBSYS_SRCTOP}/Symbol.thr.map
68 .PATH: ${LIBSYS_SRCTOP}/${MACHINE_CPUARCH}
69 .sinclude "${LIBSYS_SRCTOP}/${MACHINE_CPUARCH}/Makefile.thr"
70 .if !${SRCS:M_umtx_op_err.S}
74 VERSION_DEF=${LIBC_SRCTOP}/Versions.def
75 SYMBOL_MAPS=${SYM_MAPS}