lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b16778b-f825-42a2-b53d-17c9b8c22a52@arm.com>
Date: Fri, 12 Jul 2024 12:02:05 +0100
From: Leo Yan <leo.yan@....com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
 Ian Rogers <irogers@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
 Mark Rutland <mark.rutland@....com>, Adrian Hunter
 <adrian.hunter@...el.com>, "Liang, Kan" <kan.liang@...ux.intel.com>,
 Nick Terrell <terrelln@...com>, Nathan Chancellor <nathan@...nel.org>,
 Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
 <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
 Thomas Richter <tmricht@...ux.ibm.com>, Changbin Du
 <changbin.du@...wei.com>, James Clark <james.clark@...aro.org>,
 amadio@...too.org, linux-kernel@...r.kernel.org,
 linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v3 7/7] perf docs: Remove the Android cross building
 document

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.

Thanks,
Leo

[1] https://github.com/android/ndk/wiki/Changelog-r15

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ