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!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Emacs Ada mode with RTS References: <888a3bd7-6ce8-4458-8725-8330680f48de@googlegroups.com> Date: Thu, 18 Jun 2015 10:34:30 -0500 Message-ID: <86egl9do8p.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) Cancel-Lock: sha1:Lghiudu7l7D5g9SFcF19jOqNwkE= MIME-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 954bd5582e50ae97f808411578 X-Received-Bytes: 4226 X-Received-Body-CRC: 2641145730 Xref: news.eternal-september.org comp.lang.ada:26374 Date: 2015-06-18T10:34:30-05:00 List-Id: Patrick Noffke writes: > I'm trying to use Emacs Ada mode with a .gpr project file that works > with GPS and uses a Ravenscar runtime. When I compile with GPS or from > my own Makefile, I have no problems, but when I compile a file from > Emacs using Ada mode's Compile file command, That command is intended for newbies only; serious projects should use a Makefile, so you have more control. > I get an error: > > s-osinte.ads:591:07: size for "Address" too small, minimum allowed is 64 > > This is when it's compiling the "main" file. Just a guess, but this looks like you are mixing 64 bit and 32 bit systems? Are you trying to cross-compile? > It appears that from Ada mode, the system adainclude directory is > getting used. I wrote the .adp project file by hand, using Simon's > suggestion from here: > http://sourceforge.net/p/stm32f4-gnat-rts/discussion/general/thread/0ccef570/ That definitely suggests cross-compiling. > But when I edit the project file with the Ada mode GUI (using Ada > mode's Project -> Edit command), That's only in ada-mode 4.x; please upgrade to ada-mode 5.x, from Gnu ELPA. To do that: First enable packages in your ~/.emacs: (package-initialize) Then invoke M-x list-packages, select ada-mode 5.1.8, install. For more on ada-mode 5.x, see http://stephe-leake.org/emacs/ada-mode/emacs-ada-mode.html > it shows /usr/lib/gcc/x86_64-redhat-linux/4.9.2/adainclude listed > under Source directories. > /usr/lib/gcc/x86_64-redhat-linux/4.9.2/adalib is also listed under > Object directories. These directories do not exist in my .adp file. > > gprbuild (and the resulting call to gcc) appear to be called as I > expect from within Ada mode, but something must be set up as an > environment variable that I'm not seeing in the compilation output > window. 5.1.8 is better about this; the Ada | Build | Build command may do what you want (but I still recommend a Makefile). > Here are some variables from my .adp file: > > toolchain_dir=/home/pnoffke/projects/proj1/output/toolchain/gnat/bin > ada_compiler=${toolchain_dir}/arm-eabi-gnat > gpr_file=/home/pnoffke/projects/proj1/proj1.gpr > config_file=/home/pnoffke/projects/proj1/obj/proj1.cgpr > check_cmd=${toolchain_dir}/gprbuild -u -c -gnatc -p -P${gpr_file} > --target=arm-eabi --config=${config_file} ${full_current} > make_cmd=PATH=${toolchain_dir}:$PATH ${toolchain_dir}/gprbuild -p > --target=arm-eabi -P${gpr_file} --config=${config_file} > comp_cmd=${toolchain_dir}/gprbuild -u -c -gnatc -p -P${gpr_file} > --target=arm-eabi --config=${config_file} ${full_current} Some of this may no longer be supported in 5.1.8, but I have not checked in detail. If it doesn't work, please report bugs on the ada-mode mailing list (see the above web site for subscription info); I'd like to enhance ada-mode 5.1.8 to support this sort of thing. > The .cgpr file was created using gprconfig (I found this was how GPS > works for an RTS project). I guess by "RTS project" you mean one for which you specify an alternate run time system via the various --RTS options. ada-mode does not support that directly (see above about Makefile :). I've been messing with that myself recently for Emacs, and have notes about what needs to be added. There are several places where --RTS must be specified on a command line, not just in a .gpr file. Also, it should use the _correct_ system libraries as specified by the RTS setting, not the default ones. -- -- Stephe