Improve the coverage of debug symbols for MK_DEBUG_FILES.
- Include debug symbols in static libraries. This permits binaries to include debug symbols for functions obtained from static libraries. - Permit the C/C++ compiler flags added for MK_DEBUG_FILES to be overridden by setting DEBUG_FILES_CFLAGS. Use this to limit the debug information for llvm libraries and binaries. Reviewed by: emaste Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D12025
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.include <bsd.compiler.mk>
|
||||||
|
|
||||||
|
.if ${COMPILER_TYPE} == "clang"
|
||||||
|
DEBUG_FILES_CFLAGS= -gline-tables-only
|
||||||
|
.else
|
||||||
|
DEBUG_FILES_CFLAGS= -g1
|
||||||
|
.endif
|
||||||
+2
-2
@@ -69,8 +69,8 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g}
|
|||||||
|
|
||||||
.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*)
|
||||||
SHARED_CFLAGS+= -g
|
CFLAGS+= ${DEBUG_FILES_CFLAGS}
|
||||||
SHARED_CXXFLAGS+= -g
|
CXXFLAGS+= ${DEBUG_FILES_CFLAGS}
|
||||||
CTFFLAGS+= -g
|
CTFFLAGS+= -g
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ CFLAGS+=${CRUNCH_CFLAGS}
|
|||||||
.else
|
.else
|
||||||
.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+= -g
|
CFLAGS+= ${DEBUG_FILES_CFLAGS}
|
||||||
CTFFLAGS+= -g
|
CTFFLAGS+= -g
|
||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
|
|||||||
@@ -212,6 +212,10 @@ SSP_CFLAGS?= -fstack-protector
|
|||||||
CFLAGS+= ${SSP_CFLAGS}
|
CFLAGS+= ${SSP_CFLAGS}
|
||||||
.endif # SSP && !ARM && !MIPS
|
.endif # SSP && !ARM && !MIPS
|
||||||
|
|
||||||
|
# Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is
|
||||||
|
# enabled.
|
||||||
|
DEBUG_FILES_CFLAGS?= -g
|
||||||
|
|
||||||
# Allow user-specified additional warning flags, plus compiler and file
|
# Allow user-specified additional warning flags, plus compiler and file
|
||||||
# specific flag overrides, unless we've overriden this...
|
# specific flag overrides, unless we've overriden this...
|
||||||
.if ${MK_WARNS} != "no"
|
.if ${MK_WARNS} != "no"
|
||||||
|
|||||||
@@ -2,4 +2,12 @@
|
|||||||
|
|
||||||
WARNS?= 0
|
WARNS?= 0
|
||||||
|
|
||||||
|
.include <bsd.compiler.mk>
|
||||||
|
|
||||||
|
.if ${COMPILER_TYPE} == "clang"
|
||||||
|
DEBUG_FILES_CFLAGS= -gline-tables-only
|
||||||
|
.else
|
||||||
|
DEBUG_FILES_CFLAGS= -g1
|
||||||
|
.endif
|
||||||
|
|
||||||
.include "../Makefile.inc"
|
.include "../Makefile.inc"
|
||||||
|
|||||||
Reference in New Issue
Block a user