Skip to content

Commit 9b561b8

Browse files
bonzinisashalevin
authored andcommitted
compiler-gcc: disable -ftracer for __noclone functions
[ Upstream commit 95272c2 ] -ftracer can duplicate asm blocks causing compilation to fail in noclone functions. For example, KVM declares a global variable in an asm like asm("2: ... \n .pushsection data \n .global vmx_return \n vmx_return: .long 2b"); and -ftracer causes a double declaration. Cc: Andrew Morton <[email protected]> Cc: Michal Marek <[email protected]> Cc: [email protected] Cc: [email protected] Reported-by: Linda Walsh <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent f320793 commit 9b561b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/compiler-gcc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
#define unreachable() __builtin_unreachable()
193193

194194
/* Mark a function definition as prohibited from being cloned. */
195-
#define __noclone __attribute__((__noclone__))
195+
#define __noclone __attribute__((__noclone__, __optimize__("no-tracer")))
196196

197197
#endif /* GCC_VERSION >= 40500 */
198198

0 commit comments

Comments
 (0)