Subject: [PATCH 5.15 01/10] x86/boot/compressed: prefer cc-option for CFLAGS additions

From: Nick Desaulniers <[email-masked]>
Date: Wed, 11 Jan 2023 20:04:58 -0700

commit 994f5f7816ff963f49269cfc97f63cb2e4edb84f upstream.

as-option tests new options using KBUILD_CFLAGS, which causes problems
when using as-option to update KBUILD_AFLAGS because many compiler
options are not valid assembler options.

This will be fixed in a follow up patch. Before doing so, move the
assembler test for -Wa,-mrelax-relocations=no from using as-option to
cc-option.

Link: https://lore.kernel.org/llvm/CAK7LNATcHt7GcXZ=jMszyH=[email-masked]/
Suggested-by: Masahiro Yamada <[email-masked]>
Reviewed-by: Nathan Chancellor <[email-masked]>
Tested-by: Nathan Chancellor <[email-masked]>
Signed-off-by: Nick Desaulniers <[email-masked]>
Signed-off-by: Nathan Chancellor <[email-masked]>
Tested-by: Linux Kernel Functional Testing <[email-masked]>
Tested-by: Anders Roxell <[email-masked]>
Signed-off-by: Masahiro Yamada <[email-masked]>
Signed-off-by: Nathan Chancellor <[email-masked]>
---
 arch/x86/boot/compressed/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 3ec9fb6b0378..f82b2cb24360 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -50,7 +50,7 @@ KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
 KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
 KBUILD_CFLAGS += -D__DISABLE_EXPORTS
 # Disable relocation relaxation in case the link is not PIE.
-KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mrelax-relocations=no)
+KBUILD_CFLAGS += $(call cc-option,-Wa$(comma)-mrelax-relocations=no)
 KBUILD_CFLAGS += -include $(srctree)/include/linux/hidden.h
 
 # sev.c indirectly inludes inat-table.h which is generated during

base-commit: 1c700860e8bc079c5c71d73c55e51865d273943c
-- 
2.49.0