Issue 132845
Summary [LLDB] libxml2 __xmlFree linker issue
Labels new issue
Assignees
Reporter wizardengineer
    I was working on LLDB, refactoring some code then randomly got an issue relating to libxml2. I had assume it was because of the patches I've done, but after clone a fresh llvm, i tried compiling again and got the same isssue

**Cmake command:**
```
cmake -G Ninja \
 -DCMAKE_BUILD_TYPE=Release \
  -DLLVM_ENABLE_PROJECTS="clang;lldb" \
 -DCMAKE_C_COMPILER=clang \
  -DCMAKE_CXX_COMPILER=clang++ \
 -DLLVM_TARGET_ARCH=AArch64 \
  -DLLVM_USE_LINKER=lld \
 -DPython3_EXECUTABLE=/Users/juliusalexandre/venv-packaging/bin/python3 \
 -DLLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \
 -DCMAKE_OSX_DEPLOYMENT_TARGET=15.3 \
  -DLLDB_ENABLE_LIBXML2=Off \
 -DLLDB_ENABLE_PYTHON=ON \ -DBUILD_SHARED_LIBS=ON \
  -C ../lldb/cmake/caches/Apple-lldb-macOS.cmake \
 -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
 ../llvm
```

after running `ninja`:
<details>
<summary>Linker Error</summary>

```
[5461/5500] Linking CXX executable bin/llvm-mt
FAILED: bin/llvm-mt
: && /usr/bin/clang++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic 
-Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default 
-Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -O3 -DNDEBUG -arch arm64 
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mmacosx-version-min=15.3 -Wl,-search_paths_first -Wl,
-headerpad_max_install_names -fuse-ld=lld -Wl,--color-diagnostics -Wl,-dead_strip 
-Wl,-no_exported_symbols tools/llvm-mt/CMakeFiles/llvm-mt.dir/llvm-mt.cpp.o 
tools/llvm-mt/CMakeFiles/llvm-mt.dir/llvm-mt-driver.cpp.o -o bin/llvm-mt -Wl,-rpath,@loader_path/../lib  
lib/libLLVMOption.a  lib/libLLVMSupport.a lib/libLLVMWindowsManifest.a  -lm /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/libz.tbd 
/opt/homebrew/lib/libzstd.dylib  lib/libLLVMDemangle.a /Applications/Xcode.app/Contents/Developer/Platforms/
MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/libxml2.tbd && :
ld64.lld: error: undefined symbol: __xmlFree
>>> referenced by lib/libLLVMWindowsManifest.a(WindowsManifestMerger.cpp.o):(symbol treeMerge(_xmlNode*, _xmlNode*)+0x868)
>>> referenced by lib/libLLVMWindowsManifest.a(WindowsManifestMerger.cpp.o):(symbol treeMerge(_xmlNode*, _xmlNode*)+0x854)
>>> referenced by lib/libLLVMWindowsManifest.a(WindowsManifestMerger.cpp.o):(symbol llvm::windows_manifest::WindowsManifestMerger::WindowsManifestMergerImpl::getMergedManifest()+0xd4)
>>> referenced 1 more times
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[5470/5500] Linking CXX executable bin/llvm-opt-fuzzer
ninja: build stopped: subcommand failed.
```
</details>
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to