[ 99%] Linking CXX executable test_libbcc Fails During bcc Build from Source
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
clang --version
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
uname -r
5.15.0-46-generic
make command ends up in an error like this. Could someone please advice how to get pass this??
[ 9%] Built target bpf-static
[ 11%] Built target clang_frontend
[ 13%] Built target bcc-loader-static
[ 14%] Built target api-static
[ 15%] Built target usdt-static
[ 21%] Built target bcc-static
[ 30%] Built target bpf-shared
[ 36%] Built target bcc-shared
[ 36%] Built target bcc_py_python3
[ 37%] Built target bps
[ 37%] Built target CGroupTest
[ 37%] Built target UseExternalMap
[ 37%] Built target FollyRequestContextSwitch
[ 37%] Built target SkLocalStorageIterator
[ 38%] Built target HelloWorld
[ 39%] Built target RecordMySQLQuery
[ 40%] Built target CPUDistribution
[ 41%] Built target TaskIterator
[ 42%] Built target KFuncExample
[ 43%] Built target TCPSendStack
[ 43%] Built target KModRetExample
[ 44%] Built target LLCStat
[ 45%] Built target RandomRead
[ 92%] Built target man
Scanning dependencies of target usdt_test_lib
[ 92%] Building CXX object tests/cc/CMakeFiles/usdt_test_lib.dir/usdt_test_lib.cc.o
[ 93%] Linking CXX shared library libusdt_test_lib.so
[ 93%] Built target usdt_test_lib
Scanning dependencies of target test_libbcc
[ 93%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_libbcc.cc.o
[ 94%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_c_api.cc.o
[ 94%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_array_table.cc.o
[ 94%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_bpf_table.cc.o
[ 95%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_cg_storage.cc.o
[ 95%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_hash_table.cc.o
[ 95%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_map_in_map.cc.o
[ 96%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_perf_event.cc.o
[ 96%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_pinned_table.cc.o
[ 96%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_prog_table.cc.o
[ 97%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_queuestack_table.cc.o
[ 97%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_shared_table.cc.o
[ 97%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_sk_storage.cc.o
[ 98%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_sock_table.cc.o
[ 98%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_usdt_args.cc.o
[ 98%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_usdt_probes.cc.o
[ 99%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/utils.cc.o
[ 99%] Building CXX object tests/cc/CMakeFiles/test_libbcc.dir/test_parse_tracepoint.cc.o
[ 99%] Linking CXX executable test_libbcc
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::detail::scalbn(llvm::detail::IEEEFloat, int, llvm::APFloatBase::roundingMode)'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::createHWAddressSanitizerPass(bool, bool)'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::sys::MutexImpl::~MutexImpl()'
....
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::sys::MutexImpl::acquire()'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::LockFileManager::waitForUnlock()'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::APFloat::convertToInteger(llvm::APSInt&, llvm::APFloatBase::roundingMode, bool*) const'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `typeinfo for llvm::FoldingSetBase'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::Function::Function(llvm::FunctionType*, llvm::GlobalValue::LinkageTypes, llvm::Twine const&, llvm::Module*)'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::LLVMContext::setDiagnosticsHotnessThreshold(unsigned long)'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::Intrinsic::getDeclaration(llvm::Module*, llvm::Intrinsic::ID, llvm::ArrayRef)'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::detail::DoubleAPFloat::multiply(llvm::detail::DoubleAPFloat const&, llvm::APFloatBase::roundingMode)'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::AttrBuilder::addStackAlignmentAttr(unsigned int)'
/usr/bin/ld: ../../src/cc/libbcc.so: undefined reference to `llvm::Value::stripInBoundsOffsets() const'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/cc/CMakeFiles/test_libbcc.dir/build.make:341: tests/cc/test_libbcc] Error 1
make[1]: *** [CMakeFiles/Makefile2:1581: tests/cc/CMakeFiles/test_libbcc.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure by running the source build and focus on the link step for tests/cc/test_libbcc.cc and the other tests/cc sources. Inspect how src/cc/libbcc.so is linked, then verify that the test_libbcc executable links successfully and the build completes without undefined LLVM references.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100