From owner-svn-src-head@freebsd.org Wed Oct 18 00:33:22 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 28A7EE4BBC7; Wed, 18 Oct 2017 00:33:22 +0000 (UTC) (envelope-from jonathan@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 03D3E6401D; Wed, 18 Oct 2017 00:33:21 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9I0XLEf030089; Wed, 18 Oct 2017 00:33:21 GMT (envelope-from jonathan@FreeBSD.org) Received: (from jonathan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9I0XLIw030087; Wed, 18 Oct 2017 00:33:21 GMT (envelope-from jonathan@FreeBSD.org) Message-Id: <201710180033.v9I0XLIw030087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jonathan set sender to jonathan@FreeBSD.org using -f From: Jonathan Anderson Date: Wed, 18 Oct 2017 00:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324712 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jonathan X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 324712 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, 18 Oct 2017 00:33:22 -0000 Author: jonathan Date: Wed Oct 18 00:33:20 2017 New Revision: 324712 URL: https://svnweb.freebsd.org/changeset/base/324712 Log: Improve computation of {BC,LL}OBJS. Now that OBJS has grown an OBJS_SRCS_FILTER variable, use this variable in the computation of BCOBJS and LLOBJS too. Also move BCOBJS and LLOBJS computation to be next to the OBJS computation: this should both make the parallel structure clearer and serve to remind people changing OBJS that parallel changes are required in BCOBJS and LLOBJS. A side effect of this change is that BCOBJS and LLOBJS will be available even when LLVM_LINK has not been defined, but that seems like a positive change: there's no reason we can't ask "what bitcode files would you generate" just because we can't link those files together into a complete bitcode representation of a binary or library. Reviewed by: sjg Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12701 Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Oct 18 00:30:15 2017 (r324711) +++ head/share/mk/bsd.lib.mk Wed Oct 18 00:33:20 2017 (r324712) @@ -169,7 +169,9 @@ LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/} -CLEANFILES+= ${OBJS} ${STATICOBJS} +BCOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g} +LLOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g} +CLEANFILES+= ${OBJS} ${BCOBJS} ${LLOBJS} ${STATICOBJS} .endif .if defined(LIB) && !empty(LIB) @@ -200,10 +202,6 @@ lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} .endif .if defined(LLVM_LINK) -BCOBJS= ${OBJS:.o=.bco} ${STATICOBJS:.o=.bco} -LLOBJS= ${OBJS:.o=.llo} ${STATICOBJS:.o=.llo} -CLEANFILES+= ${BCOBJS} ${LLOBJS} - lib${LIB_PRIVATE}${LIB}.bc: ${BCOBJS} ${LLVM_LINK} -o ${.TARGET} ${BCOBJS} Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Oct 18 00:30:15 2017 (r324711) +++ head/share/mk/bsd.prog.mk Wed Oct 18 00:33:20 2017 (r324712) @@ -87,6 +87,10 @@ PROGNAME?= ${PROG} OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/g} +# LLVM bitcode / textual IR representations of the program +BCOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g} +LLOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g} + .if target(beforelinking) beforelinking: ${OBJS} ${PROG_FULL}: beforelinking @@ -117,7 +121,10 @@ SRCS= ${PROG}.c # - the name of the object gets put into the executable symbol table instead of # the name of a variable temporary object. # - it's useful to keep objects around for crunching. -OBJS+= ${PROG}.o +OBJS+= ${PROG}.o +BCOBJS+= ${PROG}.bc +LLOBJS+= ${PROG}.ll +CLEANFILES+= ${PROG}.o ${PROG}.bc ${PROG}.ll .if target(beforelinking) beforelinking: ${OBJS} @@ -148,10 +155,6 @@ ${PROGNAME}.debug: ${PROG_FULL} .endif .if defined(LLVM_LINK) -# LLVM bitcode / textual IR representations of the program -BCOBJS= ${OBJS:.o=.bco} -LLOBJS= ${OBJS:.o=.llo} - ${PROG_FULL}.bc: ${BCOBJS} ${LLVM_LINK} -o ${.TARGET} ${BCOBJS}