From owner-svn-src-head@freebsd.org Tue Jun 14 16:19:45 2016 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 783B6B6A6EA; Tue, 14 Jun 2016 16:19:45 +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 2D15F2F5B; Tue, 14 Jun 2016 16:19:45 +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 u5EGJirS007972; Tue, 14 Jun 2016 16:19:44 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5EGJiKd007971; Tue, 14 Jun 2016 16:19:44 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606141619.u5EGJiKd007971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 14 Jun 2016 16:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301880 - 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.22 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: Tue, 14 Jun 2016 16:19:45 -0000 Author: bdrewery Date: Tue Jun 14 16:19:44 2016 New Revision: 301880 URL: https://svnweb.freebsd.org/changeset/base/301880 Log: WITH_META_MODE+WITH_DEBUG_FILES: Fix library symlinks causing bogus rebuilds. A simplified example of the library targets with WITH_DEBUG_FILES is: libgeom.so.5: libgeom.so.5.full cp libgeom.so.5.full libgeom.so.5 libgeom.so.5.full: ln -s libgeom.so.5 libgeom.so cc -o libgeom.so.5.full *.o Before, or without, WITH_DEBUG_FILES it is: libgeom.so.5: ln -s libgeom.so.5 libgeom.so cc -o libgeom.so.5 *.o The problem is that bmake considers the link source for the libgeom.so link in the libgeom.so.5.full target as being a dependency for libgeom.so.5.full. That resolves to libgeom.so.5. Thus a cyclic dependency is created. The result of this is that if libgeom.so.5 is created with a newer timestamp than libgeom.so.5.full, then libgeom.so.5.full will be rebuilt on the next build. This causes a chain reaction of everything in the build relinking, or hitting the problem itself. Moving the link creation to the target that actually creates libgeom.so.5 fixes the problem. The simplest fix here is to just duplicate the logic. Submitted by: sjg Approved by: re (implicit) Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Jun 14 14:03:28 2016 (r301879) +++ head/share/mk/bsd.lib.mk Tue Jun 14 16:19:44 2016 (r301880) @@ -244,7 +244,7 @@ CLEANFILES+= ${SHLIB_LINK} ${SHLIB_NAME_FULL}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} @rm -f ${SHLIB_NAME} ${SHLIB_LINK} -.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) +.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) && ${MK_DEBUG_FILES} == "no" @${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK} .endif ${_LD:N${CCACHE_BIN}} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \ @@ -259,6 +259,9 @@ CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_ ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ ${SHLIB_NAME_FULL} ${.TARGET} +.if defined(SHLIB_LINK) && !commands(${SHLIB_LINK:R}.ld) + @${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${SHLIB_NAME} ${SHLIB_LINK} +.endif ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET}