This is a note to let you know that I've just added the patch titled kbuild: Add support for 'as-instr' to be used in Kconfig files to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kbuild-add-support-for-as-instr-to-be-used-in-kconfi.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit bf93523f4e8c53e0b8db390fb77fab769975b8b7 Author: Catalin Marinas <catalin.marinas@xxxxxxx> Date: Wed Jan 15 11:30:07 2020 +0000 kbuild: Add support for 'as-instr' to be used in Kconfig files commit 42d519e3d0c071161d0a1c36e95a3743b113c590 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 <masahiroy@xxxxxxxxxx> Reviewed-by: Vladimir Murzin <vladimir.murzin@xxxxxxx> Tested-by: Vladimir Murzin <vladimir.murzin@xxxxxxx> Signed-off-by: Catalin Marinas <catalin.marinas@xxxxxxx> Signed-off-by: Will Deacon <will@xxxxxxxxxx> Signed-off-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include index 77a69ba9cd19..496d11c92c97 100644 --- a/scripts/Kconfig.include +++ b/scripts/Kconfig.include @@ -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)