Skip to content

Commit

Permalink
Switch to GNAT FSF 12 support (#418)
Browse files Browse the repository at this point in the history
* Switch to GNAT FSF 12 support

* GNAT FSF 12 in GitHub CI

* Update README.md

* Remove run-time dependency build script that is not compatible with GNAT FSF

This script is also not needed as all the BSPs are included in GNAT FSF.
  • Loading branch information
Fabien-Chouteau authored Jan 2, 2023
1 parent bbdc182 commit 13b379a
Show file tree
Hide file tree
Showing 87 changed files with 470 additions and 488 deletions.
85 changes: 51 additions & 34 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,66 @@ jobs:
name: Build and test on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ada-actions/toolchain@ce2021
with:
distrib: community
- uses: ada-actions/toolchain@ce2021
with:
distrib: community
target: arm-elf
- uses: ada-actions/toolchain@ce2021
with:
distrib: community
target: riscv32-elf
- uses: actions/checkout@v3

- run: |
wget -q https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-12.2.0-1/gnat-x86_64-linux-12.2.0-1.tar.gz
tar xf gnat-x86_64-linux-12.2.0-1.tar.gz
echo "${PWD}/gnat-x86_64-linux-12.2.0-1/bin" >> $GITHUB_PATH
wget -q https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-12.2.0-1/gnat-arm-elf-linux64-12.2.0-1.tar.gz
tar xf gnat-arm-elf-linux64-12.2.0-1.tar.gz
echo "${PWD}/gnat-arm-elf-linux64-12.2.0-1/bin" >> $GITHUB_PATH
wget -q https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-12.2.0-1/gnat-riscv64-elf-linux64-12.2.0-1.tar.gz
tar xf gnat-riscv64-elf-linux64-12.2.0-1.tar.gz
echo "${PWD}/gnat-riscv64-elf-linux64-12.2.0-1/bin" >> $GITHUB_PATH
wget -q https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-linux-22.0.0-1.tar.gz
tar xf gprbuild-x86_64-linux-22.0.0-1.tar.gz
echo "${PWD}/gprbuild-x86_64-linux-22.0.0-1/bin" >> $GITHUB_PATH
- name: Install Python 3.x (required for the testsuite)
uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: python3 $PWD/scripts/install_dependencies.py

- run: python3 $PWD/scripts/build_all_examples.py
- run: python3 $PWD/testsuite/run.py

win-build:
name: Build and test on Windows
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v1
- uses: ada-actions/toolchain@ce2021
- uses: actions/checkout@v3

- name: Install msys2
uses: msys2/setup-msys2@v2
with:
distrib: community
- uses: ada-actions/toolchain@ce2021
with:
distrib: community
target: arm-elf
- name: Install Python 3.x (required for the testsuite)
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Remove built-in arm-eabi Ravenscar run-times
run: rm -Recurse -Force "d:\a\_temp\gnat-2021-20210519-arm-elf-windows64-bin\arm-eabi\lib\gnat\ravenscar*"
shell: pwsh
- name: Remove built-in arm-eabi ZFP run-times
run: rm -Recurse -Force "d:\a\_temp\gnat-2021-20210519-arm-elf-windows64-bin\arm-eabi\lib\gnat\zfp*"
shell: pwsh

- run: python $PWD/scripts/install_dependencies.py
- run: python $PWD/scripts/build_all_examples.py
- run: python $PWD/testsuite/run.py
install: >-
base-devel
wget
mingw-w64-x86_64-python
- run: |
wget -q https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-12.2.0-1/gnat-x86_64-windows64-12.2.0-1.tar.gz
tar xf gnat-x86_64-windows64-12.2.0-1.tar.gz
export PATH=${PWD}/gnat-x86_64-windows64-12.2.0-1/bin:$PATH
wget -q https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-12.2.0-1/gnat-arm-elf-windows64-12.2.0-1.tar.gz
tar xf gnat-arm-elf-windows64-12.2.0-1.tar.gz
export PATH=${PWD}/gnat-arm-elf-windows64-12.2.0-1/bin:$PATH
wget -q https://github.com/alire-project/GNAT-FSF-builds/releases/download/gnat-12.2.0-1/gnat-riscv64-elf-windows64-12.2.0-1.tar.gz
tar xf gnat-riscv64-elf-windows64-12.2.0-1.tar.gz
export PATH=${PWD}/gnat-riscv64-elf-windows64-12.2.0-1/bin:$PATH
wget -q https://github.com/alire-project/GNAT-FSF-builds/releases/download/gprbuild-22.0.0-1/gprbuild-x86_64-windows64-22.0.0-1.tar.gz
tar xf gprbuild-x86_64-windows64-22.0.0-1.tar.gz
export PATH=${PWD}/gprbuild-x86_64-windows64-22.0.0-1/bin:$PATH
python $PWD/scripts/build_all_examples.py
python $PWD/testsuite/run.py
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/ada-lang/Ada_Drivers_Library)
[![Linux Build Status](https://travis-ci.org/AdaCore/Ada_Drivers_Library.svg?branch=master)](https://travis-ci.org/AdaCore/Ada_Drivers_Library)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/github/AdaCore/Ada_Drivers_Library?branch=master&svg=true)](https://ci.appveyor.com/project/github-integration-adacore/ada-drivers-library)

![CI status](https://github.com/AdaCore/Ada_Drivers_Library/actions/workflows/main.yml/badge.svg)

# 1. Introduction

This repository contains drivers and sample projects to program
Expand Down Expand Up @@ -44,8 +43,8 @@ for details.

Therefore, building with the sources requires a compiler supporting both Ada
2012 and the GNAT-defined pragma `Volatile_Full_Access`. For instance a recent
GNAT Pro compiler or GNAT Community 2018 for ARM ELF or RISC-V ELF [(Download
here)](http://adacore.com/download).
GNAT Pro compiler or GNAT FSF 12 for ARM ELF or RISC-V ELF [(Download
here)](https://github.com/alire-project/GNAT-FSF-builds/releases).

# 6. Roadmap

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ with HAL; use HAL;

package body nRF.GPIO.Tasks_And_Events is

pragma Warnings (Off, "renamed variable * is not referenced");

-----------------------------------
-- Acknowledge_Channel_Interrupt --
-----------------------------------
Expand Down
6 changes: 6 additions & 0 deletions arch/ARM/Nordic/drivers/nrf_common/nrf-gpio.adb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ with NRF_SVD.GPIO; use NRF_SVD.GPIO;

package body nRF.GPIO is

pragma Warnings (Off, "renamed variable * is not referenced");

----------
-- Mode --
----------

overriding
function Mode (This : GPIO_Point) return HAL.GPIO.GPIO_Mode is
CNF : PIN_CNF_Register renames GPIO_Periph.PIN_CNF (This.Pin);
Expand Down
6 changes: 3 additions & 3 deletions boards/HiFive1/hifive1_zfp.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ library project HiFive1_ZFP is

Linker_Switches := ("-T", Project'Project_dir & "/src/zfp/link.ld");
for Target use "riscv32-elf";
for Runtime ("Ada") use "zfp-rv32imac";
for Runtime ("Ada") use "light-rv32imac";

package Device_Configuration is
for CPU_Name use "RISC-V32";
Expand Down Expand Up @@ -97,9 +97,9 @@ library project HiFive1_ZFP is
Max_Mount_Points := "2"; -- From default value
Max_Path_Length := "1024"; -- From default value
Number_Of_Interrupts := "0"; -- From default value
Runtime_Name := "zfp-rv32imac"; -- From default value
Runtime_Name := "light-rv32imac"; -- From default value
Runtime_Name_Suffix := "rv32imac"; -- From board definition
Runtime_Profile := "zfp"; -- From command line
Runtime_Profile := "light"; -- From command line
Use_Startup_Gen := "True"; -- From command line
Vendor := "SiFive"; -- From board definition
hifive1_uart_root := "268513280"; -- From board definition
Expand Down
4 changes: 2 additions & 2 deletions boards/HiFive1/src/zfp/adl_config.ads
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ package ADL_Config is
Max_Mount_Points : constant := 2; -- From default value
Max_Path_Length : constant := 1024; -- From default value
Number_Of_Interrupts : constant := 0; -- From default value
Runtime_Name : constant String := "zfp-rv32imac"; -- From default value
Runtime_Name : constant String := "light-rv32imac"; -- From default value
Runtime_Name_Suffix : constant String := "rv32imac"; -- From board definition
Runtime_Profile : constant String := "zfp"; -- From command line
Runtime_Profile : constant String := "light"; -- From command line
Use_Startup_Gen : constant Boolean := True; -- From command line
Vendor : constant String := "SiFive"; -- From board definition
hifive1_uart_root : constant := 268513280; -- From board definition
Expand Down
1 change: 1 addition & 0 deletions boards/HiFive1/src/zfp/crt0.S
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ __gnat_exit:
.set _exit,__gnat_exit



.globl putchar
.type putchar,@function
putchar:
Expand Down
2 changes: 2 additions & 0 deletions boards/HiFive1/src/zfp/link.ld
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ SECTIONS
KEEP (*(SORT_NONE(.start)))
*(.text .text.* .gnu.linkonce.t*)
*(.gnu.warning)
KEEP (*(.init))
KEEP (*(.fini))
} > board_flash

.eh_frame_hdr :
Expand Down
6 changes: 3 additions & 3 deletions boards/HiFive1_rev_B/hifive1_rev_b_zfp.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ library project HiFive1_rev_B_ZFP is

Linker_Switches := ("-T", Project'Project_dir & "/src/zfp/link.ld");
for Target use "riscv32-elf";
for Runtime ("Ada") use "zfp-rv32imac";
for Runtime ("Ada") use "light-rv32imac";

package Device_Configuration is
for CPU_Name use "RISC-V32";
Expand Down Expand Up @@ -97,9 +97,9 @@ library project HiFive1_rev_B_ZFP is
Max_Mount_Points := "2"; -- From default value
Max_Path_Length := "1024"; -- From default value
Number_Of_Interrupts := "0"; -- From default value
Runtime_Name := "zfp-rv32imac"; -- From default value
Runtime_Name := "light-rv32imac"; -- From default value
Runtime_Name_Suffix := "rv32imac"; -- From board definition
Runtime_Profile := "zfp"; -- From command line
Runtime_Profile := "light"; -- From command line
Use_Startup_Gen := "True"; -- From command line
Vendor := "SiFive"; -- From board definition
hifive1_uart_root := "268513280"; -- From board definition
Expand Down
4 changes: 2 additions & 2 deletions boards/HiFive1_rev_B/src/zfp/adl_config.ads
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ package ADL_Config is
Max_Mount_Points : constant := 2; -- From default value
Max_Path_Length : constant := 1024; -- From default value
Number_Of_Interrupts : constant := 0; -- From default value
Runtime_Name : constant String := "zfp-rv32imac"; -- From default value
Runtime_Name : constant String := "light-rv32imac"; -- From default value
Runtime_Name_Suffix : constant String := "rv32imac"; -- From board definition
Runtime_Profile : constant String := "zfp"; -- From command line
Runtime_Profile : constant String := "light"; -- From command line
Use_Startup_Gen : constant Boolean := True; -- From command line
Vendor : constant String := "SiFive"; -- From board definition
hifive1_uart_root : constant := 268513280; -- From board definition
Expand Down
1 change: 1 addition & 0 deletions boards/HiFive1_rev_B/src/zfp/crt0.S
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ __gnat_exit:
.set _exit,__gnat_exit



.globl putchar
.type putchar,@function
putchar:
Expand Down
2 changes: 2 additions & 0 deletions boards/HiFive1_rev_B/src/zfp/link.ld
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ SECTIONS
KEEP (*(SORT_NONE(.start)))
*(.text .text.* .gnu.linkonce.t*)
*(.gnu.warning)
KEEP (*(.init))
KEEP (*(.fini))
} > board_flash

.eh_frame_hdr :
Expand Down
6 changes: 3 additions & 3 deletions boards/MicroBit/microbit_zfp.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ library project MicroBit_ZFP is

Linker_Switches := ("-T", Project'Project_dir & "/src/zfp/link.ld");
for Target use "arm-eabi";
for Runtime ("Ada") use "zfp-cortex-m0";
for Runtime ("Ada") use "light-cortex-m0";

package Device_Configuration is
for CPU_Name use "ARM Cortex-M0";
Expand Down Expand Up @@ -127,9 +127,9 @@ library project MicroBit_ZFP is
Max_Mount_Points := "2"; -- From default value
Max_Path_Length := "1024"; -- From default value
Number_Of_Interrupts := "32"; -- From MCU definition
Runtime_Name := "zfp-cortex-m0"; -- From default value
Runtime_Name := "light-cortex-m0"; -- From default value
Runtime_Name_Suffix := "cortex-m0"; -- From board definition
Runtime_Profile := "zfp"; -- From command line
Runtime_Profile := "light"; -- From command line
Use_Startup_Gen := "True"; -- From command line
Vendor := "Nordic"; -- From board definition

Expand Down
4 changes: 2 additions & 2 deletions boards/MicroBit/src/zfp/adl_config.ads
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ package ADL_Config is
Max_Mount_Points : constant := 2; -- From default value
Max_Path_Length : constant := 1024; -- From default value
Number_Of_Interrupts : constant := 32; -- From MCU definition
Runtime_Name : constant String := "zfp-cortex-m0"; -- From default value
Runtime_Name : constant String := "light-cortex-m0"; -- From default value
Runtime_Name_Suffix : constant String := "cortex-m0"; -- From board definition
Runtime_Profile : constant String := "zfp"; -- From command line
Runtime_Profile : constant String := "light"; -- From command line
Use_Startup_Gen : constant Boolean := True; -- From command line
Vendor : constant String := "Nordic"; -- From board definition
end ADL_Config;
Loading

0 comments on commit 13b379a

Please sign in to comment.