Page MenuHomeFreeBSD

kmod.mk: Don't split out debug symbols if requested
ClosedPublic

Authored by cem on May 14 2020, 2:59 AM.

Details

Summary

Ports bsd.kmod.mk explicitly sets MK_KERNEL_SYMBOLS=no to prevent auto-
splitting of debuginfo from kernel modules. If that knob is set, don't
split out a .ko.debug and .ko from .ko.full; just generate a .ko with
debuginfo and leave it be.

Otherwise, with DEBUG_FLAGS set and MK_KERNEL_SYMBOLS=no, we would helpfully
strip out the debuginfo from the .ko.full and then not install it. That is
not the desired result a WITH_DEBUG port kmod build.

Test Plan

I just want WITH_DEBUG in ports to generate ports kmods with debuginfo. Either
embedded, or split. (I'd also like WITH_DEBUG not to delete -O optimization
flags, but that's another discussion.)

Before/after in build logs is pretty clear. With this change we don't create
foo.ko.full and split it into foo.ko/foo.ko.debug. Confirmed with readelf -S
and file(1) on various files in WRKDIR and staging.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

cem requested review of this revision.May 14 2020, 2:59 AM
cem created this revision.
emaste accepted this revision.Jun 23 2020, 12:42 PM

Seems reasonable to me, although I'd also argue that ports ought not set MK_KERNEL_SYMBOLS=no.

This revision is now accepted and ready to land.Jun 23 2020, 12:42 PM
cem added a comment.Jun 23 2020, 12:55 PM

Seems reasonable to me, although I'd also argue that ports ought not set MK_KERNEL_SYMBOLS=no.

I don’t disagree, but I think they have some reason not to just flip it. E.g., it complicates plists slightly. There are probably other considerations. Does symbol splitting work on 11, 12?

Anyway, it’s easier to change base.

Anyway, it’s easier to change base.

That's probably true, although the change in this review is correct/necessary regardless of what ports does.

I'm not certain but I think the standalone debug changes went into 10 even.

jhb accepted this revision.Jun 23 2020, 5:03 PM
This revision was automatically updated to reflect the committed changes.