Commit ef26ac1
perf build: Support build with clang
Add support for building perf with clang. For cross compilation, the
Makefile dynamically selects target flag for corresponding arch.
This patch has been verified on x86_64 machine with Ubuntu distro, it
can build successfully for native target, and for cross building Arm64
and s390.
Example: native build on x86_64 / Ubuntu machine:
$ HOSTCC=clang CC=clang CXX=clang++ make -C tools/perf
Example: cross building s390 target on x86_64 / Ubuntu machine:
# Install x390x cross toolchain and headers
$ sudo apt-get install gcc-s390x-linux-gnu g++-s390x-linux-gnu \
libc6-dev-s390x-cross linux-libc-dev-s390x-cross
# Build with clang
$ HOSTCC=clang CC=clang CXX=clang++ \
ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- \
make -C tools/perf NO_LIBELF=1 NO_LIBTRACEEVENT=1 NO_LIBPYTHON=1
Signed-off-by: Leo Yan <[email protected]>1 parent 34312de commit ef26ac1
1 file changed
+31
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
28 | 58 | | |
29 | 59 | | |
30 | 60 | | |
| |||
0 commit comments