From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Emacs Ada mode with RTS
Date: Thu, 18 Jun 2015 10:34:30 -0500
Date: 2015-06-18T10:34:30-05:00 [thread overview]
Message-ID: <86egl9do8p.fsf@stephe-leake.org> (raw)
In-Reply-To: 888a3bd7-6ce8-4458-8725-8330680f48de@googlegroups.com
Patrick Noffke <patrick.noffke@gmail.com> 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
next prev parent reply other threads:[~2015-06-18 15:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-17 18:12 Emacs Ada mode with RTS Patrick Noffke
2015-06-17 21:30 ` Simon Wright
2015-06-18 13:48 ` Patrick Noffke
2015-06-18 14:06 ` Simon Wright
2015-06-18 15:09 ` Patrick Noffke
2015-06-18 15:21 ` Patrick Noffke
2015-06-19 13:56 ` Stephen Leake
2015-06-18 15:34 ` Stephen Leake [this message]
2015-06-18 18:19 ` Patrick Noffke
2015-06-19 14:01 ` Stephen Leake
2015-06-18 18:39 ` Patrick Noffke
2015-06-18 19:19 ` Simon Wright
2015-06-19 14:12 ` Stephen Leake
2015-06-19 19:19 ` Simon Wright
2015-06-19 14:08 ` Stephen Leake
2015-06-19 14:47 ` Patrick Noffke
2015-06-21 9:48 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox