Skip to content

Commit

Permalink
Enable GNAT cross builds on macos arm
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien-Chouteau committed Jun 21, 2024
1 parent a001205 commit bc860af
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/macos_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,51 @@ jobs:
path: sbx/*/release_package*/install/*
retention-days: 5

gnat_cross:
strategy:
matrix:
target: ["arm-elf", "riscv64-elf", "avr-elf"]
name: GNAT ${{ matrix.target }}-darwin
needs: gnat
runs-on: macos-14
steps:
- name: Set Xcode 15.3
run: sudo xcode-select --switch /Applications/Xcode_15.3.app

- name: Checkout Project
uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: anod-artifacts
path: in_artifacts/

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install e3-core==22.1.0
- name: Build GNAT ${{ matrix.target }}
run: ./anod build gcc -v --loglevel DEBUG --target=${{ matrix.target }} --enable-cleanup

- name: Build GDB ${{ matrix.target }}
run: ./anod build gdb -v --loglevel DEBUG --target=${{ matrix.target }} --enable-cleanup

- name: Package GNAT ${{ matrix.target }}
run: ./anod build release_package --qualifier=package=gnat,do_gh_release --target=${{ matrix.target }} -v --loglevel DEBUG
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for GitHub CLI tool

- uses: actions/upload-artifact@v2
with:
name: release-packages
path: sbx/*/release_package*/install/*
retention-days: 5


why3:
Expand Down
7 changes: 2 additions & 5 deletions specs/base_gcc.anod
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ from e3.anod.spec import Anod
class base_gcc(spec("common")):
@property
def version(self):
return "14.1.0-2"
return "14.1.0-3"

@property
def tarball(self):
return "gnat-%s-%s.tar.gz" % (self.env.platform, self.version)

@property
def url(self):
# Use Simon's GCC 13.3 compiler on Mac OS X ARM64 for bootstrap
return ("https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-%s/%s" \
return "https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-%s/%s" \
% (self.version, self.tarball)
if self.env.target.cpu.name == "x86_64" else
"https://github.com/simonjwright/alire-index.mac/releases/download/toolchain-13.2.1/gcc-13.3.0-aarch64.tar.gz")

@Anod.primitive()
def build(self):
Expand Down

0 comments on commit bc860af

Please sign in to comment.