From: James Clark <james.clark@linaro.org>
To: Leo Yan <leo.yan@arm.com>, Namhyung Kim <namhyung@kernel.org>
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>,
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: Fri, 12 Jul 2024 14:38:19 +0100 [thread overview]
Message-ID: <83301e3e-e049-4af4-9f0b-29bdfc201543@linaro.org> (raw)
In-Reply-To: <3b16778b-f825-42a2-b53d-17c9b8c22a52@arm.com>
On 12/07/2024 12:02 pm, Leo Yan wrote:
> Hi Namhyung,
>
> On 7/12/24 05:58, Namhyung Kim wrote:
>> 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?
>
> Based on the Android NDK wiki claims [1], since NDK r15 (backed to 26th
> July, 2017) "GCC is no longer supported. It will not be removed from the
> NDK
> just yet, but is no longer receiving backports".
>
>>> 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.
>
> When I tried Android NDK for cross building perf, it is still broken after
> applied this series.
>
> From my testing, now using LLVM for native building works well:
>
> make LLVM=-15 VF=1 DEBUG=1 -C tools/perf
>
> But it failed for cross compilation. Since Android NDK system root does not
> contain some dependency libs, we must use extra options to disable some
> features (e.g. NO_LIBELF=1 NO_LIBTRACEEVENT=1). The commands I tried for
> cross building but failed:
>
> make ARCH=arm64 CC=$NDK_TOOLCHAIN/aarch64-linux-android-clang \
> LD=$NDK_TOOLCHAIN/ld.lld AR=$NDK_TOOLCHAIN/llvm-ar \
> NM=$NDK_TOOLCHAIN/llvm-nm STRIP=$NDK_TOOLCHAIN/llvm-strip \
> OBJCOPY=$NDK_TOOLCHAIN/llvm-objcopy \
> OBJDUMP=$NDK_TOOLCHAIN/llvm-objdump \
> READELF=$NDK_TOOLCHAIN/llvm-readelf \
> HOSTCC=$NDK_TOOLCHAIN/clang \
> HOSTCXX=$NDK_TOOLCHAIN/clang++ HOSTAR=$NDK_TOOLCHAIN/llvm-ar \
> HOSTLD=$NDK_TOOLCHAIN/ld.lld VF=1 DEBUG=1 NO_LIBELF=1 \
> NO_LIBTRACEEVENT=1 EXTRA_CFLAGS=-fgnuc-version=0 \
> -C tools/perf
>
> Given the test result, my conclusion is the doc for Android cross building
> is not useful for a long while. If we really want to support it, I would
> like to suggest to take a separate task for fixing LLVM / Clang cross
> compilation.
We could replace the entire contents of the file with something like
"Android NDK compilation deprecated -- no longer supported". It might
help someone in being able to recover the history of the file by leaving
in some keywords. If you delete it it becomes very unlikely that the
history will be found by someone trying to get it working again.
>
> Thanks,
> Leo
>
> [1] https://github.com/android/ndk/wiki/Changelog-r15
next prev parent reply other threads:[~2024-07-12 13:38 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
2024-07-12 5:37 ` Ian Rogers
2024-07-12 11:02 ` Leo Yan
2024-07-12 13:38 ` James Clark [this message]
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=83301e3e-e049-4af4-9f0b-29bdfc201543@linaro.org \
--to=james.clark@linaro.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=amadio@gentoo.org \
--cc=changbin.du@huawei.com \
--cc=irogers@google.com \
--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=namhyung@kernel.org \
--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
all inboxes | Powered by JetHome®