You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android build fails to link: undefined symbol std::__ndk1::__libcpp_verbose_abort #8
Hi, I was interested in this package for the webcrypto integration (prebuilt & treeshaked). But we hit some error when trying it. My AI wrote me all this bellow, hope that help :-)
The Android build of libbssl_dart.so fails at the link step.
ld.lld: error: undefined symbol: std::__ndk1::__libcpp_verbose_abort(char const*, ...)
>>> referenced by stdexcept:253 (.../sysroot/usr/include/c++/v1/stdexcept:253)
>>> .../crypto/x509/by_dir.cc.o:(std::__ndk1::__throw_out_of_range[abi:nn210000](char const*))
clang: error: linker command failed with exit code 1 (use -v to see invocation)
On armeabi-v7a the same symbol is referenced from crypto/cpu_arm_linux.cc. On 0.4.1, this is the only failure.
Cause
The library is linked as C, without the C++ runtime. BoringSSL's C++ code is built with -fno-exceptions, but it still calls into libc++ when a bounds check fails. The NDK linker refuses undefined symbols.
Linux shows the same gap without an error. With GCC 13, main leaves std::__throw_out_of_range_fmt undefined in the .so. The library loads with lazy binding, but LD_BIND_NOW=1 makes it fail to load.
A possible fix
Upstream BoringSSL now expects libcrypto to have the C++ runtime. So we tried linking the runtime rather than avoiding it.
The runtime is linked statically, and its symbols stay hidden.
Activity