Skip to content

Commit

Permalink
UPSTREAM: kbuild: Add support for 'as-instr' to be used in Kconfig files
Browse files Browse the repository at this point in the history
commit 42d519e upstream.

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]>
Change-Id: I6223cb0ca43a5564c4ed4600577299f2819b91a6
Signed-off-by: Will Deacon <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
Bug: 141693040
(cherry picked from commit a31d96d)
Signed-off-by: TogoFire <[email protected]>
  • Loading branch information
ctmarinas authored and TogoFire committed Feb 7, 2024
1 parent 6e10de6 commit ca58324
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/Kconfig.include
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -S -x c /dev/null -o /de
# Return y if the linker supports <flag>, n otherwise
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) -c -x assembler -o /dev/null -)

# check if $(CC) and $(LD) exist
$(error-if,$(failure,command -v $(CC)),compiler '$(CC)' not found)
$(error-if,$(failure,command -v $(LD)),linker '$(LD)' not found)
Expand Down

0 comments on commit ca58324

Please sign in to comment.