Re: [PATCH] kbuild: install-extmod-build: do not exclude scripts/dtc/libfdt/

From: Rob Herring

Date: Tue Feb 03 2026 - 21:57:48 EST


On Tue, Feb 3, 2026 at 8:16 PM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> + Rob, Saravana, and devicetree@ since this concerns files they own.
>
> On Sun, Feb 01, 2026 at 09:02:59PM +0800, Icenowy Zheng wrote:
> > There exists a header file in include/linux/ called libfdt.h that is
> > just a wrapper for libfdt header file in scripts/dtc/libfdt/. This makes
> > the headers inside libfdt copy at scripts/dtc/libfdt/ part of the kernel
> > headers for building external modules.
> >
> > Do not exclude them, otherwise modules that include <linux/libfdt.h>
> > will fail to build externally.
> >
> > Fixes: aaed5c7739be ("kbuild: slim down package for building external modules")
> > Signed-off-by: Icenowy Zheng <zhengxingda@xxxxxxxxxxx>
>
> This does indeed bring back scripts/dtc/libfdt back into the headers
> package that I examined. However, how does including libfdt.h in an
> external module actually work, even with this change? libfdt appears to
> be built into vmlinux IIUC and I do not see any EXPORT_SYMBOLs in the
> list, so how can you actually use any of the functions from libfdt
> within the module? Would you just build and link the pieces that your
> module needs using the other source files?

Right. Modules should not use libfdt functions.

Rob