mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
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:
parent
21e10b16e0
commit
de6feefdb7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=322824
9
lib/clang/Makefile.inc
Normal file
9
lib/clang/Makefile.inc
Normal file
|
@ -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
|
|
@ -69,8 +69,8 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g}
|
|||
|
||||
.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
|
||||
empty(DEBUG_FLAGS:M-gdwarf*)
|
||||
SHARED_CFLAGS+= -g
|
||||
SHARED_CXXFLAGS+= -g
|
||||
CFLAGS+= ${DEBUG_FILES_CFLAGS}
|
||||
CXXFLAGS+= ${DEBUG_FILES_CFLAGS}
|
||||
CTFFLAGS+= -g
|
||||
.endif
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ CFLAGS+=${CRUNCH_CFLAGS}
|
|||
.else
|
||||
.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \
|
||||
empty(DEBUG_FLAGS:M-gdwarf-*)
|
||||
CFLAGS+= -g
|
||||
CFLAGS+= ${DEBUG_FILES_CFLAGS}
|
||||
CTFFLAGS+= -g
|
||||
.endif
|
||||
.endif
|
||||
|
|
|
@ -212,6 +212,10 @@ SSP_CFLAGS?= -fstack-protector
|
|||
CFLAGS+= ${SSP_CFLAGS}
|
||||
.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
|
||||
# specific flag overrides, unless we've overriden this...
|
||||
.if ${MK_WARNS} != "no"
|
||||
|
|
|
@ -2,4 +2,12 @@
|
|||
|
||||
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"
|
||||
|
|
Loading…
Reference in a new issue