Interestingly, it's not failing on an android target, but on a host target:
"python3" "../../build/toolchain/gcc_link_wrapper.py" --output="clang_x64/make_top_domain_list_variables" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Werror -fPIC --target=x86_64-unknown-linux-gnu -no-canonical-prefixes -Wl,-z,defs -Wl,--as-needed -nostdlib++ --sysroot=../../build/linux/debian_bullseye_amd64-sysroot -Wl,--linker-path=../../buildtools/third_party/mold/cipd/bin/mold --ld-path=../../buildtools/third_party/mold/mold_wrapper.py -Wl,--fatal-warnings -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--undefined-version -rdynamic -pie -Wl,--disable-new-dtags -o "clang_x64/make_top_domain_list_variables" -Wl,--start-group @"clang_x64/make_top_domain_list_variables.rsp" -Wl,--end-group ../../third_party/llvm-build/Release+Asserts/lib/clang/23/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a -ldl -lpthread -lrt -lnspr4 -lnss3 -lnssutil3 -lplc4 -lplds4 -lsmime3 -lresolv -Wl,--start-group clang_x64/obj/third_party/rust/cxx/v1/lib/libcxx_lib.rlib clang_x64/obj/third_party/rust/foldhash/v0_2/lib/libfoldhash_lib.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_std.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_alloc.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins_compiler_builtins.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore_core.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libprofiler_builtins_profiler_builtins.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if_cfg_if.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core_rustc_std_workspace_core.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown_hashbrown.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc_rustc_std_workspace_alloc.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_abort_panic_abort.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle_rustc_demangle.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect_std_detect.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc_libc.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind_unwind.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line_addr2line.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli_gimli.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide_miniz_oxide.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2_adler2.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject_object.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr_memchr.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts_getopts.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_std_rustc_std_workspace_std.rlib clang_x64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest_test.rlib clang_x64/obj/build/rust/allocator/liballocator_6ead5877.rlib clang_x64/obj/build/rust/allocator/liballoc_error_handler_impl_ffi.rlib clang_x64/obj/build/rust/allocator/liballocator_impls_ffi.rlib clang_x64/obj/base/logging/rust_logger/librust_logger_8bf89ddc.rlib clang_x64/obj/base/logging/liblog_severity_bindgen_5c984a66.rlib clang_x64/obj/third_party/rust/log/v0_4/lib/liblog_lib.rlib clang_x64/obj/build/rust/chromium_prelude/libchromium.rlib clang_x64/obj/third_party/rust/serde_json_lenient/v0_2/wrapper/libwrapper_a1515e45.rlib clang_x64/obj/third_party/rust/serde/v1/lib/libserde_lib.rlib clang_x64/obj/third_party/rust/serde_core/v1/lib/libserde_core_lib.rlib clang_x64/obj/third_party/rust/serde_json_lenient/v0_2/lib/libserde_json_lenient_lib.rlib clang_x64/obj/third_party/rust/itoa/v1/lib/libitoa_lib.rlib clang_x64/obj/third_party/rust/memchr/v2/lib/libmemchr_lib.rlib clang_x64/obj/third_party/rust/ryu/v1/lib/libryu_lib.rlib -Wl,--end-group
build step: clang_x64_link "./clang_x64/make_top_domain_list_variables"
siso_rule: clang/link
stderr:
mold: error: ../../build/linux/debian_bullseye_amd64-sysroot/usr/lib/x86_64-linux-gnu/libnspr4.so: --no-allow-shlib-undefined: undefined symbol: gettid
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
build failed
wild had the same issue, and their fix was: wild-linker/wild@6b2086f
To reproduce in a chrome checkout, use GN args (note that use_mold is newly introduced:
target_os="android"
target_cpu="x64"
use_mold=true
and run:
autoninja -C out/Debug clang_x64/make_top_domain_list_variables
I think it's the same issue, but there's also:
mold: error: undefined symbol: std::__Cr::chrono::steady_clock::now()
>>> referenced by cycleclock.cc
>>> obj/third_party/abseil-cpp/absl/base/base/cycleclock.o:(absl::base_internal::CycleClock::Now())
mold: error: undefined symbol: std::__Cr::thread::hardware_concurrency()
>>> referenced by sysinfo.cc
>>> obj/third_party/abseil-cpp/absl/base/base/sysinfo.o:(void absl::base_internal::CallOnceImpl<absl::base_internal::NumCPUs()::$_0>(std::__Cr::atomic<unsigned int>*, absl::base_internal::SchedulingMode, absl::base_internal::NumCPUs()::$_0&&))
This happens when you try to build: libcrashpad_handler_trampoline.so without the no_default_deps opt-out for use_mold condition here:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/crashpad/crashpad/handler/BUILD.gn;drc=f003c3321a7ce68cbe3fee494e2c700f9202de4f;l=236
Interestingly, it's not failing on an android target, but on a host target:
wildhad the same issue, and their fix was: wild-linker/wild@6b2086fTo reproduce in a chrome checkout, use GN args (note that
use_moldis newly introduced:and run:
I think it's the same issue, but there's also:
This happens when you try to build:
libcrashpad_handler_trampoline.sowithout theno_default_depsopt-out foruse_moldcondition here:https://source.chromium.org/chromium/chromium/src/+/main:third_party/crashpad/crashpad/handler/BUILD.gn;drc=f003c3321a7ce68cbe3fee494e2c700f9202de4f;l=236