Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Oct 2017 07:10:28 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r324294 - projects/runtime-coverage/share/mk
Message-ID:  <201710050710.v957ASgC004334@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Thu Oct  5 07:10:28 2017
New Revision: 324294
URL: https://svnweb.freebsd.org/changeset/base/324294

Log:
  Fix .gcda to .pico (bsd.lib.mk) and .o (bsd.prog.mk) dependency mapping
  
  The logic wasn't using a filtered version of SRCS -- it was using the
  unfiltered version. This was causing some hilarity with unnecessary
  dependencies, like headers and the like in lib/libc/... .
  
  Also use .pico with bsd.lib.mk, not .o -- .o doesn't use SHARED_C*FLAGS,
  which doesn't contain _COV_FLAG, which means that the .gcda's would have
  relied on objects that didn't build them as a side-effect.

Modified:
  projects/runtime-coverage/share/mk/bsd.cov.mk
  projects/runtime-coverage/share/mk/bsd.lib.mk
  projects/runtime-coverage/share/mk/bsd.prog.mk

Modified: projects/runtime-coverage/share/mk/bsd.cov.mk
==============================================================================
--- projects/runtime-coverage/share/mk/bsd.cov.mk	Thu Oct  5 06:54:25 2017	(r324293)
+++ projects/runtime-coverage/share/mk/bsd.cov.mk	Thu Oct  5 07:10:28 2017	(r324294)
@@ -19,7 +19,6 @@ FILESGROUPS+=	GCDAS
 CLEANFILES+=	${GCDAS}
 
 .for _gcda in ${GCDAS}
-${_gcda}: ${_gcda:R}.o
 GCDASDIR_${_gcda:T}=	${COVERAGEDIR}${_gcda:H:tA}
 .endfor
 .endif

Modified: projects/runtime-coverage/share/mk/bsd.lib.mk
==============================================================================
--- projects/runtime-coverage/share/mk/bsd.lib.mk	Thu Oct  5 06:54:25 2017	(r324293)
+++ projects/runtime-coverage/share/mk/bsd.lib.mk	Thu Oct  5 07:10:28 2017	(r324294)
@@ -75,7 +75,7 @@ CXXFLAGS+= ${DEBUG_FILES_CFLAGS}
 CTFFLAGS+= -g
 _WANTS_DEBUG=
 .endif
-.if ${MK_COVERAGE} != "no" && defined(_WANTS_DEBUG)
+.if ${MK_COVERAGE} != "no" && defined(_WANTS_DEBUG) && defined(SHLIB_NAME)
 _COV_FLAG= --coverage
 SHARED_CFLAGS+= ${_COV_FLAG}
 SHARED_CXXFLAGS+= ${_COV_FLAG}
@@ -460,8 +460,11 @@ _libinstall:
 .include <bsd.nls.mk>
 .if defined(_COV_FLAG)
 _GCDA_SRCS=	${SRCS:M*.c} ${SRCS:M*.cc} ${SRCS:M*.cpp} ${SRCS:M*.cxx} ${SRCS:M*.C}
-GCDAS=		${SRCS:R:S/$/.gcda/g}
+GCDAS=		${_GCDA_SRCS:R:S/$/.gcda/g}
 .undef _GCDA_SRCS
+.for _gcda in ${GCDAS}
+${_gcda}: ${_gcda:R}.pico
+.endfor
 .include <bsd.cov.mk>
 .endif
 .include <bsd.files.mk>

Modified: projects/runtime-coverage/share/mk/bsd.prog.mk
==============================================================================
--- projects/runtime-coverage/share/mk/bsd.prog.mk	Thu Oct  5 06:54:25 2017	(r324293)
+++ projects/runtime-coverage/share/mk/bsd.prog.mk	Thu Oct  5 07:10:28 2017	(r324294)
@@ -303,8 +303,11 @@ NLSNAME?=	${PROG}
 .include <bsd.confs.mk>
 .if defined(_COV_FLAG)
 _GCDA_SRCS=	${SRCS:M*.c} ${SRCS:M*.cc} ${SRCS:M*.cpp} ${SRCS:M*.cxx} ${SRCS:M*.C}
-GCDAS=		${SRCS:R:S/$/.gcda/g}
+GCDAS=		${_GCDA_SRCS:R:S/$/.gcda/g}
 .undef _GCDA_SRCS
+.for _gcda in ${GCDAS}
+${_gcda}: ${_gcda:R}.pico
+.endfor
 .include <bsd.cov.mk>
 .endif
 .include <bsd.files.mk>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710050710.v957ASgC004334>