Changeset View
Standalone View
share/mk/bsd.lib.mk
# from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 | # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
# | # | ||||
.include <bsd.init.mk> | .include <bsd.init.mk> | ||||
.include <bsd.compiler.mk> | .include <bsd.compiler.mk> | ||||
.include <bsd.linker.mk> | .include <bsd.linker.mk> | ||||
__<bsd.lib.mk>__: | |||||
kib: What does this mean, and what it does? | |||||
Done Inline ActionsThis just creates an empty target so that bsd.sanitizer.mk can check whether it was included from bsd.lib.mk or bsd.prog.mk. Other makefiles use this pattern as an "include guard". arichardson: This just creates an empty target so that bsd.sanitizer.mk can check whether it was included… | |||||
.if defined(LIB_CXX) || defined(SHLIB_CXX) | .if defined(LIB_CXX) || defined(SHLIB_CXX) | ||||
_LD= ${CXX} | _LD= ${CXX} | ||||
.else | .else | ||||
_LD= ${CC} | _LD= ${CC} | ||||
.endif | .endif | ||||
.if defined(LIB_CXX) | .if defined(LIB_CXX) | ||||
LIB= ${LIB_CXX} | LIB= ${LIB_CXX} | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
.if ${COMPILER_FEATURES:Minit-all} | .if ${COMPILER_FEATURES:Minit-all} | ||||
CFLAGS+= -ftrivial-auto-var-init=pattern | CFLAGS+= -ftrivial-auto-var-init=pattern | ||||
CXXFLAGS+= -ftrivial-auto-var-init=pattern | CXXFLAGS+= -ftrivial-auto-var-init=pattern | ||||
.else | .else | ||||
.warning InitAll (pattern) requested but not support by compiler | .warning InitAll (pattern) requested but not support by compiler | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.include "bsd.sanitizer.mk" | |||||
.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ | .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ | ||||
empty(DEBUG_FLAGS:M-gdwarf*) | empty(DEBUG_FLAGS:M-gdwarf*) | ||||
CFLAGS+= ${DEBUG_FILES_CFLAGS} | CFLAGS+= ${DEBUG_FILES_CFLAGS} | ||||
CXXFLAGS+= ${DEBUG_FILES_CFLAGS} | CXXFLAGS+= ${DEBUG_FILES_CFLAGS} | ||||
CTFFLAGS+= -g | CTFFLAGS+= -g | ||||
.endif | .endif | ||||
# clang currently defaults to dynamic TLS for mips64 object files without -fPIC | # clang currently defaults to dynamic TLS for mips64 object files without -fPIC | ||||
Show All 25 Lines | .c.po: | ||||
${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ||||
${CTFCONVERT_CMD} | ${CTFCONVERT_CMD} | ||||
.c.pico: | .c.pico: | ||||
${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ||||
${CTFCONVERT_CMD} | ${CTFCONVERT_CMD} | ||||
.c.nossppico: | .c.nossppico: | ||||
${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS:C/^-fstack-protector.*$//} ${CFLAGS:C/^-fstack-protector.*$//} -c ${.IMPSRC} -o ${.TARGET} | ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS:C/^-fstack-protector.*$//:C/^-fsanitize.*$//} ${CFLAGS:C/^-fstack-protector.*$//:C/^-fsanitize.*$//} -c ${.IMPSRC} -o ${.TARGET} | ||||
Done Inline ActionsWhat does this mean? Are you hacking on the SHARED_CFLAGS value, removing -fstack-protector when sanitizers are enabled? Can it be done clean, for instance by not adding -fstack-protector at all to the variable? If my guess is right, such fight over the options should not be done. kib: What does this mean?
Are you hacking on the SHARED_CFLAGS value, removing -fstack-protector… | |||||
Done Inline ActionsThis is here to ensure that the .nosspico files don't have sanitizer instrumentation since they are used by RTLD. arichardson: This is here to ensure that the .nosspico files don't have sanitizer instrumentation since they… | |||||
Done Inline ActionsBut we explicitly disable instrumentation for rtld, so this change is just for safety? I believe rtld is the only place where we generate this flavour of object files. markj: But we explicitly disable instrumentation for rtld, so this change is just for safety? I… | |||||
Done Inline ActionsRTLD pulls in some of these files from libc (and libc is built with ASAN instrumentation), so unless we remove -fsanitize=address from build command for the .nosspico files, rtld will end up using some object files that call __asan_foo functions. arichardson: RTLD pulls in some of these files from libc (and libc is built with ASAN instrumentation), so… | |||||
Done Inline ActionsAh, I didn't realize that the rtld-libc build reuses libc object files. You might consider amending the description of .nossppico files in share/mk/bsd.README then. markj: Ah, I didn't realize that the rtld-libc build reuses libc object files.
You might consider… | |||||
${CTFCONVERT_CMD} | ${CTFCONVERT_CMD} | ||||
.c.pieo: | .c.pieo: | ||||
${CC} ${PIEFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ${CC} ${PIEFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ||||
${CTFCONVERT_CMD} | ${CTFCONVERT_CMD} | ||||
.cc.po .C.po .cpp.po .cxx.po: | .cc.po .C.po .cpp.po .cxx.po: | ||||
${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ||||
.cc.pico .C.pico .cpp.pico .cxx.pico: | .cc.pico .C.pico .cpp.pico .cxx.pico: | ||||
${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ||||
.cc.nossppico .C.nossppico .cpp.nossppico .cxx.nossppico: | .cc.nossppico .C.nossppico .cpp.nossppico .cxx.nossppico: | ||||
${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS:C/^-fstack-protector.*$//} ${CXXFLAGS:C/^-fstack-protector.*$//} -c ${.IMPSRC} -o ${.TARGET} | ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS:C/^-fstack-protector.*$//:C/^-fsanitize.*$//} ${CXXFLAGS:C/^-fstack-protector.*$//:C/^-fsanitize.*$//} -c ${.IMPSRC} -o ${.TARGET} | ||||
.cc.pieo .C.pieo .cpp.pieo .cxx.pieo: | .cc.pieo .C.pieo .cpp.pieo .cxx.pieo: | ||||
${CXX} ${PIEFLAG} ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ${CXX} ${PIEFLAG} ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} | ||||
.f.po: | .f.po: | ||||
${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} | ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} | ||||
${CTFCONVERT_CMD} | ${CTFCONVERT_CMD} | ||||
▲ Show 20 Lines • Show All 411 Lines • Show Last 20 Lines |
What does this mean, and what it does?