From 2f3f746d7f95330de2d26867eb1c3b1dda0602f1 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Wed, 14 Feb 2018 13:37:23 +0100 Subject: [PATCH] linux: fix perf build properly set ARCH, CROSS_COMPILE, LDFLAGS and JOBS. This fixes build failure on aarch64 / kernel 4.4 and feature detection issues due to LTO warnings on 32bit Rockchip builds. Signed-off-by: Matthias Reichl --- packages/linux/package.mk | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/linux/package.mk b/packages/linux/package.mk index 52262910a6..09a7d268d3 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -164,6 +164,20 @@ make_target() { if [ "$PKG_BUILD_PERF" = "yes" ] ; then ( cd tools/perf + + # arch specific perf build args + case "$TARGET_ARCH" in + x86_64) + PERF_BUILD_ARGS="ARCH=x86" + ;; + aarch64) + PERF_BUILD_ARGS="ARCH=arm64" + ;; + *) + PERF_BUILD_ARGS="ARCH=$TARGET_ARCH" + ;; + esac + WERROR=0 \ NO_LIBPERL=1 \ NO_LIBPYTHON=1 \ @@ -173,9 +187,11 @@ make_target() { NO_LIBAUDIT=1 \ NO_LZMA=1 \ NO_SDT=1 \ - LDFLAGS="-ldw -ldwfl -lebl -lelf -ldl -lz" \ + LDFLAGS="$LDFLAGS -ldw -ldwfl -lebl -lelf -ldl -lz" \ EXTRA_PERFLIBS="-lebl" \ - make + CROSS_COMPILE="$TARGET_PREFIX" \ + JOBS="$CONCURRENCY_MAKE_LEVEL" \ + make $PERF_BUILD_ARGS mkdir -p $INSTALL/usr/bin cp perf $INSTALL/usr/bin )