Skip to content

Commit 587f170

Browse files
nickdesaulnierstorvalds
authored andcommitted
Kconfig: add config option for asm goto w/ outputs
This allows C code to make use of compilers with support for output variables along the fallthrough path via preprocessor define: CONFIG_CC_HAS_ASM_GOTO_OUTPUT [ This is not used anywhere yet, and currently released compilers don't support this yet, but it's coming, and I have some local experimental patches to take advantage of it when it does - Linus ] Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 886d7de commit 587f170

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

init/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ config CC_CAN_LINK
3636
config CC_HAS_ASM_GOTO
3737
def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC))
3838

39+
config CC_HAS_ASM_GOTO_OUTPUT
40+
depends on CC_HAS_ASM_GOTO
41+
def_bool $(success,echo 'int foo(int x) { asm goto ("": "=r"(x) ::: bar); return x; bar: return 0; }' | $(CC) -x c - -c -o /dev/null)
42+
3943
config TOOLS_SUPPORT_RELR
4044
def_bool $(success,env "CC=$(CC)" "LD=$(LD)" "NM=$(NM)" "OBJCOPY=$(OBJCOPY)" $(srctree)/scripts/tools-support-relr.sh)
4145

0 commit comments

Comments
 (0)