public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Cc: Nicolas Schier <nsc@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Abel Vesa <abelvesa@kernel.org>, Mingcong Bai <jeffbai@aosc.io>,
	WangYuli <wangyuli@uniontech.com>,
	Inochi Amaoto <inochiama@gmail.com>,
	James Le Cuirot <chewi@gentoo.org>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Icenowy Zheng <uwu@icenowy.me>, Rong Zhang <i@rong.moe>,
	Rob Herring <robh@kernel.org>,
	Saravana Kannan <saravanak@kernel.org>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH] kbuild: install-extmod-build: do not exclude scripts/dtc/libfdt/
Date: Tue, 3 Feb 2026 19:16:03 -0700	[thread overview]
Message-ID: <20260204021603.GA2646832@ax162> (raw)
In-Reply-To: <20260201130259.2906768-1-zhengxingda@iscas.ac.cn>

+ 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@iscas.ac.cn>

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?

> ---
>  scripts/package/install-extmod-build | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/package/install-extmod-build b/scripts/package/install-extmod-build
> index 2576cf7902dbb..d1e448d7f59f6 100755
> --- a/scripts/package/install-extmod-build
> +++ b/scripts/package/install-extmod-build
> @@ -11,7 +11,8 @@ is_enabled() {
>  
>  find_in_scripts() {
>  	find scripts \
> -		\( -name atomic -o -name dtc -o -name kconfig -o -name package \) -prune -o \
> +		\( -name atomic -o -name kconfig -o -name package -o \
> +		   \( -path '*/dtc/*' -a ! -path '*/libfdt*' \) \) -prune -o \
>  		! -name unifdef -a ! -name mk_elfconfig -a \( -type f -o -type l \) -print
>  }
>  
> -- 
> 2.52.0
> 

       reply	other threads:[~2026-02-04  2:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260201130259.2906768-1-zhengxingda@iscas.ac.cn>
2026-02-04  2:16 ` Nathan Chancellor [this message]
2026-02-04  2:56   ` [PATCH] kbuild: install-extmod-build: do not exclude scripts/dtc/libfdt/ Rob Herring
2026-02-04  3:26   ` Icenowy Zheng
2026-02-04  3:27     ` Icenowy Zheng
2026-02-04  8:45       ` Nathan Chancellor
2026-02-04  8:46         ` Nathan Chancellor
2026-02-04 13:31         ` Rob Herring
2026-02-04 18:13           ` Nathan Chancellor
2026-02-05  8:22         ` Icenowy Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260204021603.GA2646832@ax162 \
    --to=nathan@kernel.org \
    --cc=abelvesa@kernel.org \
    --cc=chewi@gentoo.org \
    --cc=devicetree@vger.kernel.org \
    --cc=i@rong.moe \
    --cc=inochiama@gmail.com \
    --cc=jeffbai@aosc.io \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nsc@kernel.org \
    --cc=robh@kernel.org \
    --cc=saravanak@kernel.org \
    --cc=uwu@icenowy.me \
    --cc=wangyuli@uniontech.com \
    --cc=zhengxingda@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox