Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Martin Liska <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rabin Vincent <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
- Loading branch information