Link failed with error " undefined reference to 'std::__1::__.... "

934 views
Skip to first unread message

Tie Sun

unread,
Nov 14, 2020, 10:47:34 AM11/14/20
to v8-u...@googlegroups.com
Version: <8.0>
OS: <MacOS Catalina 10.15.7>
Architecture: <ARM64>

Link failed with errors as below:

[1/1] LINK ./d8

FAILED: d8 exe.unstripped/d8 exe.unstripped/d8.map.gz 

python "../../build/toolchain/gcc_link_wrapper.py" --output="./d8" --strip="../../buildtools/third_party/eu-strip/bin/eu-strip" --unstripped-file="./exe.unstripped/d8" --map-file "./exe.unstripped/d8.map.gz" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,--as-needed -fuse-ld=gold -Wl,--icf=all -Wl,--exclude-libs=libgcc.a -Wl,--exclude-libs=libvpx_assembly_arm.a --target=aarch64-linux-android21 -Wl,-mllvm,-enable-machine-outliner=never --sysroot=../../third_party/android_ndk/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -B../../third_party/android_ndk/toolchains/llvm/prebuilt/darwin-x86_64 -Wl,--warn-shared-textrel -pie -Bdynamic -Wl,-z,nocopyreloc -Wl,--warn-shared-textrel -Wl,-O2 -Wl,--gc-sections -o "./exe.unstripped/d8" -Wl,--start-group @"./d8.rsp"  -Wl,--end-group  -ldl -lm -llog

../../third_party/android_ndk/toolchains/llvm/prebuilt/darwin-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld.gold: warning: cannot find entry symbol 'nable-machine-outliner=never'

obj/d8/d8-platforms.o:d8-platforms.cc:function std::__1::__shared_weak_count::__release_shared(): error: undefined reference to 'std::__1::__shared_weak_count::__release_weak()'

obj/d8/d8.o:d8.cc:function std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::unique_ptr<v8::ScriptCompiler::CachedData, std::__1::default_delete<v8::ScriptCompiler::CachedData> > >::~pair(): error: undefined reference to 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'

clang: error: linker command failed with exit code 1 (use -v to see invocation)

ninja: build stopped: subcommand failed.


And here is args.gn:
======================================
is_debug = false
is_component_build = false
target_os = "android"
target_cpu = "arm64"
v8_target_cpu = "arm64"
v8_use_external_startup_data=false
v8_enable_handle_zapping=false
v8_monolithic=true
is_official_build=true
v8_enable_i18n_support=false
v8_untrusted_code_mitigations=false
use_custom_libcxx = false
use_thin_lto = false
v8_enable_lite_mode = true
v8_enable_wasm = false
v8_enable_debugger = false
v8_enable_minor_mc = false
symbol_level = 0
use_lld = false
clang_use_chrome_plugins = false
=======================================

Thanks for help!

Best regards!

Ben Ernst

unread,
Nov 16, 2020, 7:13:48 PM11/16/20
to v8-users
This may not be very helpful, I work on Windows, but you may find that if you "use_custom_libcxx = false", you also have to "use_clang=false". This seems to be the case on Windows.
Ben
Reply all
Reply to author
Forward
0 new messages