Skip to content

Commit 42d519e

Browse files
ctmarinaswilldeacon
authored andcommitted
kbuild: Add support for 'as-instr' to be used in Kconfig files
Similar to 'cc-option' or 'ld-option', it is occasionally necessary to check whether the assembler supports certain ISA extensions. In the arm64 code we currently do this in Makefile with an additional define: lseinstr := $(call as-instr,.arch_extension lse,-DCONFIG_AS_LSE=1) Add the 'as-instr' option so that it can be used in Kconfig directly: def_bool $(as-instr,.arch_extension lse) Acked-by: Masahiro Yamada <[email protected]> Reviewed-by: Vladimir Murzin <[email protected]> Tested-by: Vladimir Murzin <[email protected]> Signed-off-by: Catalin Marinas <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 46cf053 commit 42d519e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/Kconfig.include

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -E -x c /dev/null -o /de
3131
# Return y if the linker supports <flag>, n otherwise
3232
ld-option = $(success,$(LD) -v $(1))
3333

34+
# $(as-instr,<instr>)
35+
# Return y if the assembler supports <instr>, n otherwise
36+
as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler -o /dev/null -)
37+
3438
# check if $(CC) and $(LD) exist
3539
$(error-if,$(failure,command -v $(CC)),compiler '$(CC)' not found)
3640
$(error-if,$(failure,command -v $(LD)),linker '$(LD)' not found)

0 commit comments

Comments
 (0)