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: Re: How to configure GNAT GPL on x86-64 Linux for ARM ELF development Date: Thu, 24 May 2018 07:35:46 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 24 May 2018 07:35:46 -0000 (UTC) Injection-Info: h2725194.stratoserver.net; posting-host="af064ff40f244d57a1e8dc765b7d2e72"; logging-data="6183"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/VGWlZUWV5B360sFLZQp78" User-Agent: Pan/0.144 (Time is the enemy; 28ab3ba git.gnome.org/pan2) Cancel-Lock: sha1:M6DOXHH1BYqvYB/sHNenRO/qDvQ= Xref: reader02.eternal-september.org comp.lang.ada:52636 Date: 2018-05-24T07:35:46+00:00 List-Id: On Wed, 23 May 2018 09:07:51 +0100, Simon Wright wrote: > Adam Jensen writes: > >> $ 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 > >> Any advice on how to proceed would be very much appreciated! > > I think that the reason why the tutorial works and your attempt doesn't > is that the tutorial was developed on a Raspberry Pi, which is already > an ARM-based machine, so the native compiler actually has a runtime > (i.e. system.ads etc etc) visible to it. > > Yours doesn't, and gcc-for-ada must see an RTS. > > I managed to get a compilation using this over-the-top incantation: > > $ gprbuild -c -u -f program.adb --target=arm-eabi --RTS=zfp-stm32f4 > Many thanks, this works! I do not yet know why it works - what it is doing - but the hint is a valuable. It occurred to me that I should be looking for Adacore documentation. I have yet to find a "getting started" tutorial for embedded development aimed at scientists, engineers and other technically mature people (ideally, such a tutorial would be comprehensive, to the point, and regularly tested), but I did find: GPRbuild and GPR Companion Tools User’s Guide and GNAT User’s Guide Supplement for Cross Platforms By mining these two documents it might be possible to extract a basic explanation for these very first steps of the embedded development process. It is curious that the Ada technology's utilization of the system engineering approach has not [yet] been extended into the pedagogical component. After all, software development is a very human-centric process. But I digress. Thanks again for the guidance! After extracting the basics of project management from the core documentation, I hope to find a build process that enables the use of a Ravenscar profile. And after that I hope to configure the development environment to include Spark process components in the real-time embedded system. Does this seem reasonable? > but a simpler (more memorable!) procedure might be to construct your > own: > > 1. Create directories adainclude/, adalib/ > > 2. Copy $prefix/arm-eabi/lib/gnat/zfp-stm32f4/gnat/system.ads to your > adainclude/ ($prefix is the root of your compiler installation, I > think ~/.local/gnat-arm) > > The zfp- (zero footprint) runtime is the closest to what you need, and > the fact that the -stm32f4 part isn't quite right shouldn't matter; I > suspect that system.ads is the same for all the zfp runtimes. > > Now, > > $ arm-eabi-gcc --RTS=. -c program.adb