I've faced some strange behavior when trying to build Chromium for Android arm arch based on checkout 100.0.4896.127. I've added some rust code and for arm64 arch it builds just fine but if I try to compile the same code for arm arch I get the following errors:
[1/6] SOLINK ./libchrome__combined.so
FAILED: libchrome__combined.so libchrome__combined.so.TOC lib.unstripped/libchrome__combined.so lib.unstripped/libchrome__combined.so.map.gz
python3 "../../build/toolchain/gcc_solink_wrapper.py" --readelf="../../third_party/llvm-build/Release+Asserts/bin/llvm-readelf" --nm="../../third_party/llvm-build/Release+Asserts/bin/llvm-nm" --strip=../../third_party/llvm-build/Release+Asserts/bin/llvm-strip --sofile="./lib.unstripped/libchrome__combined.so" --tocfile="./libchrome__combined.so.TOC" --map-file "./lib.unstripped/libchrome__combined.so.map.gz" --output="./libchrome__combined.so" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-soname="libchrome__combined.so" -Wl,--version-script=gen/chrome/android/libchrome_linker_script.txt -Wl,--hash-style=gnu -Wl,-soname,libchrome.so --partitioned-library -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -Wl,-mllvm,-import-instr-limit=5 -march=armv7-a -Wl,--no-rosegment -Wl,--no-call-graph-profile-sort -Wl,--exclude-libs=libvpx_assembly_arm.a --unwindlib=none --target=arm-linux-androideabi23 -no-canonical-prefixes -Wl,--warn-shared-textrel -Wl,-O2 -Wl,--gc-sections -nostdlib++ --sysroot=../../third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Wl,--warn-shared-textrel -Wl,-z,defs -Wl,--as-needed -Wl,--lto-O2 -Wl,--pack-dyn-relocs=android -Wl,-wrap,calloc -Wl,-wrap,free -Wl,-wrap,malloc -Wl,-wrap,memalign -Wl,-wrap,posix_memalign -Wl,-wrap,pvalloc -Wl,-wrap,realloc -Wl,-wrap,valloc -Wl,-wrap,realpath -Wl,-wrap,strdup -Wl,-wrap,strndup -Wl,-wrap,getcwd -Wl,-wrap,asprintf -Wl,-wrap,vasprintf -Wl,--dynamic-linker,/system/bin/linker -o "./lib.unstripped/libchrome__combined.so" @"./libchrome__combined.so.rsp"
ld.lld: error: undefined symbol: __sync_synchronize
>>> referenced by custom_rust.88h8kfpr-cgu.0
>>> custom_rust.custom_rust.88h8kfpr-cgu.0.rcgu.o:(_$LT$hashbrown..raw..RawTable$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::hae04102c385906b5) in archive ex_rust/out/arm/arm-linux-androideabi/release/libex_rust.a
>>> referenced by custom_rust.88h8kfpr-cgu.0
>>> custom_rust.custom_rust.88h8kfpr-cgu.0.rcgu.o:(_$LT$hashbrown..raw..RawTable$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::hfb3bf3ac01fde59c) in archive ex_rust/out/arm/arm-linux-androideabi/release/libex_rust.a
>>> referenced by custom_rust.88h8kfpr-cgu.4
>>> custom_rust.custom_rust.88h8kfpr-cgu.4.rcgu.o:(core::ptr::drop_in_place$LT$regex..dfa..Cache$GT$::h0ad6b25ba2b2a137 (.llvm.14177781091992271989)) in archive ex/out/arm/arm-linux-androideabi/release/libex_rust.a
>>> referenced 77 more times
Here is my args.gn:
target_os = "android"
is_debug = false
target_cpu = "arm"
is_component_build = false
is_official_build = true
android_channel = "stable"
proprietary_codecs = true
ffmpeg_branding = "Chrome"
enable_widevine = true
enable_nacl = false
use_official_google_api_keys=false
google_api_key = "no"
google_default_client_id = "no"
google_default_client_secret = "no"
enable_full_stack_frames_for_profiling = false
treat_warnings_as_errors=false
I've been using the same code earlier with 96.0.4664.104 Chromium checkout with no problems but now I've spent a lot of time trying to solve this issue with no success unfortunately.
I would appreciate any tips!