Page MenuHomeFreeBSD

build: consolidate kldxref and move NO_XREF logic
AcceptedPublic

Authored by kevans on Apr 27 2026, 8:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 10, 5:39 AM
Unknown Object (File)
Tue, Sep 8, 8:30 AM
Unknown Object (File)
Fri, Sep 4, 10:02 PM
Unknown Object (File)
Fri, Sep 4, 8:10 PM
Unknown Object (File)
Fri, Sep 4, 9:13 AM
Unknown Object (File)
Thu, Sep 3, 8:31 AM
Unknown Object (File)
Wed, Sep 2, 10:08 PM
Unknown Object (File)
Wed, Sep 2, 9:27 AM
Subscribers
None

Details

Reviewers
jhb
jrtc27
imp
Summary

The current application of NO_XREF works fine for normal module builds,
but falls apart quickly for LOCAL_MODULES. In particular, trying to
LOCAL_MODULES in the drm-kmod-firmware modules will often blow up
spectacularly on install as kldxref(8) races against install(1) and the
latter fails horribly when it encounters a module that hasn't finished
installing yet (at its INS@ temporary-file name).

Re-organizing the kldxref logic into kern.mk is maybe a little unusual
for a file that doesn't have any other targets, but it makes enough
sense to consolidate the two occurrences into one shared between the
kmod and kernel build that I think it's fine to push boundaries here.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 72587
Build 69470: arc lint + arc unit

Event Timeline

kevans created this revision.

Left out of the message: I suspect nobody is trying a full sys/modules build outside of installkernel / install from the config(8) generated target, whichever workflow you prefer, so I don't think we're hanging anyone out to dry by sys/modules not doing this anymore

This revision is now accepted and ready to land.Apr 29 2026, 1:30 PM