]> Git Repo - J-linux.git/commitdiff
x86/kconfig: Add as-instr64 macro to properly evaluate AS_WRUSS
authorMasahiro Yamada <[email protected]>
Wed, 12 Jun 2024 05:02:55 +0000 (14:02 +0900)
committerBorislav Petkov (AMD) <[email protected]>
Thu, 20 Jun 2024 17:48:18 +0000 (19:48 +0200)
Some instructions are only available on the 64-bit architecture.

Bi-arch compilers that default to -m32 need the explicit -m64 option
to evaluate them properly.

Fixes: 18e66b695e78 ("x86/shstk: Add Kconfig option for shadow stack")
Closes: https://lore.kernel.org/all/[email protected]/
Reported-by: Dmitry Safonov <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Tested-by: Dmitry Safonov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
arch/x86/Kconfig.assembler
scripts/Kconfig.include

index 59aedf32c4eaa302dd12d76584ea406bc288f3a4..6d20a6ce0507d0e2e49c48c45b0003092c8e1d75 100644 (file)
@@ -36,6 +36,6 @@ config AS_VPCLMULQDQ
          Supported by binutils >= 2.30 and LLVM integrated assembler
 
 config AS_WRUSS
-       def_bool $(as-instr,wrussq %rax$(comma)(%rbx))
+       def_bool $(as-instr64,wrussq %rax$(comma)(%rbx))
        help
          Supported by binutils >= 2.31 and LLVM integrated assembler
index 3ee8ecfb8c044c3bf65461e81af5a9e95391fa44..3500a3d62f0df29d1d3c59e002127b44bf21811d 100644 (file)
@@ -33,7 +33,8 @@ ld-option = $(success,$(LD) -v $(1))
 
 # $(as-instr,<instr>)
 # Return y if the assembler supports <instr>, n otherwise
-as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -Wa$(comma)--fatal-warnings -c -x assembler-with-cpp -o /dev/null -)
+as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) $(2) -Wa$(comma)--fatal-warnings -c -x assembler-with-cpp -o /dev/null -)
+as-instr64 = $(as-instr,$(1),$(m64-flag))
 
 # check if $(CC) and $(LD) exist
 $(error-if,$(failure,command -v $(CC)),C compiler '$(CC)' not found)
This page took 0.051624 seconds and 4 git commands to generate.