Skip to content

Commit

Permalink
GCC BPF support (#327)
Browse files Browse the repository at this point in the history
Merge libbpf/ci#164

Update kernel-build workflow and configs to run selftests/bpf with BPF
objects compiled with recent GCC BPF.

Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
  • Loading branch information
theihor authored Jan 16, 2025
1 parent a4ad95c commit ae60395
Show file tree
Hide file tree
Showing 3 changed files with 919 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/scripts/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def tests(self) -> Dict[str, Any]:
# if self.arch in [Arch.X86_64, Arch.AARCH64]:
# tests_list.append("sched_ext")

if self.arch == Arch.X86_64:
tests_list.append("test_progs-bpf_gcc")

if not self.parallel_tests:
tests_list = [test for test in tests_list if not test.endswith("parallel")]

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/kernel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ jobs:
timeout-minutes: 100
env:
ARTIFACTS_ARCHIVE: "vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}.tar.zst"

BUILD_BPF_GCC: ${{ inputs.arch == 'x86_64' && 'true' || '' }}
BPF_GCC_INSTALL_DIR: ${{ github.workspace }}/bpf-gcc

BPF_NEXT_BASE_BRANCH: 'master'
BPF_NEXT_FETCH_DEPTH: 64 # A bit of history is needed to facilitate incremental builds
# BUILD_SCHED_EXT_SELFTESTS: ${{ inputs.arch == 'x86_64' || inputs.arch == 'aarch64' && 'true' || '' }}
Expand Down Expand Up @@ -106,11 +110,19 @@ jobs:
kbuild-output: ${{ env.KBUILD_OUTPUT }}
max-make-jobs: 32
llvm-version: ${{ inputs.llvm-version }}

- if: ${{ env.BUILD_BPF_GCC }}
name: Build GCC for BPF selftests
uses: libbpf/ci/build-bpf-gcc@v3
with:
install-dir: ${{ env.BPF_GCC_INSTALL_DIR }}

- name: Build selftests/bpf
uses: libbpf/ci/build-selftests@v3
env:
MAX_MAKE_JOBS: 32
RELEASE: ${{ inputs.release && '1' || '' }}
BPF_GCC: ${{ env.BUILD_BPF_GCC && env.BPF_GCC_INSTALL_DIR || '' }}
with:
arch: ${{ inputs.arch }}
kernel-root: ${{ env.KERNEL_ROOT }}
Expand Down
Loading

0 comments on commit ae60395

Please sign in to comment.