From owner-dev-commits-src-all@freebsd.org Wed Jun 2 16:40:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A837E646E01; Wed, 2 Jun 2021 16:40:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FwFBH4Njrz3tSJ; Wed, 2 Jun 2021 16:40:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B2C31A26D; Wed, 2 Jun 2021 16:40:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 152Ge7ug056746; Wed, 2 Jun 2021 16:40:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 152Ge7pQ056744; Wed, 2 Jun 2021 16:40:07 GMT (envelope-from git) Date: Wed, 2 Jun 2021 16:40:07 GMT Message-Id: <202106021640.152Ge7pQ056744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e8dca53aa06e - main - kmod.mk: Allow extra objects to be specified in modules MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8dca53aa06ed7a06a83e666c4c303692f8fdbbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 16:40:07 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e8dca53aa06ed7a06a83e666c4c303692f8fdbbe commit e8dca53aa06ed7a06a83e666c4c303692f8fdbbe Author: Warner Losh AuthorDate: 2021-06-02 16:35:01 +0000 Commit: Warner Losh CommitDate: 2021-06-02 16:39:58 +0000 kmod.mk: Allow extra objects to be specified in modules OBJS are automatically added to CLEANFILES. For pre-built objects, this is not desirable since it will delete the object from the source tree. Introduce EXTRA_OBJS which list these object files, but aren't added to clean files. Sponsored by: Netflix Reviewed by: emaste@ Differential Revision: https://reviews.freebsd.org/D30615 --- sys/conf/kmod.mk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index c0d4441af029..c0ad352bf625 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -44,10 +44,12 @@ # # DESTDIR The tree where the module gets installed. [not set] # -# KERNBUILDDIR -# Set to the location of the kernel build directory where +# KERNBUILDDIR Set to the location of the kernel build directory where # the opt_*.h files, .o's and kernel winds up. # +# BLOB_OBJS Prebuilt binary blobs .o's from the src tree to be linked into +# the module. These are precious and not removed in make clean. +# # +++ targets +++ # # install: @@ -241,14 +243,14 @@ LDSCRIPT_FLAGS?= -T ${SYSDIR}/conf/ldscript.kmod.${MACHINE_ARCH} .endif .if ${__KLD_SHARED} == yes -${KMOD}.kld: ${OBJS} +${KMOD}.kld: ${OBJS} ${BLOB_OBJS} .else -${FULLPROG}: ${OBJS} +${FULLPROG}: ${OBJS} ${BLOB_OBJS} .endif ${LD} -m ${LD_EMULATION} ${_LDFLAGS} ${LDSCRIPT_FLAGS} -r -d \ - -o ${.TARGET} ${OBJS} + -o ${.TARGET} ${OBJS} ${BLOB_OBJS} .if ${MK_CTF} != "no" - ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} + ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} ${BLOB_OBJS} .endif .if defined(EXPORT_SYMS) .if ${EXPORT_SYMS} != YES