Open muzinian opened 2 weeks ago
And the cmake version I use is 3.22.1. I installed LLVM according to the Automatic installation script on the LLVM apt package page and manually created a symbolic link for ld.lld
to ld.lld-18
(version is Ubuntu LLD 18.1.8 (compatible with GNU linkers)
). The ld
version is GNU ld (GNU Binutils for Ubuntu) 2.38
I am able to compile BCC with LLVM 18.1.3. Here is my output for cmake
if that helps:
I am able to compile BCC with LLVM 18.1.3. Here is my output for
cmake
if that helps:cmake output
CC=clang CXX=clang++ cmake -B build . CMake Deprecation Warning at CMakeLists.txt:3 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. -- The C compiler identification is Clang 18.1.3 -- The CXX compiler identification is Clang 18.1.3 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/clang - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/clang++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Currently on Git tag v0.31.0 -- Git HEAD is -- Revision is 0.31.0 (major 0, minor 31, patch 0) -- Performing Test HAVE_NO_PIE_FLAG -- Performing Test HAVE_NO_PIE_FLAG - Success -- Performing Test HAVE_REALLOCARRAY_SUPPORT -- Performing Test HAVE_REALLOCARRAY_SUPPORT - Success -- Kernel release: 6.10.6-orbstack-00249-g92ad2848917c -- Kernel headers: KERNELHEADERS_DIR-NOTFOUND -- Performing Test HAVE_FFI_CALL -- Performing Test HAVE_FFI_CALL - Success -- Found FFI: /usr/lib/aarch64-linux-gnu/libffi.so -- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES) -- Performing Test Terminfo_LINKABLE -- Performing Test Terminfo_LINKABLE - Success -- Found Terminfo: /usr/lib/aarch64-linux-gnu/libtinfo.so -- Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found version "1.3") -- Found zstd: /usr/lib/aarch64-linux-gnu/libzstd.so -- Found LibXml2: /usr/lib/aarch64-linux-gnu/libxml2.so (found version "2.9.14") -- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR) -- Found LLVM: /usr/lib/llvm-18/include 18.1.3 (Use LLVM_ROOT envronment variable for another version of LLVM) -- Could NOT find BISON (missing: BISON_EXECUTABLE) -- Could NOT find FLEX (missing: FLEX_EXECUTABLE) -- Found LibElf: /usr/lib/aarch64-linux-gnu/libelf.so -- Performing Test ELF_GETSHDRSTRNDX -- Performing Test ELF_GETSHDRSTRNDX - Success -- Could NOT find LibDebuginfod (missing: LIBDEBUGINFOD_LIBRARIES LIBDEBUGINFOD_INCLUDE_DIRS) -- Could NOT find LibLzma (missing: LIBLZMA_LIBRARIES LIBLZMA_INCLUDE_DIRS) -- Could NOT find LuaJIT (missing: LUAJIT_LIBRARIES LUAJIT_INCLUDE_DIR) -- Configuring done (1.3s) -- Generating done (0.2s)
According to the documentation, bison and flex are required. Why is it that in your output, bison and flex were not found, yet the build was still successful? Did I misunderstand something? Please point out my mistake, thank you.
When I was building bcc using LLVM18 on Ubuntu, I encountered various issues. The system version I was using is as follows:
lsb_release -a
cc -v
c++ -v
At first, I made modifications to
CMakeLists.txt
based on the results of executingcmake ..
. I addedwithin the
if
logic that checks for versions greater than 3.12.0, in order to avoid the CMP0075 issue. Additionally, to output the results of certain options, I added the following print statements at the end:And the result output of
cmake ..
is:After these operations, I performed the
cmake ..
andmake
commands according to the documentation, but ultimately encountered the following error:Based on the error message, I suspected there might be a conflict in the libraries (I don't have much knowledge of C/C++ itself, this is just a simple guess based on google and ChatGPT). Therefore, I modified the
CMakeLists.txt
file, making changes to the following parts:It would then report a massive number of undefined reference errors at the stage of [ 39%] Linking CXX executable CGroupTest.For example:
The above is just a part of the entire error output, which is approximately 30,000 lines long and mostly consists of various
undefined reference
errors. What confuses me is that the previouscmake
output already shows that the choosenlinker
isld.lld
, but here it seems the linker is still/usr/bin/ld
.And even if I only modified theCMAKE_CXX_FLAGS
part, the same error was reported.