[PATCH] kbuild: fix out-of-tree build missing gpio.h

Tom Rini trini at konsulko.com
Thu Jan 8 20:37:47 CET 2026


On Thu, Jan 08, 2026 at 07:40:27PM +0100, Casey Connolly wrote:

> When building out-of-tree $(srctree) is typically a relative path, the
> kbuild 6.1 sync uses it in more places where KBUILD_SRC was used leading
> to issues like this where we create broken symlinks.
> 
> Fix this by creating the symlink with an absolute path like the old
> behaviour.
> 
> Fixes: bd3f9ee679b4 ("kbuild: Bump the build system to 6.1")
> Signed-off-by: Casey Connolly <casey.connolly at linaro.org>
> ---
>  scripts/Makefile.autoconf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
> index e3c88badb529..522389e04e8c 100644
> --- a/scripts/Makefile.autoconf
> +++ b/scripts/Makefile.autoconf
> @@ -137,9 +137,9 @@ ifdef building_out_of_srctree
>  		dest=arch/$(ARCH)/mach-$(SOC)/include/mach;			\
>  	else									\
>  		dest=arch/$(ARCH)/include/asm/arch-$(if $(SOC),$(SOC),$(CPU));	\
>  	fi;									\
> -	ln -fsn $(srctree)/$$dest include/asm/arch
> +	ln -fsn $$(realpath $(srctree)/$$dest) include/asm/arch
>  else
>  	$(Q)if [ -d arch/$(ARCH)/mach-$(SOC)/include/mach ]; then	\
>  		dest=../../mach-$(SOC)/include/mach;			\
>  	else								\

I think this was resolved with:
commit 726d11289f2776098b6fcd99b413b590782a556d
Author: David Lechner <dlechner at baylibre.com>
Date:   Mon Jan 5 14:35:04 2026 -0600

    scripts/Makefile.autoconf: use abs_srctree for out-of-tree symlink
    
    Replace usage of $(srctree) with $(abs_srctree) when creating a symlink
    to include/asm/arch in out of tree builds.
    
    When building_out_of_srctree is true, $(srctree) is just "..", so the
    created symlink was broken, for example:
    
        build-mt8365_evk/include/asm/arch -> ../arch/arm/include/asm/arch-mediatek
    
    Which would resolve to a non-existent path:
    
        build-mt8365_evk/include/asm/arch/arm/include/asm/arch-mediatek
    
    To fix, we need to use the absolute path to the source tree since we
    don't know where the build tree is located relative to the source tree.
    
    Fixes: bd3f9ee679b4 ("kbuild: Bump the build system to 6.1")
    Signed-off-by: David Lechner <dlechner at baylibre.com>
    Tested-by: Sean Anderson <sean.anderson at linux.dev>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260108/1e5bd036/attachment.sig>


More information about the U-Boot mailing list