linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: Use an absolute path to unified.h in KBUILD_AFLAGS
@ 2025-06-18 19:29 Nathan Chancellor
  2025-06-20  2:31 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2025-06-18 19:29 UTC (permalink / raw)
  To: Russell King, Masahiro Yamada
  Cc: linux-arm-kernel, linux-kernel, linux-kbuild, stable,
	KernelCI bot, Nathan Chancellor

After commit d5c8d6e0fa61 ("kbuild: Update assembler calls to use proper
flags and language target"), which updated as-instr to use the
'assembler-with-cpp' language option, the Kbuild version of as-instr
always fails internally for arch/arm with

  <command-line>: fatal error: asm/unified.h: No such file or directory
  compilation terminated.

because '-include' flags are now taken into account by the compiler
driver and as-instr does not have '$(LINUXINCLUDE)', so unified.h is not
found.

This went unnoticed at the time of the Kbuild change because the last
use of as-instr in Kbuild that arch/arm could reach was removed in 5.7
by commit 541ad0150ca4 ("arm: Remove 32bit KVM host support") but a
stable backport of the Kbuild change to before that point exposed this
potential issue if one were to be reintroduced.

Follow the general pattern of '-include' paths throughout the tree and
make unified.h absolute using '$(srctree)' to ensure KBUILD_AFLAGS can
be used independently.

Cc: stable@vger.kernel.org
Fixes: d5c8d6e0fa61 ("kbuild: Update assembler calls to use proper flags and language target")
Reported-by: KernelCI bot <bot@kernelci.org>
Closes: https://lore.kernel.org/CACo-S-1qbCX4WAVFA63dWfHtrRHZBTyyr2js8Lx=Az03XHTTHg@mail.gmail.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/arm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 4808d3ed98e4..e31e95ffd33f 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -149,7 +149,7 @@ endif
 # Need -Uarm for gcc < 3.x
 KBUILD_CPPFLAGS	+=$(cpp-y)
 KBUILD_CFLAGS	+=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
-KBUILD_AFLAGS	+=$(CFLAGS_ABI) $(AFLAGS_ISA) -Wa,$(arch-y) $(tune-y) -include asm/unified.h -msoft-float
+KBUILD_AFLAGS	+=$(CFLAGS_ABI) $(AFLAGS_ISA) -Wa,$(arch-y) $(tune-y) -include $(srctree)/arch/arm/include/asm/unified.h -msoft-float
 KBUILD_RUSTFLAGS += --target=arm-unknown-linux-gnueabi
 
 CHECKFLAGS	+= -D__arm__

---
base-commit: e04c78d86a9699d136910cfc0bdcf01087e3267e
change-id: 20250618-arm-expand-include-unified-h-path-60e65adcda1e

Best regards,
--  
Nathan Chancellor <nathan@kernel.org>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: Use an absolute path to unified.h in KBUILD_AFLAGS
  2025-06-18 19:29 [PATCH] ARM: Use an absolute path to unified.h in KBUILD_AFLAGS Nathan Chancellor
@ 2025-06-20  2:31 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2025-06-20  2:31 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Russell King, linux-arm-kernel, linux-kernel, linux-kbuild,
	stable, KernelCI bot

On Thu, Jun 19, 2025 at 4:29 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> After commit d5c8d6e0fa61 ("kbuild: Update assembler calls to use proper
> flags and language target"), which updated as-instr to use the
> 'assembler-with-cpp' language option, the Kbuild version of as-instr
> always fails internally for arch/arm with
>
>   <command-line>: fatal error: asm/unified.h: No such file or directory
>   compilation terminated.
>
> because '-include' flags are now taken into account by the compiler
> driver and as-instr does not have '$(LINUXINCLUDE)', so unified.h is not
> found.
>
> This went unnoticed at the time of the Kbuild change because the last
> use of as-instr in Kbuild that arch/arm could reach was removed in 5.7
> by commit 541ad0150ca4 ("arm: Remove 32bit KVM host support") but a
> stable backport of the Kbuild change to before that point exposed this
> potential issue if one were to be reintroduced.
>
> Follow the general pattern of '-include' paths throughout the tree and
> make unified.h absolute using '$(srctree)' to ensure KBUILD_AFLAGS can
> be used independently.
>
> Cc: stable@vger.kernel.org
> Fixes: d5c8d6e0fa61 ("kbuild: Update assembler calls to use proper flags and language target")
> Reported-by: KernelCI bot <bot@kernelci.org>
> Closes: https://lore.kernel.org/CACo-S-1qbCX4WAVFA63dWfHtrRHZBTyyr2js8Lx=Az03XHTTHg@mail.gmail.com/
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>


Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>





-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-20  2:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18 19:29 [PATCH] ARM: Use an absolute path to unified.h in KBUILD_AFLAGS Nathan Chancellor
2025-06-20  2:31 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).