This article is a mirror article of machine translation, please click here to jump to the original article.

View: 178|Reply: 0

[Safety Tutorial] To compile the latest libbpf-bootstrap project, you must use the latest version of clang

[Copy link]
Posted on 2025-10-24 09:55:34 | | |
github clone libbpf-bootstrap directory
There is no makefile
There is cmakelist.txt
mkdir build
cd build
cmake ..
make
Upgrade Clang version (currently 10.0.0, older)

# Install Clang 12 (Ubuntu 20.04 can be installed directly)
sudo apt update && sudo apt install -y clang-12 llvm-12

# Switch the default Clang to version 12
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 100
sudo update-alternatives --install /usr/bin/llvm-strip llvm-strip /usr/bin/llvm-strip-12 100

# Validate the version
clang --version # should output 12.x.x


# Go back to the build directory to clean up the cache and compile the product
cd /home/sm/libbpf-bootstrap/examples/c/build
rm -rf * # Clean up old configurations and artifacts thoroughly

# Rerun the CMake configuration
cmake ..

# Recompile (prioritize compilation minimal_ns validation)
make minimal_ns

Compilation was successful




Previous:Linux set up a proxy to surf the Internet scientifically
Next:c language references
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com