The version of llvm that comes with my system seems to optimize out a lot of operational details; i.e., I cannot step into certain llvm routines.
For this reason I am trying to build a debug version of llvm with no optimization; i.e.
Trying to do this with
g++ resulted in a signal 15 while trying to build a library,
so I switched to using clang.
This seemed to build fine. Then I went into my build directory and executed
and that seems to work but, when I tried to run the Kaleidoscope example I got:
build>bin/Kaleidoscope-Ch5 bin/Kaleidoscope-Ch5: symbol lookup error: bin/Kaleidoscope-Ch5: undefined symbol: _ZN4llvm23EnableABIBreakingChecksE, version LLVM_11
?? What I did wrong (more details are provided below) ??
I am using llvm
release/11.x brandh because that is what is also installed on my system.
I am assuming that llvm can build correctly even it it is previously already installed.
Here is the cmake command I am using to configure llvm:
cmake \ -D CMAKE_C_COMPILER=clang \ -D CMAKE_CXX_COMPILER=clang++ \ \ -D BUILD_SHARED_LIBS=OFF \ -D LLVM_PARALLEL_LINK_JOBS=1 \ -D CMAKE_BUILD_TYPE=Debug \ -D CMAKE_SKIP_RPATH=ON \ -D CMAKE_C_FLAGS="-O0" \ -D CMAKE_CXX_FLAGS="-O0" \ -D LLVM_LIBDIR_SUFFIX=64 \ -D LLVM_TARGETS_TO_BUILD='Native' \ -D LLVM_ENABLE_LIBCXX=OFF \ -D LLVM_ENABLE_ZLIB=ON \ -D LLVM_ENABLE_FFI=ON \ -D LLVM_ENABLE_RTTI=ON \ -D LLVM_BUILD_RUNTIME=ON \ -D LLVM_INCLUDE_TOOLS=ON \ -D LLVM_BUILD_TOOLS=ON \ -D LLVM_INCLUDE_TESTS=ON \ -D LLVM_BUILD_TESTS=ON \ -D LLVM_INCLUDE_EXAMPLES=ON \ -D LLVM_BUILD_EXAMPLES=OFF \ -D LLVM_INCLUDE_UTILS=ON \ -D LLVM_INSTALL_UTILS=ON \ -D LLVM_TOOLS_INSTALL_DIR:PATH=bin \ -D LLVM_INCLUDE_DOCS=OFF \ -D LLVM_BUILD_DOCS=OFF \ -D LLVM_ENABLE_SPHINX=OFF \ -D LLVM_ENABLE_DOXYGEN=OFF \ -D LLVM_BUILD_LLVM_DYLIB=ON \ -D LLVM_DYLIB_EXPORT_ALL=ON \ -D LLVM_LINK_LLVM_DYLIB=ON \ -D LLVM_BUILD_EXTERNAL_COMPILER_RT=ON \ -D LLVM_INSTALL_TOOLCHAIN_ONLY=OFF \ -D CMAKE_INSTALL_PREFIX="$HOME/prefix/llvm" \ ../llvm
Here is a brief description of the system I am using:
llvm.git>uname -a Linux localhost.localdomain 5.9.13-200.fc33.x86_64 #1 SMP Tue Dec 8 15:42:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux ``