From: Namhyung Kim <namhyung@kernel.org>
To: Leo Yan <leo.yan@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Ian Rogers <irogers@google.com>, Jiri Olsa <jolsa@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Liang, Kan" <kan.liang@linux.intel.com>,
Nick Terrell <terrelln@fb.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Thomas Richter <tmricht@linux.ibm.com>,
Changbin Du <changbin.du@huawei.com>,
James Clark <james.clark@linaro.org>,
amadio@gentoo.org, linux-kernel@vger.kernel.org,
linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 7/7] perf docs: Remove the Android cross building document
Date: Thu, 11 Jul 2024 21:58:34 -0700 [thread overview]
Message-ID: <ZpC3-p0kG7dGkp_5@google.com> (raw)
In-Reply-To: <20240706182912.222780-8-leo.yan@arm.com>
On Sat, Jul 06, 2024 at 07:29:12PM +0100, Leo Yan wrote:
> The Android NDK (as time being the latest LTS version is r26d) changes
> toolchain to LLVM / Clang, so GCC compilers is not included in the NDK
> anymore. Therefore, the Android document contains obsolete info for
> building perf binary with NDK.
Do you know if the version prior to the change is still used?
>
> Furthermore, the Clang included in the Android NDK is problematic for
> cross compilation Aarch64 target. The building reports multiple errors
> with the compiler aarch64-linux-android34-clang.
>
> Thus, delete Documentation/android.txt to avoid confusion.
If so, maybe we can keep the document little more and add a note that
this works only for some old versions.
I'm also curious if it's still broken after your fixes.
Thanks,
Namhyung
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
> tools/perf/Documentation/android.txt | 78 ----------------------------
> 1 file changed, 78 deletions(-)
> delete mode 100644 tools/perf/Documentation/android.txt
>
> diff --git a/tools/perf/Documentation/android.txt b/tools/perf/Documentation/android.txt
> deleted file mode 100644
> index 24a59998fc91..000000000000
> --- a/tools/perf/Documentation/android.txt
> +++ /dev/null
> @@ -1,78 +0,0 @@
> -How to compile perf for Android
> -=========================================
> -
> -I. Set the Android NDK environment
> -------------------------------------------------
> -
> -(a). Use the Android NDK
> -------------------------------------------------
> -1. You need to download and install the Android Native Development Kit (NDK).
> -Set the NDK variable to point to the path where you installed the NDK:
> - export NDK=/path/to/android-ndk
> -
> -2. Set cross-compiling environment variables for NDK toolchain and sysroot.
> -For arm:
> - export NDK_TOOLCHAIN=${NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
> - export NDK_SYSROOT=${NDK}/platforms/android-24/arch-arm
> -For x86:
> - export NDK_TOOLCHAIN=${NDK}/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-
> - export NDK_SYSROOT=${NDK}/platforms/android-24/arch-x86
> -
> -This method is only tested for Android NDK versions Revision 11b and later.
> -perf uses some bionic enhancements that are not included in prior NDK versions.
> -You can use method (b) described below instead.
> -
> -(b). Use the Android source tree
> ------------------------------------------------
> -1. Download the master branch of the Android source tree.
> -Set the environment for the target you want using:
> - source build/envsetup.sh
> - lunch
> -
> -2. Build your own NDK sysroot to contain latest bionic changes and set the
> -NDK sysroot environment variable.
> - cd ${ANDROID_BUILD_TOP}/ndk
> -For arm:
> - ./build/tools/build-ndk-sysroot.sh --abi=arm
> - export NDK_SYSROOT=${ANDROID_BUILD_TOP}/ndk/build/platforms/android-3/arch-arm
> -For x86:
> - ./build/tools/build-ndk-sysroot.sh --abi=x86
> - export NDK_SYSROOT=${ANDROID_BUILD_TOP}/ndk/build/platforms/android-3/arch-x86
> -
> -3. Set the NDK toolchain environment variable.
> -For arm:
> - export NDK_TOOLCHAIN=${ANDROID_TOOLCHAIN}/arm-linux-androideabi-
> -For x86:
> - export NDK_TOOLCHAIN=${ANDROID_TOOLCHAIN}/i686-linux-android-
> -
> -II. Compile perf for Android
> -------------------------------------------------
> -You need to run make with the NDK toolchain and sysroot defined above:
> -For arm:
> - make WERROR=0 ARCH=arm CROSS_COMPILE=${NDK_TOOLCHAIN} EXTRA_CFLAGS="-pie --sysroot=${NDK_SYSROOT}"
> -For x86:
> - make WERROR=0 ARCH=x86 CROSS_COMPILE=${NDK_TOOLCHAIN} EXTRA_CFLAGS="-pie --sysroot=${NDK_SYSROOT}"
> -
> -III. Install perf
> ------------------------------------------------
> -You need to connect to your Android device/emulator using adb.
> -Install perf using:
> - adb push perf /data/perf
> -
> -If you also want to use perf-archive you need busybox tools for Android.
> -For installing perf-archive, you first need to replace #!/bin/bash with #!/system/bin/sh:
> - sed 's/#!\/bin\/bash/#!\/system\/bin\/sh/g' perf-archive >> /tmp/perf-archive
> - chmod +x /tmp/perf-archive
> - adb push /tmp/perf-archive /data/perf-archive
> -
> -IV. Environment settings for running perf
> -------------------------------------------------
> -Some perf features need environment variables to run properly.
> -You need to set these before running perf on the target:
> - adb shell
> - # PERF_PAGER=cat
> -
> -IV. Run perf
> -------------------------------------------------
> -Run perf on your device/emulator to which you previously connected using adb:
> - # ./data/perf
> --
> 2.34.1
>
next prev parent reply other threads:[~2024-07-12 4:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-06 18:29 [PATCH v3 0/7] perf: build: Fix cross compilation Leo Yan
2024-07-06 18:29 ` [PATCH v3 1/7] perf: build: Setup PKG_CONFIG_LIBDIR for " Leo Yan
2024-07-12 4:52 ` Namhyung Kim
2024-07-12 10:13 ` Leo Yan
2024-07-06 18:29 ` [PATCH v3 2/7] perf: build: Set Python configuration " Leo Yan
2024-07-06 18:29 ` [PATCH v3 3/7] perf: build: Only link libebl.a for old libdw Leo Yan
2024-07-06 18:29 ` [PATCH v3 4/7] perf: build: Link lib 'lzma' for static build Leo Yan
2024-07-06 18:29 ` [PATCH v3 5/7] perf: build: Link lib 'zstd' " Leo Yan
2024-07-06 18:29 ` [PATCH v3 6/7] perf docs: Document cross compilation Leo Yan
2024-07-06 18:29 ` [PATCH v3 7/7] perf docs: Remove the Android cross building document Leo Yan
2024-07-12 4:58 ` Namhyung Kim [this message]
2024-07-12 5:37 ` Ian Rogers
2024-07-12 11:02 ` Leo Yan
2024-07-12 13:38 ` James Clark
2024-07-15 14:48 ` Leo Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZpC3-p0kG7dGkp_5@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=amadio@gentoo.org \
--cc=changbin.du@huawei.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=justinstitt@google.com \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=terrelln@fb.com \
--cc=tmricht@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).