Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build-bpf-gcc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ inputs:
install-dir:
description: "Path to the GCC installation directory"
required: true
gcc-version:
description: "Major GCC version to build (e.g. 15, 16)"
required: false
default: "15"

runs:
using: "composite"
Expand All @@ -12,6 +16,8 @@ runs:
- name: Determine latest snapshots
id: latest-snapshots
shell: bash
env:
GCC_VERSION: ${{ inputs.gcc-version }}
run: ${GITHUB_ACTION_PATH}/latest-snapshots.sh

- uses: actions/cache@v4
Expand Down
7 changes: 5 additions & 2 deletions build-bpf-gcc/latest-snapshots.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/bin/bash
set -euo pipefail

# Major GCC version to build; defaults to 15 for backward compatibility.
GCC_VERSION="${GCC_VERSION:-15}"

BINUTILS_TARBALL=$(wget https://snapshots.sourceware.org/binutils/trunk/latest/src/sha512.sum -O - -o /dev/null | awk '{print $2}')
GCC_TARBALL=$(wget https://gcc.gnu.org/pub/gcc/snapshots/LATEST-15 -O - -o /dev/null | grep -E 'gcc-15-[0-9]+.tar.xz' | sed -e 's/.*\(gcc-15-[^<]*\).*/\1/')
GCC_TARBALL=$(wget https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_VERSION} -O - -o /dev/null | grep -E "gcc-${GCC_VERSION}-[0-9]+.tar.xz" | sed -e "s/.*\(gcc-${GCC_VERSION}-[^<]*\).*/\1/")

BINUTILS_URL="https://snapshots.sourceware.org/binutils/trunk/latest/src/$BINUTILS_TARBALL"
GCC_URL="https://gcc.gnu.org/pub/gcc/snapshots/LATEST-15/$GCC_TARBALL"
GCC_URL="https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_VERSION}/$GCC_TARBALL"

BINUTILS_BASENAME=$(basename $BINUTILS_TARBALL .tar.xz)
GCC_BASENAME=$(basename $GCC_TARBALL .tar.xz)
Expand Down
Loading