[DTrace-devel] [PATCH v2 1/5] build: support kernel builds with or without object directory

Nick Alcock nick.alcock at oracle.com
Tue Nov 7 15:02:56 UTC 2023


On 7 Nov 2023, Kris Van Hees via DTrace-devel spake thusly:

> It should be possible to build DTrace against kernel headers provided in
> a variety of ways.  They can be provided as installed kernel header
> packages with combined or separated generated and standard headers, and
> linked from /lib/modules/<kernelv-version> or simply available as
> directory hierarchies elsewhere on the system.
>
> It should also be possible to build DTrace against kernel headers that
> are found in a locally built kernel, whether it is installed or not.
>
> This patch provides a cleanup for the build system to accomplish this
> with minimal configuration.

... why did I never think of this?

A couple of niggles:

> -# This allows you to build using a locally installed kernel built with O= by
> -# just specifying KERNELODIR=relative/path/to/your/kernel/o/dir.
> -KERNELDIRSUFFIX=$(if $(KERNELODIR),/source,/build)

This appears to have been lost: nothing arranges to use /source if
KERNELODIR is set, that I can see. (But it's been a long time, and maybe
this isn't needed any more, though it certainly was once. If
locally-installed builds with O= set and KERNELODIR= set to the same
value at DTrace build time work fine, then this works as well as it did
before.)

> +# $(objdir)/dlibs/$(shell printf %s $(1) | sed -e 's/^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$$/\1.\2.\3/')/%.d: override KERNELSRCDIR := $(if $(KERNELSRCDIR),$(KERNELSRCDIR),$(KERNELMODDIR)/$(1)/source)
> +# $(objdir)/dlibs/$(shell printf %s $(1) | sed -e 's/^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$$/\1.\2.\3/')/%.d: override KERNELOBJDIR := $(if $(KERNELOBJDIR),$(KERNELOBJDIR),$(KERNELMODDIR)/$(1)/build)
> +$(objdir)/dlibs/$(shell printf %s $(1) | sed -e 's/^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$$/\1.\2.\3/')/%.d: override KERNELSRCDIR ?= $(KERNELMODDIR)/$(1)/source
> +$(objdir)/dlibs/$(shell printf %s $(1) | sed -e 's/^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$$/\1.\2.\3/')/%.d: override KERNELOBJDIR ?= KERNELMODDIR)/$(1)/build

Um, there are some commented-out bits here. I guess that was unintended?



More information about the DTrace-devel mailing list