Skip to content

Commit

Permalink
Apply temporary fix to embedded-rpi-pico runtime
Browse files Browse the repository at this point in the history
This applies a temporary fix to the embedded-rpi-pico runtime installed
with the Adamant example repository. It fixes:

alire-project/GNAT-FSF-builds#69

to allow for compilation with the -gnat2022 flag until a new release of
gnat_arm_elf is available, ie.
https://alire.ada.dev/crates/gnat_arm_elf. This will likely be fixed
in some version >14.1.3 and this temporary fix can be reverted.
  • Loading branch information
dinkelk committed Jul 3, 2024
1 parent 915cd76 commit b20445b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,10 @@ RUN cp /root/.bashrc $HOME/.bashrc \
&& echo "cd $HOME && [ -f "~/adamant_example/env/activate" ] && source adamant_example/env/activate" >> $HOME/.bashrc \
&& chown -R $DOCKER_USER:$DOCKER_USER $HOME

# Install wget. We need it to implement temporary fix
# for https://github.com/alire-project/GNAT-FSF-builds/issues/69.
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq wget

# Make sure user is user at end.
USER user
23 changes: 23 additions & 0 deletions env/activate
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,29 @@ export ADAMANT_CONFIGURATION_YAML=$EXAMPLE_DIR/config/example.configuration.yaml
# Activate the Adamant environment:
. $ADAMANT_DIR/env/activate $EXAMPLE_DIR

# Temporary fix for https://github.com/alire-project/GNAT-FSF-builds/issues/69. This can
# go away when a new release of gnat_arm_elf fixes this issue >14.1.3,
# see: https://alire.ada.dev/crates/gnat_arm_elf
arm_elf_dir=`which arm-eabi-gcc | xargs dirname | xargs dirname`
pico_runtime_dir="$arm_elf_dir/arm-eabi/lib/gnat/embedded-rpi-pico"
pico_runtime_gnarl_dir="$pico_runtime_dir/gnarl_user"
mirror="https://raw.githubusercontent.com/gcc-mirror/gcc/releases/gcc-14/gcc/ada/libgnarl"
installed=0
if [[ ! -f "$pico_runtime_gnarl_dir/s-putaim.adb" ]]
then
wget -P $pico_runtime_gnarl_dir $mirror/s-putaim.adb
installed=1
fi
if [[ ! -f "$pico_runtime_gnarl_dir/s-putaim.ads" ]]
then
wget -P $pico_runtime_gnarl_dir $mirror/s-putaim.ads
installed=1
fi
if [[ $installed -eq 1 ]]
then
gprbuild -P $pico_runtime_dir/ravenscar_build.gpr
fi

# Signify the environment it set up:
export EXAMPLE_ENVIRONMENT_SET="yes"

Expand Down

0 comments on commit b20445b

Please sign in to comment.