From owner-svn-src-head@freebsd.org Wed Aug 23 23:30:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD43DF0C8D; Wed, 23 Aug 2017 23:30:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B580135B; Wed, 23 Aug 2017 23:30:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7NNUQnN052281; Wed, 23 Aug 2017 23:30:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7NNUPpV052276; Wed, 23 Aug 2017 23:30:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201708232330.v7NNUPpV052276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 23 Aug 2017 23:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322824 - in head: lib/clang share/mk usr.bin/clang X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/clang share/mk usr.bin/clang X-SVN-Commit-Revision: 322824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Aug 2017 23:30:27 -0000 Author: jhb Date: Wed Aug 23 23:30:25 2017 New Revision: 322824 URL: https://svnweb.freebsd.org/changeset/base/322824 Log: 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 Added: head/lib/clang/Makefile.inc (contents, props changed) Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk head/share/mk/bsd.sys.mk head/usr.bin/clang/Makefile.inc Added: head/lib/clang/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/Makefile.inc Wed Aug 23 23:30:25 2017 (r322824) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +.if ${COMPILER_TYPE} == "clang" +DEBUG_FILES_CFLAGS= -gline-tables-only +.else +DEBUG_FILES_CFLAGS= -g1 +.endif Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Aug 23 21:49:56 2017 (r322823) +++ head/share/mk/bsd.lib.mk Wed Aug 23 23:30:25 2017 (r322824) @@ -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 Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Aug 23 21:49:56 2017 (r322823) +++ head/share/mk/bsd.prog.mk Wed Aug 23 23:30:25 2017 (r322824) @@ -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 Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Wed Aug 23 21:49:56 2017 (r322823) +++ head/share/mk/bsd.sys.mk Wed Aug 23 23:30:25 2017 (r322824) @@ -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" Modified: head/usr.bin/clang/Makefile.inc ============================================================================== --- head/usr.bin/clang/Makefile.inc Wed Aug 23 21:49:56 2017 (r322823) +++ head/usr.bin/clang/Makefile.inc Wed Aug 23 23:30:25 2017 (r322824) @@ -2,4 +2,12 @@ WARNS?= 0 +.include + +.if ${COMPILER_TYPE} == "clang" +DEBUG_FILES_CFLAGS= -gline-tables-only +.else +DEBUG_FILES_CFLAGS= -g1 +.endif + .include "../Makefile.inc"