compiler-gcc: disable -ftracer for __noclone functions 57/110957/1 submit/tizen/20170120.144453
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 31 Mar 2016 07:38:51 +0000 (09:38 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 19 Jan 2017 03:28:17 +0000 (12:28 +0900)
commit 95272c29378ee7dc15f43fa2758cb28a5913a06d upstream.

-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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I3aa7d5a11d3a0e027ad930b664930f67c84661c9

include/linux/compiler-gcc.h

index bb2cdcd929c6dbad36b1c76c269756eaabe7209f..633716ef19b0aa365546a093be5000f961aa503c 100644 (file)
 #define unreachable() __builtin_unreachable()
 
 /* Mark a function definition as prohibited from being cloned. */
-#define __noclone      __attribute__((__noclone__))
+#define __noclone      __attribute__((__noclone__, __optimize__("no-tracer")))
 
 #endif /* GCC_VERSION >= 40500 */