bug: failed to link libwasmedgeAOT.dylib, undefined symbols when rerun `ninja`
dannypsnl opened this issue · comments
Summary
There are undefined symbols let linker fails.
Current State
[29/297] Linking CXX shared library lib/aot/libwasmedgeAOT.dylib
FAILED: lib/aot/libwasmedgeAOT.dylib
: && /Library/Developer/CommandLineTools/usr/bin/c++ -g -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk -dynamiclib -Wl,-headerpad_max_install_names -o lib/aot/libwasmedgeAOT.dylib -install_name @rpath/libwasmedgeAOT.dylib lib/aot/CMakeFiles/wasmedgeAOT.dir/blake3.cpp.o lib/aot/CMakeFiles/wasmedgeAOT.dir/cache.cpp.o -Wl,-rpath,/Users/dannypsnl/secondstate/WasmEdge/build/lib/system -Wl,-rpath,/Users/dannypsnl/secondstate/WasmEdge/build/thirdparty/blake3 -Wl,-rpath,/Users/dannypsnl/secondstate/WasmEdge/build/lib/common -Wl,-rpath,/Users/dannypsnl/secondstate/WasmEdge/build/_deps/spdlog-build lib/system/libwasmedgeSystem.tbd thirdparty/blake3/libutilBlake3.tbd lib/common/libwasmedgeCommon.tbd _deps/spdlog-build/libspdlogd.1.11.0.tbd && :
ld: Undefined symbols:
WasmEdge::convertBytesToHexStr(cxx20::span<unsigned char const, 18446744073709551615ul>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, unsigned int, bool), referenced from:
WasmEdge::AOT::Cache::getPath(cxx20::span<unsigned char const, 18446744073709551615ul>, WasmEdge::AOT::Cache::StorageScope, std::__1::basic_string_view<char, std::__1::char_traits<char>>) in cache.cpp.o
WasmEdge::Path::home(), referenced from:
WasmEdge::AOT::(anonymous namespace)::getRoot(WasmEdge::AOT::Cache::StorageScope) in cache.cpp.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[42/297] Building CXX object lib/plugin/CMakeFiles/wasmedgePlugin.dir/plugin.cpp.o
ninja: build stopped: subcommand failed.
Expected State
Should not have this issue, since when I first invoke ninja
, the build process can complete.
Reproduction steps
- Run
cmake -DCMAKE_BUILD_TYPE=Debug -DWASMEDGE_PLUGIN_WASI_HTTP=ON -DWASMEDGE_BUILD_TOOLS=ON -GNinja ..
- Run
ninja
twice - Get error
Screenshots
![image](https://private-user-images.githubusercontent.com/22004511/311951506-98befa91-4170-446c-b9e4-eab92bef1a2f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTYyNTI3NzMsIm5iZiI6MTcxNjI1MjQ3MywicGF0aCI6Ii8yMjAwNDUxMS8zMTE5NTE1MDYtOThiZWZhOTEtNDE3MC00NDZjLWI5ZTQtZWFiOTJiZWYxYTJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTIxVDAwNDc1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkzMjE3NGY3ODkzMGY4NDEzYjRmMDYzNDkyYjU0OTc0OThiNTI0NjczN2FhZGEwZGQwNTAyOWI3MmJjNjM1ZGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zB_LUeSrnlHyN_EwilKJSenTKJHbDCzaPMdCKdikUUo)
Any logs you want to share for showing the specific issue
No response
Components
Others
WasmEdge Version or Commit you used
commit: 0c1460e
Operating system information
macOS 14.2.1 (23C71)
Hardware Architecture
aarch64
Compiler flags and options
- clang: 15.0.7
- cmake: 3.28.3
Let me update my system and retry.
Not occurred in macOS 14.4, close as now our program issue.