Date: Wed, 2 Jun 2021 16:40:07 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: e8dca53aa06e - main - kmod.mk: Allow extra objects to be specified in modules Message-ID: <202106021640.152Ge7pQ056744@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e8dca53aa06ed7a06a83e666c4c303692f8fdbbe commit e8dca53aa06ed7a06a83e666c4c303692f8fdbbe Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-06-02 16:35:01 +0000 Commit: Warner Losh <imp@FreeBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106021640.152Ge7pQ056744>