linux-kernel-test/tools/include/linux
Jiri Olsa c95f343211 tools include: Fix strict-aliasing rules breakage
Vinson reported build breakage with gcc 4.4 due to strict-aliasing.

   CC       util/annotate.o
 cc1: warnings being treated as errors
 util/annotate.c: In function ‘disasm__purge’:
 linux-next/tools/include/linux/compiler.h:66: error: dereferencing
 pointer ‘res.41’ does break strict-aliasing rules

The reason is READ_ONCE/WRITE_ONCE code we took from kernel sources.  They
intentionaly break aliasing rules. While this is ok for kernel because it's
built with -fno-strict-aliasing, it breaks perf which is build with
-Wstrict-aliasing=3.

Using extra __may_alias__ type to allow aliasing in this case.

Reported-and-tested-by: Vinson Lee <vlee@twopensource.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Martin Liska <mliska@suse.cz>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Rabin Vincent <rabin@rab.in>
Cc: linux-next@vger.kernel.org
Link: http://lkml.kernel.org/r/20151013085214.GB2705@krava.brq.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-10-13 11:43:16 -03:00
..
atomic.h tools include: Add basic atomic.h implementation from the kernel sources 2015-05-08 16:11:05 -03:00
bitops.h tools: Remove bitops/hweight usage of bits in tools/perf 2015-01-16 17:49:29 -03:00
compiler.h tools include: Fix strict-aliasing rules breakage 2015-10-13 11:43:16 -03:00
err.h tools: Fix shadowed declaration in err.h 2015-09-30 18:34:22 -03:00
export.h tools: Restore export.h 2015-08-25 09:44:22 +02:00
filter.h perf tools: Copy linux/filter.h to tools/include 2015-09-02 16:30:46 -03:00
hash.h perf tools: Move hash.h header 2014-02-18 09:34:49 -03:00
kernel.h perf tools: Move linux/kernel.h to tools/include 2015-06-02 15:27:04 -03:00
list.h tools: Move tools/perf/util/include/linux/{list.h,poison.h} to tools/include 2015-06-02 19:07:29 -03:00
log2.h tools: Adopt roundup_pow_of_two 2014-12-17 11:58:15 -03:00
poison.h tools: Move tools/perf/util/include/linux/{list.h,poison.h} to tools/include 2015-06-02 19:07:29 -03:00
rbtree_augmented.h tools: Copy rbtree_augmented.h from the kernel 2015-07-05 22:59:05 -03:00
rbtree.h tools: Move rbtree.h from tools/perf/ 2015-07-05 22:54:01 -03:00
types.h tools include: add __aligned_u64 to types.h. 2015-05-18 10:17:32 -03:00