Skip to content

Commit c2d920b

Browse files
fvincenzoctmarinas
authored andcommitted
kconfig: Add support for 'as-option'
Currently kconfig does not have a feature that allows to detect if the used assembler supports a specific compilation option. Introduce 'as-option' to serve this purpose in the context of Kconfig: config X def_bool $(as-option,...) Signed-off-by: Amit Daniel Kachhap <[email protected]> Signed-off-by: Vincenzo Frascino <[email protected]> Acked-by: Masahiro Yamada <[email protected]> Cc: [email protected] Cc: Masahiro Yamada <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent e51f5f5 commit c2d920b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/Kconfig.include

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -S -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-option,<flag>)
35+
# /dev/zero is used as output instead of /dev/null as some assembler cribs when
36+
# both input and output are same. Also both of them have same write behaviour so
37+
# can be easily substituted.
38+
as-option = $(success, $(CC) $(CLANG_FLAGS) $(1) -c -x assembler /dev/null -o /dev/zero)
39+
3440
# $(as-instr,<instr>)
3541
# Return y if the assembler supports <instr>, n otherwise
3642
as-instr = $(success,printf "%b\n" "$(1)" | $(CC) $(CLANG_FLAGS) -c -x assembler -o /dev/null -)

0 commit comments

Comments
 (0)