Skip to content

BCC source setup make error on Debian Bookworm #5015

Open
@VishnuVelayuthan

Description

@VishnuVelayuthan

I'm trying to compile BCC from source in a debian bookworm container (specs listed below) on my Ubuntu Jammy system.

It compiles perfectly on my Ubuntu system, however, when I followed the setup steps on Debian (configuring sid, downloading the build tools) I was faced with a make error when running make in the bcc/build directory. It threw the following error:
make[2]: *** No rule to make target '/usr/lib/llvm-16/lib/libPolly.a', needed by 'src/cc/libbcc.so.0.30.0'. Stop. make[1]: *** [CMakeFiles/Makefile2:780: src/cc/CMakeFiles/bcc-shared.dir/all] Error 2
At around 20% on the first time I ran the command and 14% on subsequent runs. The Makefile seems to be missing a rule to build a the /usr/lib/llvm-16/lib/libPolly.a file while trying to build CXX object src/cc/CMakeFiles/bcc-shared.dir/common.cc.o

To simply test and hack a solution, I created an empty /usr/lib/llvm-16/lib/libPolly.a file and kept on going with the build process. Right, after, I received another error:
make[2]: *** No rule to make target '/usr/lib/llvm-16/lib/libPollyISL.a', needed by 'src/cc/libbcc.so.0.30.0'. Stop. make[1]: *** [CMakeFiles/Makefile2:780: src/cc/CMakeFiles/bcc-shared.dir/all] Error 2 make: *** [Makefile:146: all] Error 2
image

I touched and created another empty file by the name of '/usr/lib/llvm-16/lib/libPollyISL.a' to keep on going ahead with the build process. I'm then faced with another error (as expected) at around 38%:
image
Here's the trace:
/usr/bin/ld: /usr/lib/llvm-16/lib/libclangCodeGen.a(BackendUtil.cpp.o): in function `(anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >&, std::unique_ptr<llvm::ToolOutputFile, std::default_delete<llvm::ToolOutputFile> >&)': (.text._ZN12_GLOBAL__N_118EmitAssemblyHelper23RunOptimizationPipelineEN5clang13BackendActionERSt10unique_ptrIN4llvm17raw_pwrite_streamESt14default_deleteIS5_EERS3_INS4_14ToolOutputFileES6_ISA_EE+0x14ad): undefined reference to `getPollyPluginInfo()' /usr/bin/ld: /usr/lib/llvm-16/lib/libLLVMLTO.a(LTOBackend.cpp.o): in function `llvm::lto::opt(llvm::lto::Config const&, llvm::TargetMachine*, unsigned int, llvm::Module&, bool, llvm::ModuleSummaryIndex*, llvm::ModuleSummaryIndex const*, std::vector<unsigned char, std::allocator<unsigned char> > const&)': (.text._ZN4llvm3lto3optERKNS0_6ConfigEPNS_13TargetMachineEjRNS_6ModuleEbPNS_18ModuleSummaryIndexEPKS8_RKSt6vectorIhSaIhEE+0x8e5): undefined reference to `getPollyPluginInfo()' /usr/bin/ld: /usr/lib/llvm-16/lib/libLLVMExtensions.a(Extensions.cpp.o): in function `llvm::details::extensions_anchor()': (.text._ZN4llvm7details17extensions_anchorEv+0x1a): undefined reference to `getPollyPluginInfo()' collect2: error: ld returned 1 exit status make[2]: *** [examples/cpp/CMakeFiles/CGroupTest.dir/build.make:184: examples/cpp/CGroupTest] Error 1 make[1]: *** [CMakeFiles/Makefile2:1127: examples/cpp/CMakeFiles/CGroupTest.dir/all] Error 2 make: *** [Makefile:146: all] Error 2

Could someone please help me fix this problem as I need to build this tool in Debian to test it out on a machine that runs on Debian. Let me know if more information is required. Here are the specs of my image:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions