Pull perf/core clang fixes from Arnaldo Carvalho de Melo:
Changes to make tools/{perf,lib/{bpf,traceevent,api}} build with
CC=clang, to, for instance, take advantage of warnings (Arnaldo Carvalho de Melo):
- Conditionally request some warning options not available on clang
- Set the maximum optimization level to -O3 when using CC=clang, leave
the previous setting of -O6 otherwise.
- Make it an error to pass a signed value to OPTION_UINTEGER, so that
we can remove abs(unsigned int) calls in 'perf bench futex'.
- Make sure dprintf() is not defined before using that name in 'perf bench numa'
- Avoid using field after variable sized type, its a GNU extension, use
equivalent code.
- Fix some bugs where some variables could be used unitialized,
something not caught by gcc.
- Fix some spots where we were testing struct->array[] members against
NULL, it will always evaluate to 'true'.
- Add missing parse_events_error() prototype in the bison file.
There are still one problem when trying to build the python support, but
this are the 'size' outputs for 'make -C tools/perf NO_LIBPYTHON' for
gcc and clang builds:
DW_AT_producer: clang version 4.0.0 (http://llvm.org/git/clang.git
f5be8ba13adc4ba1011a7ccd60c844bd60427c1c) (ht
$ size ~/bin/perf
text data bss dec hex filename
3447514 831320
23901696 28180530 1ae0032 /home/acme/bin/perf
DW_AT_producer: GNU C99 6.3.1
20161221 (Red Hat 6.3.1-1) -mtune=generic -march=x86-64 -ggdb3 -O6 -std=gnu99
+-fno-omit-frame-pointer -funwind-tables -fstack-protector-all
$ size ~/bin/perf
text data bss dec hex filename
3671662 836480
23902752 28410894 1b1840e /home/acme/bin/perf
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>