We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15b3f48 commit a0a12c3Copy full SHA for a0a12c3
Documentation/kbuild/kconfig-language.rst
@@ -525,8 +525,8 @@ followed by a test macro::
525
If you need to expose a compiler capability to makefiles and/or C source files,
526
`CC_HAS_` is the recommended prefix for the config option::
527
528
- config CC_HAS_ASM_GOTO
529
- def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC))
+ config CC_HAS_FOO
+ def_bool $(success,$(srctree)/scripts/cc-check-foo.sh $(CC))
530
531
Build as module only
532
~~~~~~~~~~~~~~~~~~~~
arch/Kconfig
@@ -53,7 +53,6 @@ config KPROBES
53
config JUMP_LABEL
54
bool "Optimize very unlikely/likely branches"
55
depends on HAVE_ARCH_JUMP_LABEL
56
- depends on CC_HAS_ASM_GOTO
57
select OBJTOOL if HAVE_JUMP_LABEL_HACK
58
help
59
This option enables a transparent branch optimization that
@@ -1361,7 +1360,7 @@ config HAVE_PREEMPT_DYNAMIC_CALL
1361
1360
1362
config HAVE_PREEMPT_DYNAMIC_KEY
1363
bool
1364
- depends on HAVE_ARCH_JUMP_LABEL && CC_HAS_ASM_GOTO
+ depends on HAVE_ARCH_JUMP_LABEL
1365
select HAVE_PREEMPT_DYNAMIC
1366
1367
An architecture should select this if it can handle the preemption
arch/um/include/asm/cpufeature.h
@@ -65,20 +65,6 @@ extern void setup_clear_cpu_cap(unsigned int bit);
65
66
#define setup_force_cpu_bug(bit) setup_force_cpu_cap(bit)
67
68
-#if defined(__clang__) && !defined(CONFIG_CC_HAS_ASM_GOTO)
69
-
70
-/*
71
- * Workaround for the sake of BPF compilation which utilizes kernel
72
- * headers, but clang does not support ASM GOTO and fails the build.
73
- */
74
-#ifndef __BPF_TRACING__
75
-#warning "Compiler lacks ASM_GOTO support. Add -D __BPF_TRACING__ to your compiler arguments"
76
-#endif
77
78
-#define static_cpu_has(bit) boot_cpu_has(bit)
79
80
-#else
81
82
/*
83
* Static testing of CPU features. Used the same as boot_cpu_has(). It
84
* statically patches the target code for additional performance. Use
@@ -137,7 +123,6 @@ static __always_inline bool _static_cpu_has(u16 bit)
137
123
boot_cpu_has(bit) : \
138
124
_static_cpu_has(bit) \
139
125
)
140
141
126
142
127
#define cpu_has_bug(c, bit) cpu_has(c, (bit))
143
128
#define set_cpu_bug(c, bit) set_cpu_cap(c, (bit))
arch/x86/Makefile
@@ -286,10 +286,6 @@ vdso_install:
286
287
archprepare: checkbin
288
checkbin:
289
-ifndef CONFIG_CC_HAS_ASM_GOTO
290
- @echo Compiler lacks asm-goto support.
291
- @exit 1
292
-endif
293
ifdef CONFIG_RETPOLINE
294
ifeq ($(RETPOLINE_CFLAGS),)
295
@echo "You are building kernel with non-retpoline compiler." >&2
arch/x86/include/asm/cpufeature.h
@@ -155,20 +155,6 @@ extern void clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int bit);
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
@@ -208,7 +194,6 @@ static __always_inline bool _static_cpu_has(u16 bit)
208
194
209
195
210
196
211
212
197
213
198
214
199
arch/x86/include/asm/rmwcc.h
@@ -11,7 +11,7 @@
11
12
#define __CLOBBERS_MEM(clb...) "memory", ## clb
13
14
-#if !defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(CONFIG_CC_HAS_ASM_GOTO)
+#ifndef __GCC_ASM_FLAG_OUTPUTS__
15
16
/* Use asm goto */
17
@@ -27,7 +27,7 @@ cc_label: c = true; \
27
c; \
28
})
29
30
-#else /* defined(__GCC_ASM_FLAG_OUTPUTS__) || !defined(CONFIG_CC_HAS_ASM_GOTO) */
+#else /* defined(__GCC_ASM_FLAG_OUTPUTS__) */
31
32
/* Use flags output or a set instruction */
33
@@ -40,7 +40,7 @@ cc_label: c = true; \
40
41
42
43
-#endif /* defined(__GCC_ASM_FLAG_OUTPUTS__) || !defined(CONFIG_CC_HAS_ASM_GOTO) */
+#endif /* defined(__GCC_ASM_FLAG_OUTPUTS__) */
44
45
#define GEN_UNARY_RMWcc_4(op, var, cc, arg0) \
46
__GEN_RMWcc(op " " arg0, var, cc, __CLOBBERS_MEM())
arch/x86/kvm/emulate.c
@@ -479,7 +479,7 @@ FOP_END;
479
480
481
* XXX: inoutclob user must know where the argument is being expanded.
482
- * Relying on CONFIG_CC_HAS_ASM_GOTO would allow us to remove _fault.
+ * Using asm goto would allow us to remove _fault.
483
*/
484
#define asm_safe(insn, inoutclob...) \
485
({ \
init/Kconfig
@@ -70,11 +70,7 @@ config CC_CAN_LINK_STATIC
default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag) -static) if 64BIT
default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m32-flag) -static)
-config CC_HAS_ASM_GOTO
config CC_HAS_ASM_GOTO_OUTPUT
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 CC_HAS_ASM_GOTO_TIED_OUTPUT
scripts/gcc-goto.sh
tools/arch/x86/include/asm/rmwcc.h
@@ -2,8 +2,6 @@
2
#ifndef _TOOLS_LINUX_ASM_X86_RMWcc
3
#define _TOOLS_LINUX_ASM_X86_RMWcc
4
5
-#ifdef CONFIG_CC_HAS_ASM_GOTO
6
7
#define __GEN_RMWcc(fullop, var, cc, ...) \
8
do { \
9
asm_volatile_goto (fullop "; j" cc " %l[cc_label]" \
@@ -20,23 +18,4 @@ cc_label: \
20
18
#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \
21
19
__GEN_RMWcc(op " %1, " arg0, var, cc, vcon (val))
22
23
-#else /* !CONFIG_CC_HAS_ASM_GOTO */
24
25
-#define __GEN_RMWcc(fullop, var, cc, ...) \
26
-do { \
- char c; \
- asm volatile (fullop "; set" cc " %1" \
- : "+m" (var), "=qm" (c) \
- : __VA_ARGS__ : "memory"); \
- return c != 0; \
-} while (0)
34
-#define GEN_UNARY_RMWcc(op, var, arg0, cc) \
35
- __GEN_RMWcc(op " " arg0, var, cc)
36
37
-#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \
38
- __GEN_RMWcc(op " %2, " arg0, var, cc, vcon (val))
39
-#endif /* CONFIG_CC_HAS_ASM_GOTO */
#endif /* _TOOLS_LINUX_ASM_X86_RMWcc */
0 commit comments