as-instr in Kbuild broken for arch/arm

Masahiro Yamada masahiroy at kernel.org
Tue Jun 17 19:37:24 PDT 2025


On Wed, Jun 18, 2025 at 5:04 AM Nathan Chancellor <nathan at kernel.org> wrote:
>
> Hi Masahiro,
>
> I backported commit d5c8d6e0fa61 ("kbuild: Update assembler calls to use
> proper flags and language target") to 5.4 due to an upstream clang
> change that necessitates this [1] but it causes a failure for as-instr
> with arm [2] because arch/arm/Makefile uses '-include asm/unified.h' for
> KBUILD_AFLAGS but LINUXINCLUDE is not present in the as-instr command,
> resulting in
>
>   <built-in>:1:10: fatal error: 'asm/unified.h' file not found
>       1 | #include "asm/unified.h"
>         |          ^~~~~~~~~~~~~~~
>   1 error generated.
>
> There does not appear to be any uses of as-instr within Kbuild (as
> opposed to Kconfig) for arch/arm after commit 541ad0150ca4 ("arm: Remove
> 32bit KVM host support") in 5.7 but as far as I can tell, it is still
> possible to hit this issue in upstream if one were to be added.
>
> I see two obvious solutions but I am not sure what you would prefer.

The latter because this is more consistent with the existing cases.

The answer is in LINUXINCLUDE itself.

                -include $(srctree)/include/linux/compiler-version.h \
                -include $(srctree)/include/linux/kconfig.h

If we include them in a relative path, we would do:

                -include linux/compiler-version.h \
                -include linux/kconfig.h


Apparently, we always did this in an absolute path.



-- 
Best Regards
Masahiro Yamada



More information about the linux-arm-kernel mailing list