From owner-svn-src-all@FreeBSD.ORG Sun Mar 24 20:18:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F337536; Sun, 24 Mar 2013 20:18:42 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ia0-x22b.google.com (mail-ia0-x22b.google.com [IPv6:2607:f8b0:4001:c02::22b]) by mx1.freebsd.org (Postfix) with ESMTP id 27265283; Sun, 24 Mar 2013 20:18:42 +0000 (UTC) Received: by mail-ia0-f171.google.com with SMTP id z13so4976883iaz.2 for ; Sun, 24 Mar 2013 13:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=d+Dm0x3yj4pV2Eur/IXn3+mKqk/D39kg1Z3iM/Nfmms=; b=AOIQpWBIvhB+atQQfNchg7RJtZoqydi75THi4oJbdQn9vWKV0Ww/FelrcY71G3a5w6 UxUywFnx59bMFQ1c/xxJeEoOCAd3y2IiZe9zQLl0uv61aKm1WRfn+4+eyWPLKABZ66Ff KBcknIQzJiardx7cIt5x6m0lzwGqtedkK+ZfZiA84J7tJU+yHrphTILe5abInFbv9bcQ G0muB78Guqumj14P35Fl2WvUopq3TN0a/x0JrmemeR+lb87rMCOyhi7gVeWccJg4BMVc rCGLXmawuzZOKyflSEURd8a8p+sda/cAqNaT7xaehIrzRY/987qlukHiKYgX++bccTo2 VSgQ== X-Received: by 10.50.153.198 with SMTP id vi6mr9752745igb.112.1364156321863; Sun, 24 Mar 2013 13:18:41 -0700 (PDT) Received: from oddish ([66.11.160.25]) by mx.google.com with ESMTPS id xc3sm16910397igb.10.2013.03.24.13.18.39 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 24 Mar 2013 13:18:41 -0700 (PDT) Sender: Mark Johnston Date: Sun, 24 Mar 2013 16:18:30 -0400 From: Mark Johnston To: Gleb Kurtsou Subject: Re: svn commit: r244915 - head/share/mk Message-ID: <20130324201830.GA1682@oddish> References: <201212312154.qBVLsh4v014794@svn.freebsd.org> <20130324184756.GA3874@reks> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130324184756.GA3874@reks> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Mar 2013 20:18:42 -0000 On Sun, Mar 24, 2013 at 11:47:57AM -0700, Gleb Kurtsou wrote: > On (31/12/2012 21:54), Mark Johnston wrote: > > Author: markj > > Date: Mon Dec 31 21:54:43 2012 > > New Revision: 244915 > > URL: http://svnweb.freebsd.org/changeset/base/244915 > > > > Log: > > Explicitly specify that the beforelinking target depends on the > > generated object files, ensuring that the beforelinking recipe won't be > > executed until compilation has finished. > > > > Also define SHLIB_NAME_FULL to denote ${SHLIB_NAME}.debug if > > DEBUG_FILES is set and ${SHLIB_NAME} otherwise, which helps avoid > > obfuscating the compilation and linking rules. > > Shouldn't ${SHLIB_NAME}.debug and ${SHLIB_NAME}.symbols be added to > CLEANFILES? > > Thanks, > Gleb. Yes, I think you're right. Most of the time it doesn't matter since bsd.lib.mk runs "rm -rf lib${LIB}.so.*" when running make clean. But if a library makefile overrides SHLIB_NAME and sets it to something that doesn't have "lib${LIB}.so." as a prefix, make clean won't remove the .debug and .symbols files. I see one example of this in the tree - sys/boot/userboot/userboot. Is that how you noticed this? I'm still testing the patch below, but I think it should fix the problem. Thanks, -Mark diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 3664210..38c8de3 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -202,6 +202,7 @@ ${SHLIB_NAME_FULL}: ${SOBJS} .endif .if defined(DEBUG_FLAGS) +CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.symbols ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.symbols ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.symbols \ ${SHLIB_NAME_FULL} ${.TARGET} @@ -209,7 +210,7 @@ ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.symbols ${SHLIB_NAME}.symbols: ${SHLIB_NAME_FULL} ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} .endif -.endif +.endif #defined(SHLIB_NAME) .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" _LIBS+= lib${LIB}_pic.a @@ -398,10 +399,7 @@ clean: .endif rm -f ${SHLIB_LINK} .endif -.if defined(LIB) && !empty(LIB) - rm -f lib${LIB}.so.* lib${LIB}.so -.endif -.endif +.endif # defined(SHLIB_NAME) .if defined(WANT_LINT) && defined(LIB) && !empty(LIB) rm -f ${LINTOBJS} .endif