summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Desaulniers <ndesaulniers@google.com>2020-02-15 01:18:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-14 19:11:50 +0300
commit4946cfd1c8f018a084182ce71886d8e27d01911e (patch)
treeb0d2b543c306ef0cc68eb64de73648b7444310ee
parent7ac21b24af859c097eb4034e93430056068f8f31 (diff)
downloadlinux-4946cfd1c8f018a084182ce71886d8e27d01911e.tar.xz
Kconfig: add config option for asm goto w/ outputs
commit 587f17018a2c6c414e41a312b002faaef60cf423 upstream. 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 <ndesaulniers@google.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--init/Kconfig4
1 files changed, 4 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 1cdb6a66b85c..74f44b753d61 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -38,6 +38,10 @@ config CC_HAS_ASM_GOTO_TIED_OUTPUT
# Detect buggy gcc and clang, fixed in gcc-11 clang-14.
def_bool $(success,echo 'int foo(int *x) { asm goto (".long (%l[bar]) - .\n": "+m"(*x) ::: bar); return *x; bar: return 0; }' | $CC -x c - -c -o /dev/null)
+config CC_HAS_ASM_GOTO_OUTPUT
+ depends on CC_HAS_ASM_GOTO
+ 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)
+
config TOOLS_SUPPORT_RELR
def_bool $(success,env "CC=$(CC)" "LD=$(LD)" "NM=$(NM)" "OBJCOPY=$(OBJCOPY)" $(srctree)/scripts/tools-support-relr.sh)