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: Simon Wright Newsgroups: comp.lang.ada Subject: Re: ANN: Cortex GNAT RTS 20180419 Date: Sun, 29 Apr 2018 12:50:59 +0100 Organization: A noiseless patient Spider Message-ID: References: <2000550e-44d7-4516-a2fb-1ebcaeecf985@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="160c48ae6dece30daf28029e7fe5fa98"; logging-data="2620"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gjhbKSGgboWh6WpWc3kTvlCWTsV+607o=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:OyAWfx/MM96yrFMMJJMfLyqXURY= sha1:UTKgM0MTt9wF4sqq6YbZijtrrlY= Xref: reader02.eternal-september.org comp.lang.ada:51787 Date: 2018-04-29T12:50:59+01:00 List-Id: Jere writes: > On Saturday, April 28, 2018 at 12:13:14 PM UTC-4, Simon Wright wrote: >> There are three parallel releases at Github[1], for >> >> * GNAT GPL 2016/GCC 6 >> * GCC 7 >> * GNAT GPL 2017 >> >> (three, because of changes to the interface between the compiler and the >> RTS). >> >> There's not much user-visible change from the last GCC 7 release[2], >> except that all but 2k of free store is available for the heap (the 2k >> is used for startup and interrupt stack). >> >> [1] https://github.com/simonjwright/cortex-gnat-rts/releases >> [2] https://github.com/simonjwright/cortex-gnat-rts/releases/tag/r20171016 > > Thank you so much for keeping these up to date. Question: > Do you have any suggestions for pulling out a ZFP from this repo? I know > it isn't setup for that, but was curious if you had any tips for what > to mainly look for. I'm not so much worried about changing the ada files, > but I am more interested in what types of changes (if any) should I be > looking to do to the ld file, the gpr file, the xml file, etc. So mostly > the build system. I'm probably gonna try and mod the ardiuno one as it > is closest to my chip (an M0+). Right now, I have been pulling from one > of your older revisions where the ZFP was still available. One you haven't mentioned is system.ads. The barebones site https://wiki.osdev.org/Ada_Bare_bones wants you to put the restrictions in gnat.adc; personally I've put them in system.ads, that way you don't need to worry about whether your own code will see the restrictions. The ld script will need changing to match your board's memory map; also, maybe, the ENTRY symbol. Not sure about the EXTERNs either. You'll need to change runtime.xml to specify the right compiler switches (when I give GCC8 -mcpu=cortex-m0plus it adds -mfloat-abi=soft -mthumb -march=armv6-m automatically (from inspection of the .ali)). build_runtime.gpr clearly won't need to reference FreeRTOS! and the Source_Dirs will clearly change. > Also, 2 other questions: > If I do get something working, do I use your licensing statement in the > files as is, or should I modify it if I modify the files? I do plan > on modifying quite a few of the ada ones to fit with my chip, but I had > noticed you seemed to use the vanilla FSF copyright in your license > statement, even though I assume you wrote some of the code in the file. I used the FSF copyright because I've assigned copyright to the FSF (#1016382). If you change something, I believe you can add your copyright, so long as you redistribute on the same terms. > It looks like you most likely use gcc for some intrinsics like memcpy. > Do I need to worry about licensing issues if I build with GNAT GPL 2017 > using a modified version of your RTS if it links in functions like memcpy? > I can supply my own if so, they just won't be as efficient if I do. libgcc is used for things such as long addition, multiplication etc not supported by the hardware. GCC uses functions normally supplied by libc as discussed in [1]. The only part of the RTS that this affects is Startup, in -- Copy data to SRAM Data_In_Sram := Data_In_Flash; -- Initialize BSS in SRAM Bss := (others => 0); (the second array assignment uses memset()). You could change this to do byte-by-byte copy (AdaCore's RTSs do this in assembly) but of course your own code (and even libgnat) might use the libc functions (Interfaces.C uses memcpy), and there is no way I can see to tell GCC not to do this. Of course you could build your own, but I've got round this by using newlib. ISTR writing up how to build newlib for GNAT GPL, but where...? Anyway, I'm currently using newlib 2.5.0 and building as in [2]. I _think_ the gpl branch would do the job. FYI, newlib works out what cpu versions to build from the compiler capabilities, as reported by e.g. arm-eabi-gcc -print-multi-lib. [1] https://docs.adacore.com/gnathie_ug-docs/html/gnathie_ug/gnathie_ug/using_gnat_pro_features_relevant_to_high_integrity.html#array-and-record-assignments-and-the-high-integrity-profiles [2] https://sourceforge.net/u/simonjwright/buildingarmeabi/code/ci/default/tree/