0

For a quiet some time I'm trying to build Android 11 for Sony Xperia XZ2 H8266. Everytime process comes to build org.apache.http.legacy package it gets an error.

[ 99% 263/264] //external/apache-http:org.apache.http.legacy dexpreopt [common]
FAILED: out/soong/.intermediates/external/apache-http/org.apache.http.legacy/and
roid_common/dexpreopt/profile.prof
ANDROID_LOG_TAGS="*:e" out/soong/host/linux-x86/bin/profman --create-profile-fro
m=external/apache-http/art-profile --apk=out/soong/.intermediates/external/apach
e-http/org.apache.http.legacy/android_common/aligned/org.apache.http.legacy.jar 
--dex-location=/system/framework/org.apache.http.legacy.jar --reference-profile-
file=out/soong/.intermediates/external/apache-http/org.apache.http.legacy/androi
d_common/dexpreopt/profile.prof
Illegal instruction (core dumped)
18:31:01 ninja failed with: exit status 1

I'm using old PowerEdge 2950 with 2 quad-core Xeon CPUs with 32 Gb RAM running with Debian 11 and Ubuntu 20.04. Both systems give me same output. I've read that org.apache.http.legacy is deprecated package. I would appreciate same hint where to look for the core of the problem.

Thanks in advance. DoomRider

DoomRider
  • 1
  • 1

1 Answers1

0

I'm not yet fully confident in this answer, but I just ran into a very similar issue - same style profman invocation while building lineage19/android12 on a fairly ancient core2duo*

What seems to have worked for me is commenting out the -mfma and -mavx2 cflags in art/build/Android.bp. My netresearch that led to that seemed to suggest that those flags are honored by clang/llvm on build systems whose cpu don't support those instructions due to the use-case of (cross)compiling binaries that could be used on systems with cpus that do have avx2 support.

I'm guessing there is a more proper way to tell the aosp buildsystem to disable avx2 and thus not use those flags, perhaps a bug that it isn't detecting that situation correctly right now.

*(with 8G of ram, and let me throw in that I just discovered that using a (cheap western digital blue) ssd for swap seems to have taken about a dozen soong swapthrash hours off of the build :). Debian 11 x86_64.