Skip to content

Commit 95272c2

Browse files
committed
compiler-gcc: disable -ftracer for __noclone functions
-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 <akpm@linux-foundation.org> Cc: Michal Marek <mmarek@suse.cz> Cc: stable@vger.kernel.org Cc: kvm@vger.kernel.org Reported-by: Linda Walsh <lkml@tlinx.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 61abdbe commit 95272c2

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
@@ -199,7 +199,7 @@
199199
#define unreachable() __builtin_unreachable()
200200

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

204204
#endif /* GCC_VERSION >= 40500 */
205205

0 commit comments

Comments
 (0)