From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Adam Jensen Newsgroups: comp.lang.ada Subject: How to configure GNAT GPL on x86-64 Linux for ARM ELF development Date: Wed, 23 May 2018 06:37:44 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 23 May 2018 06:37:44 -0000 (UTC) Injection-Info: h2725194.stratoserver.net; posting-host="ef2ea55d25a7898c2bac1798e1aa35a6"; logging-data="2319"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18OCjxCg0W4xkJ1IeBB+PRj" User-Agent: Pan/0.144 (Time is the enemy; 28ab3ba git.gnome.org/pan2) Cancel-Lock: sha1:xvSEUnhANas0oDukh3F+esOwY3Y= Xref: reader02.eternal-september.org comp.lang.ada:52610 Date: 2018-05-23T06:37:44+00:00 List-Id: Prologue: I would like to tinker with Ada and Spark embedded real-time software development. I have these two books: https://www.amazon.com/Concurrent-Real-Time-Programming-Alan-Burns/dp/ 0521866979/ https://www.amazon.com/Analysable-Real-Time-Systems-Programmed-Ada/dp/ 1530265509/ And these two books are on the way: https://www.amazon.com/Building-Parallel-Embedded-Real-Time-Applications/ dp/0521197163/ https://www.amazon.com/Building-High-Integrity-Applications-SPARK/dp/ 1107656842/ To start, I have a Nucleo-144 board with an STM32F429ZIT6 MCU. https://www.digikey.com/product-detail/en/stmicroelectronics/NUCLEO- F429ZI/497-16280-ND/5806777 I have installed Adacore's Gnat GPL and SPARK Discovery on Ubuntu 18.04 LTS in: $HOME/.local/gnat And I've installed gnat-gpl-2017-arm-elf-linux-bin.tar.gz in: $HOME/.local/gnat-arm I am following this tutorial: http://www.inspirel.com/articles/Ada_On_Cortex.html ------------------------------------------------------------------------- The first example in that tutorial is: #program.ads package Program is procedure Run; pragma Export (C, Run, "run"); end Program; # program.adb package body Program is procedure Run is begin loop null; end loop; end Run; end Program; # flash.ld OUTPUT_FORMAT("elf32-littlearm") OUTPUT_ARCH(arm) SECTIONS { .vectors 0x08000000 : { LONG(0x20010000) LONG(run + 1) FILL(0) } .text 0x08000200 : { *(.text) } } ------------------------------------------------------------------------- Given: PATH="$HOME/.local/gnat-arm/bin:$PATH"; export PATH The tutorial suggests that maybe this (below) might produce a binary suitable to be loaded onto the MCU: arm-eabi-gcc -c -mcpu=cortex-m4 -mthumb program.adb arm-eabi-ld -T flash.ld -o program.elf program.o arm-eabi-objcopy -O binary program.elf program.bin This is what actually happens: $ arm-eabi-gcc -c -mcpu=cortex-m4 -mthumb program.adb fatal error, run-time library not installed correctly cannot locate file system.ads compilation abandoned I guess that the LD_LIBRARY_PATH and GPR_PROJECT_PATH environment variables should be set but I don't yet understand enough to make reasonable guesses. Any advice on how to proceed would be very much appreciated!