From owner-svn-src-head@freebsd.org Mon Nov 9 23:37:06 2015 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 11A29A2AB8A; Mon, 9 Nov 2015 23:37:06 +0000 (UTC) (envelope-from bdrewery@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 DFA9C1626; Mon, 9 Nov 2015 23:37:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA9Nb4O6086185; Mon, 9 Nov 2015 23:37:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9Nb4DL086183; Mon, 9 Nov 2015 23:37:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511092337.tA9Nb4DL086183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 9 Nov 2015 23:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290629 - head/share/mk X-SVN-Group: head 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.20 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: Mon, 09 Nov 2015 23:37:06 -0000 Author: bdrewery Date: Mon Nov 9 23:37:04 2015 New Revision: 290629 URL: https://svnweb.freebsd.org/changeset/base/290629 Log: FAST_DEPEND: Fix building of wrong source files in some cases. Similar to the original reason for these dependency hints to be added, in r124637, the missing-dependency file case can lead to building of the wrong source. A clear example of this is in gnu/lib/libstdc++ where the .PATH contains both contrib/gcc and contrib/libstdc++/src. contrib/gcc has a debug.c. contrib/libstdc++/src has a debug.cc. When building for the objects of debug.o, debug.So, and debug.po, it is ambiguous for which src file to use due to the suffix transformation rules, even though the proper one is listed first in .PATH. This was normally avoided due to these dependency hints for the initial build, and then mkdep would add an explicit 'debug.o: debug.cc' dependency into the .depend file. WITH_FAST_DEPEND does not generate the .depend file with these, but puts them into .depend.debug.o instead. Rather than extending the exists() check to each object's .depend.* file, just enable the hint when when using WITH_FAST_DEPEND. It fixes the problem and seems to be safe enough to use since it is mapping SRCS back to OBJS, rather than letting make make assumptions from OBJS to SRCS. A similar check mapping objects to headers is present in some mk files but was not extended here for FAST_DEPEND since it has not yet been found to be a problem. X-MFC-With: r290433 MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Nov 9 23:37:01 2015 (r290628) +++ head/share/mk/bsd.dep.mk Mon Nov 9 23:37:04 2015 (r290629) @@ -88,7 +88,7 @@ tags: ${SRCS} .if defined(SRCS) CLEANFILES?= -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .for _S in ${SRCS:N*.[dhly]} ${_S:R}.o: ${_S} .endfor @@ -99,7 +99,7 @@ ${_S:R}.o: ${_S} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) ${_LC:R}.o: ${_LC} .endif SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} @@ -130,7 +130,7 @@ CLEANFILES+= ${_YH} ${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) ${_YC:R}.o: ${_YC} .endif .endfor Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Mon Nov 9 23:37:01 2015 (r290628) +++ head/share/mk/bsd.lib.mk Mon Nov 9 23:37:04 2015 (r290629) @@ -417,9 +417,11 @@ lint: ${SRCS:M*.c} .include -.if !exists(${.OBJDIR}/${DEPENDFILE}) +.if ${MK_FAST_DEPEND} == "yes" || !exists(${.OBJDIR}/${DEPENDFILE}) .if defined(LIB) && !empty(LIB) +.if ${MK_FAST_DEPEND} == "no" ${OBJS} ${STATICOBJS} ${POBJS}: ${SRCS:M*.h} +.endif .for _S in ${SRCS:N*.[hly]} ${_S:R}.po: ${_S} .endfor