Bpftool sync 2025-10-07 #206
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: static LLVM build | |
| on: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/static-build.yaml' | |
| - 'include/**' | |
| - 'libbpf/**' | |
| - 'src/**' | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| LLVM_URL_PREFIX: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.0 | |
| LLVM_PATH: clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4 | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libelf-dev libssl-dev | |
| - name: Download and extract compiled LLVM release | |
| run: | | |
| curl -L -O "${{ env.LLVM_URL_PREFIX }}/${{ env.LLVM_PATH }}.tar.xz" | |
| tar -xvf "${{ env.LLVM_PATH }}.tar.xz" | |
| - name: Checkout bpftool | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| submodules: recursive | |
| # Create a new directory to avoid wiping out LLVM on bpftool checkout | |
| path: 'bpftool' | |
| - name: Build bpftool (static build, default LLVM disassembler) | |
| working-directory: 'bpftool' | |
| run: | | |
| EXTRA_LDFLAGS=-static \ | |
| LLVM_CONFIG="${GITHUB_WORKSPACE}/${LLVM_PATH}/bin/llvm-config" \ | |
| LLVM_STRIP="${GITHUB_WORKSPACE}/${LLVM_PATH}/bin/llvm-strip" \ | |
| make -j -C src V=1 | |
| - name: Test bpftool binary | |
| working-directory: 'bpftool' | |
| run: | | |
| ./src/bpftool 2>&1 | grep -q Usage | |
| ./src/bpftool -p version | \ | |
| tee /dev/stderr | \ | |
| jq --exit-status ".features | .llvm" | |
| ldd ./src/bpftool 2>&1 | \ | |
| tee /dev/stderr | \ | |
| grep -q 'not a dynamic executable' |