Changeset View
Changeset View
Standalone View
Standalone View
share/mk/bsd.lib.mk
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | |||||
CFLAGS+= -mretpoline | CFLAGS+= -mretpoline | ||||
CXXFLAGS+= -mretpoline | CXXFLAGS+= -mretpoline | ||||
LDFLAGS+= -Wl,-zretpolineplt | LDFLAGS+= -Wl,-zretpolineplt | ||||
.else | .else | ||||
.warning Retpoline requested but not supported by compiler or linker | .warning Retpoline requested but not supported by compiler or linker | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.if ${MK_BUILD_ID} != "no" && empty(LDFLAGS:M*build-id*) | |||||
jhb: The `empty` test is because stand/i386/Makefile.inc has a 'build-id=none' for `LDFLAGS_BIN`. | |||||
LDFLAGS+= -Wl,--build-id=sha1 | |||||
bdreweryUnsubmitted Not Done Inline ActionsI think this should be something like ${BUILD_ID_METHOD:Usha1} instead of hardcoded. bdrewery: I think this should be something like `${BUILD_ID_METHOD:Usha1}` instead of hardcoded. | |||||
jhbAuthorUnsubmitted Done Inline ActionsI only did that because we already hardcode it in the kernel build. See my comment above about having some kind of variable to set the method, and perhaps setting it to 'none' in the various boot Makefiles. jhb: I only did that because we already hardcode it in the kernel build. See my comment above about… | |||||
.endif | |||||
.if ${MK_GDB_INDEX} != "no" | |||||
LDFLAGS+= -Wl,--gdb-index | |||||
.endif | |||||
.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 20 Lines • Show All 445 Lines • Show Last 20 Lines |
The empty test is because stand/i386/Makefile.inc has a 'build-id=none' for LDFLAGS_BIN. Another approach might be to instead support a BUILD_ID variable that gets set to the type of ID to use and let the stand/i386 Makefiles set that to none and have it default to sha1. This would permit changing it to something else more easily if desired. Not quite sure where that would live though. In that case we would always add the flag when the linker supported it, and the control knobs would just be to set it to "none" vs something else. I think it is probably fairly low risk to have build_id always enabled anyway if the linker supports it.