Building perf with clang
Hey all,
I usually use clang to build my code, and have configured CC and CXX globally for that purpose. When I forget to unset that before I run "make" in the perf folder, I get into serious trouble as that is not supported at all.
So, can that be fixed, either by making perf buildable with clang, or by enforcing GCC within the Makefile if clang is not supported? Or at least error out early if clang would be used?
Thanks
Signature · 4 lines
Milian Wolff | [email protected] | Software Engineer KDAB (Deutschland) GmbH&Co KG, a KDAB Group company Tel: +49-30-521325470 KDAB - The Qt Experts
Em Fri, Apr 01, 2016 at 11:19:05PM +0200, Milian Wolff escreveu:
Quoted 9 lines
Hey all,
I usually use clang to build my code, and have configured CC and CXX globally for that purpose. When I forget to unset that before I run "make" in the perf folder, I get into serious trouble as that is not supported at all.
So, can that be fixed, either by making perf buildable with clang, or by enforcing GCC within the
Makefileif clang is not supported? Or at least error out early if clang would be used?
I never tried, but I have it installed to test perf + BPF, so I'll try it, fixing things as I go, patches welcome, as I'll start this tomorrow, at the earliest.
- Arnaldo
Quoted 8 lines · On Freitag, 1. April 2016 19:16:02 CEST Arnaldo Carvalho de Melo wrote:
Em Fri, Apr 01, 2016 at 11:19:05PM +0200, Milian Wolff escreveu:
Quoted 7 lines
Hey all,
I usually use clang to build my code, and have configured CC and CXX globally for that purpose. When I forget to unset that before I run "make" in the perf folder, I get into serious trouble as that is not supported at all.
Quoted 7 lines
Quoted 3 lines
So, can that be fixed, either by making perf buildable with clang, or by enforcing GCC within the
Makefileif clang is not supported? Or at least error out early if clang would be used?I never tried, but I have it installed to test perf + BPF, so I'll try it, fixing things as I go, patches welcome, as I'll start this tomorrow, at the earliest.
Just FYI, this is the error I'm seeing:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC=clang make
makeobj[0]: Entering directory `/home/milian/projects/src/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build
warning: unknown warning option '-Wstrict-aliasing=3'; did you mean '-Wstring- plus-int'? [-Wunknown-warning-option]
1 warning generated.
Auto-detecting system features:
... dwarf: [ on ] ... glibc: [ on ] ... gtk2: [ on ] ... libaudit: [ on ] ... libbfd: [ on ] ... libelf: [ on ] ... libnuma: [ on ] ... numa_num_possible_cpus: [ on ] ... libperl: [ on ] ... libpython: [ on ] ... libslang: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ]
GEN common-cmds.h
CC fixdep.o
cat: ./.fixdep.o.d: No such file or directory /home/milian/projects/src/linux/tools/build/Makefile.build:77: recipe for target 'fixdep.o' failed
make[3]: *** [fixdep.o] Error 1
Makefile:36: recipe for target 'fixdep-in.o' failed
make[2]: *** [fixdep-in.o] Error 2 /home/milian/projects/src/linux/tools/build/Makefile.include:7: recipe for target 'fixdep' failed
make[1]: *** [fixdep] Error 2
make[1]: *** Waiting for unfinished jobs....
PERF_VERSION = 4.2.rc6.g7a9420
make[1]: *** wait: No child processes. Stop.
Makefile:68: recipe for target 'all' failed
make: *** [all] Error 2
makeobj[0]: Leaving directory `/home/milian/projects/src/linux/tools/perf'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have no clue what's going on here, I never edit Makefiles by hand...
Speaking of Makefiles, how can I change the CFLAGS when building perf (with GCC)? I.e. how can I build it in -O0, or how can I enable sanitizers?
Thanks
Signature · 4 lines
Milian Wolff | [email protected] | Software Engineer KDAB (Deutschland) GmbH&Co KG, a KDAB Group company Tel: +49-30-521325470 KDAB - The Qt Experts