Issue |
131119
|
Summary |
Tools linking against libLLVM don't specify zlib path
|
Labels |
new issue
|
Assignees |
|
Reporter |
Zentrik
|
I'm trying to build llvm on a system where zlib is not installed in the search path, to do this I'm using `-DLLVM_ENABLE_ZLIB=FORCE_ON -DZLIB_ROOT=my_path`. `libLLVM.so` builds but tools that link against `libLLVM.so` fail as they don't specify the path to zlib, e.g.
```
/usr/local/bin/g++ -m64 -fno-gnu-unique -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -ffunction-sections -fdata-sections -O3 -DNDEBUG -Wl,-rpath-link,[buildroot]/deps/scratch/llvm-9191f0d890728ba959cb2b2a76e3ab914069cabc/build_Release/./lib -Wl,--gc-sections CMakeFiles/dsymutil.dir/dsymutil.cpp.o CMakeFiles/dsymutil.dir/BinaryHolder.cpp.o CMakeFiles/dsymutil.dir/CFBundle.cpp.o CMakeFiles/dsymutil.dir/DebugMap.cpp.o CMakeFiles/dsymutil.dir/DwarfLinkerForBinary.cpp.o CMakeFiles/dsymutil.dir/MachODebugMapParser.cpp.o CMakeFiles/dsymutil.dir/MachOUtils.cpp.o CMakeFiles/dsymutil.dir/Reproducer.cpp.o CMakeFiles/dsymutil.dir/RelocationMap.cpp.o "CMakeFiles/dsymutil.dir/dsymutil-driver.cpp.o" -o ../../bin/dsymutil -Wl,-rpath,"\$ORIGIN/../lib:[buildroot]/deps/scratch/llvm-9191f0d890728ba959cb2b2a76e3ab914069cabc/build_Release/lib:" ../../lib/libLLVM.so.20.1jl -lpthread
/usr/local/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../x86_64-linux-gnu/bin/ld: warning: libz.so.1, needed by ../../lib/libLLVM.so.20.1jl, not found (try using -rpath or -rpath-link)
/usr/local/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../x86_64-linux-gnu/bin/ld: ../../lib/libLLVM.so.20.1jl: undefined reference to `compress2'
/usr/local/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../x86_64-linux-gnu/bin/ld: ../../lib/libLLVM.so.20.1jl: undefined reference to `crc32'
/usr/local/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../x86_64-linux-gnu/bin/ld: ../../lib/libLLVM.so.20.1jl: undefined reference to `compressBound@ZLIB_1.2.0'
/usr/local/bin/../lib/gcc/x86_64-linux-gnu/9.1.0/../../../../x86_64-linux-gnu/bin/ld: ../../lib/libLLVM.so.20.1jl: undefined reference to `uncompress'
collect2: error: ld returned 1 exit status
```
Full cmake command is (`[buildroot]` is just an abbreviation to keep the printed command shorter)
```
[buildroot]/deps/scratch/cmake-3.30.1-linux-x86_64/bin/cmake [buildroot]/deps/srccache/llvm-9191f0d890728ba959cb2b2a76e3ab914069cabc/llvm -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=[buildroot]/usr -DCMAKE_PREFIX_PATH=[buildroot]/usr -DLIB_INSTALL_DIR=[buildroot]/usr/lib -DCMAKE_INSTALL_LIBDIR=[buildroot]/usr/lib -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_C_COMPILER="$(which gcc)" -DCMAKE_C_COMPILER_ARG1="-m64 " -DCMAKE_CXX_COMPILER="$(which g++)" -DCMAKE_CXX_COMPILER_ARG1="-m64 " -DCMAKE_LINKER="$(which ld)" -DCMAKE_AR="$(which ar)" -DCMAKE_RANLIB="$(which ranlib)" -DLLVM_ENABLE_PROJECTS=";lld" -DLLVM_EXTERNAL_PROJECTS="" -DLLVM_ENABLE_RUNTIMES="" -DLLVM_WINDOWS_PREFER_FORWARD_SLASH=False -DLLVM_TARGETS_TO_BUILD:STRING="host;NVPTX;AMDGPU;WebAssembly;BPF;AVR" -DCMAKE_BUILD_TYPE="Release" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD:STRING="" -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_HOST_TRIPLE="x86_64-linux-gnu" -DLLVM_ENABLE_ZLIB=FORCE_ON -DZLIB_ROOT="[buildroot]/usr" -DLLVM_ENABLE_ZSTD=OFF -DLLVM_TOOLS_INSTALL_DIR=tools -DLLVM_UTILS_INSTALL_DIR=tools -DLLVM_INCLUDE_UTILS=ON -DLLVM_INSTALL_UTILS=ON -DLLVM_BINDINGS_LIST="" -DLLVM_ENABLE_BINDINGS=OFF -DLLVM_INCLUDE_DOCS=Off -DLLVM_ENABLE_TERMINFO=Off -DHAVE_LIBEDIT=Off -DLLVM_ENABLE_LIBEDIT=OFF -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON -DLLVM_LINK_LLVM_DYLIB:BOOL=ON -DLLVM_USE_PERF:BOOL=ON -DCMAKE_C_FLAGS=" " -DCMAKE_CXX_FLAGS=" -fno-gnu-unique" -DLLVM_TOOL_CLANG_BUILD=OFF -DLLVM_TOOL_COMPILER_RT_BUILD=OFF -DLLVM_TOOL_LLDB_BUILD=OFF -DCMAKE_EXE_LINKER_FLAGS="" -DCMAKE_SHARED_LINKER_FLAGS="" -DLLVM_VERSION_SUFFIX:STRING="jl" -DLLVM_SHLIB_SYMBOL_VERSION:STRING="JL_LLVM_20.1" -DBUG_REPORT_URL="https://github.com/julialang/julia"
```
Full log at https://buildkite.com/organizations/julialang/pipelines/julia-master/builds/45658/jobs/0195848d-ef49-4d05-8305-8e6914a1883c/download.txt
Am I doing something wrong or is this a bug, and if so any pointers on how to fix it.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs