comp.lang.ada
 help / color / mirror / Atom feed
* ANN: gcc 4.9.1bis for Darwin
@ 2015-01-25 16:41 Simon Wright
  2015-01-25 18:26 ` David Botton
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Simon Wright @ 2015-01-25 16:41 UTC (permalink / raw)


This is to announce two GCC 4.9.1 compilers, one a Darwin native
compiler (the same as previously uploaded, but can be installed in a
place of your choice) and one a cross-compiler to arm-eabi, aka
arm-none-eabi, as found on the STMicroelectronics[1] STM32F4 series.

Both compilers work on Mavericks and Yosemite.

The compilers are at the usual place[2]. They each have a similar
installation mechanism as that in the GNAT GPL series,so you can choose
where to install them (the default is /opt/gcc-4.9.1, but
/usr/local/gcc-4.9.1 works too; there may be problems with longer
paths). You can install the cross compiler on top of the native one.

The cross-compiler comes without an RTS. You can find suitable RTSs at
[3], together with a compiled copy of stlink (the tools that enable
download to the board and debug). The 20150124 version comes in two
variants: one that just supports the STCube BSP, and - more
interestingly - one that additionally supports Ravenscar tasking via
FreeRTOS[4].

The tasking RTS has the following restrictions (aside from pragma
Profile (Ravenscar)):

   pragma Restrictions (No_Allocators);
   pragma Restrictions (No_Dispatch);
   pragma Restrictions (No_Enumeration_Maps);
   pragma Restrictions (No_Exception_Propagation);
   pragma Restrictions (No_Finalization);
   pragma Restrictions (No_Recursion);
   pragma Restrictions (No_Secondary_Stack);

and the following bugs/features (see the Tickets tab at [3]):

o You have to start tasking by calling FreeRTOS.Tasks.Start_Scheduler
   from your main program (it doesn't return unless something is
   horribly wrong).

o Ada.Real_Time.Clock is only valid for 50 days (and has a tick of 1
  ms).

o The Interrupt_Priority aspect on a PO doesn't affect the actual
  interrupt's priority (it does affect the PO's ceiling priority).

o Some weird interaction between the compiler and the RTS code means
  that a protected spec hides package Interfaces. You can 'use
  Interfaces;' before the protected spec, though.

[1] http://www.st.com
[2]
http://sourceforge.net/projects/gnuada/files/GNAT_GCC%20Mac%20OS%20X/4.9.1bis/
[3] http://sourceforge.net/projects/stm32f4-gnat-rts/files/
[4] http://www.freertos.org


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ANN: gcc 4.9.1bis for Darwin
  2015-01-25 16:41 ANN: gcc 4.9.1bis for Darwin Simon Wright
@ 2015-01-25 18:26 ` David Botton
  2015-01-27 14:49 ` RasikaSrinivasan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: David Botton @ 2015-01-25 18:26 UTC (permalink / raw)


Awesome work! Thanks!

David Botton

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ANN: gcc 4.9.1bis for Darwin
  2015-01-25 16:41 ANN: gcc 4.9.1bis for Darwin Simon Wright
  2015-01-25 18:26 ` David Botton
@ 2015-01-27 14:49 ` RasikaSrinivasan
  2015-01-29  0:08 ` Jerry
  2015-02-21 10:22 ` vincent.diemunsch
  3 siblings, 0 replies; 11+ messages in thread
From: RasikaSrinivasan @ 2015-01-27 14:49 UTC (permalink / raw)


excellent news. Thanks a bunch.

cheers, srini


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ANN: gcc 4.9.1bis for Darwin
  2015-01-25 16:41 ANN: gcc 4.9.1bis for Darwin Simon Wright
  2015-01-25 18:26 ` David Botton
  2015-01-27 14:49 ` RasikaSrinivasan
@ 2015-01-29  0:08 ` Jerry
  2015-02-21 10:22 ` vincent.diemunsch
  3 siblings, 0 replies; 11+ messages in thread
From: Jerry @ 2015-01-29  0:08 UTC (permalink / raw)


Thanks, Simon. Always much appreciated.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ANN: gcc 4.9.1bis for Darwin
  2015-01-25 16:41 ANN: gcc 4.9.1bis for Darwin Simon Wright
                   ` (2 preceding siblings ...)
  2015-01-29  0:08 ` Jerry
@ 2015-02-21 10:22 ` vincent.diemunsch
  2015-02-21 12:10   ` Simon Wright
  2015-02-22 11:48   ` Simon Wright
  3 siblings, 2 replies; 11+ messages in thread
From: vincent.diemunsch @ 2015-02-21 10:22 UTC (permalink / raw)


Thank you very much Simon.
Your compiler release has become my main compiler.

Just a small question : is it possible to use INTEL syntax for on-line assembly,
in mean among Ada source code ? 
If not, how can I link assembly language routines with Ada code ?

Regards,

Vincent

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ANN: gcc 4.9.1bis for Darwin
  2015-02-21 10:22 ` vincent.diemunsch
@ 2015-02-21 12:10   ` Simon Wright
  2015-02-24 21:53     ` Vincent
  2015-02-22 11:48   ` Simon Wright
  1 sibling, 1 reply; 11+ messages in thread
From: Simon Wright @ 2015-02-21 12:10 UTC (permalink / raw)


vincent.diemunsch@gmail.com writes:

> Thank you very much Simon.
> Your compiler release has become my main compiler.

Same for me ...

> Just a small question : is it possible to use INTEL syntax for on-line
> assembly, in mean among Ada source code ?
> If not, how can I link assembly language routines with Ada code ?

For inline assembly, you need to use GNU syntax. As a simple(?) ARM
example,

   function In_ISR return Boolean is
      IPSR : Interfaces.Unsigned_32;
      use type Interfaces.Unsigned_32;
   begin
      System.Machine_Code.Asm
        ("mrs %0, ipsr",
         Outputs => Interfaces.Unsigned_32'Asm_Output ("=r", IPSR),
         Volatile => True);
      return (IPSR and 16#ff#) /= 0;
   end In_ISR;

Looking at some of the AdaCore STM32 code, there are two other things
that might be helpful.

First, there is convention Asm:

   System_Vectors : constant System.Address;
   pragma Import (Asm, System_Vectors, "__vectors");

which is fine for data objects like this, not so sure what calling
convention might be expected from an ASM subprogram.

Second, there is pragma Machine_Attribute:

   procedure Pend_SV_Handler;
   pragma Machine_Attribute (Pend_SV_Handler, "naked");
   pragma Export (Asm, Pend_SV_Handler, "__gnat_pend_sv_trap");
   --  This assembly routine needs to save and restore registers without
   --  interference. The "naked" machine attribute communicates this to GCC.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ANN: gcc 4.9.1bis for Darwin
  2015-02-21 10:22 ` vincent.diemunsch
  2015-02-21 12:10   ` Simon Wright
@ 2015-02-22 11:48   ` Simon Wright
  2015-02-24 21:19     ` vdiem
  1 sibling, 1 reply; 11+ messages in thread
From: Simon Wright @ 2015-02-22 11:48 UTC (permalink / raw)


vincent.diemunsch@gmail.com writes:

> If not, how can I link assembly language routines with Ada code ?

One addition: the object code format produced by your assembler needs to
be compatible with the GNU linker.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ANN: gcc 4.9.1bis for Darwin
  2015-02-22 11:48   ` Simon Wright
@ 2015-02-24 21:19     ` vdiem
  0 siblings, 0 replies; 11+ messages in thread
From: vdiem @ 2015-02-24 21:19 UTC (permalink / raw)


Le dimanche 22 février 2015 12:48:46 UTC+1, Simon Wright a écrit :
> Vincent writes:
> 
> > If not, how can I link assembly language routines with Ada code ?
> 
> One addition: the object code format produced by your assembler needs to
> be compatible with the GNU linker.

Yes. I suppose it is the case with NASM.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ANN: gcc 4.9.1bis for Darwin
  2015-02-21 12:10   ` Simon Wright
@ 2015-02-24 21:53     ` Vincent
  2015-02-24 22:05       ` Simon Wright
  0 siblings, 1 reply; 11+ messages in thread
From: Vincent @ 2015-02-24 21:53 UTC (permalink / raw)


Le samedi 21 février 2015 13:10:04 UTC+1, Simon Wright a écrit :
> vincent wrote:
> 
> > Thank you very much Simon.
> > Your compiler release has become my main compiler.
> 
> Same for me ...
> 
> > Just a small question : is it possible to use INTEL syntax for on-line
> > assembly, in mean among Ada source code ?
> > If not, how can I link assembly language routines with Ada code ?
> 
> For inline assembly, you need to use GNU syntax. As a simple(?) ARM
> example,
> 
>    function In_ISR return Boolean is
>       IPSR : Interfaces.Unsigned_32;
>       use type Interfaces.Unsigned_32;
>    begin
>       System.Machine_Code.Asm
>         ("mrs %0, ipsr",
>          Outputs => Interfaces.Unsigned_32'Asm_Output ("=r", IPSR),
>          Volatile => True);
>       return (IPSR and 16#ff#) /= 0;
>    end In_ISR;
> 
> Looking at some of the AdaCore STM32 code, there are two other things
> that might be helpful.
> 
> First, there is convention Asm:
> 
>    System_Vectors : constant System.Address;
>    pragma Import (Asm, System_Vectors, "__vectors");
> 
> which is fine for data objects like this, not so sure what calling
> convention might be expected from an ASM subprogram.
> 
> Second, there is pragma Machine_Attribute:
> 
>    procedure Pend_SV_Handler;
>    pragma Machine_Attribute (Pend_SV_Handler, "naked");
>    pragma Export (Asm, Pend_SV_Handler, "__gnat_pend_sv_trap");
>    --  This assembly routine needs to save and restore registers without
>    --  interference. The "naked" machine attribute communicates this to GCC.

Ok, so I have to resign myself to use GNU syntax.. :-(
I thought that GCC could use both. But maybe not GNAT.

I suppose that if I want to call a routine written in assembly,
I need to use pragma Import (Asm, MyRoutine, "myroutine").

Thank you very much,

Vincent

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ANN: gcc 4.9.1bis for Darwin
  2015-02-24 21:53     ` Vincent
@ 2015-02-24 22:05       ` Simon Wright
  2015-02-26 21:45         ` vdiem
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Wright @ 2015-02-24 22:05 UTC (permalink / raw)


Vincent <vincent.diemunsch@gmail.com> writes:

> Ok, so I have to resign myself to use GNU syntax.. :-(
> I thought that GCC could use both. But maybe not GNAT.

You might be able to use the Stack Overflow answer here:
http://stackoverflow.com/a/9347957/40851
(and see the comments about reverting to att_syntax)

> I suppose that if I want to call a routine written in assembly,
> I need to use pragma Import (Asm, MyRoutine, "myroutine").

Yes, provided Convention=>Asm does something useful!


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ANN: gcc 4.9.1bis for Darwin
  2015-02-24 22:05       ` Simon Wright
@ 2015-02-26 21:45         ` vdiem
  0 siblings, 0 replies; 11+ messages in thread
From: vdiem @ 2015-02-26 21:45 UTC (permalink / raw)


Le mardi 24 février 2015 23:05:22 UTC+1, Simon Wright a écrit :

> You might be able to use the Stack Overflow answer here:
> http://stackoverflow.com/a/9347957/40851
> (and see the comments about reverting to att_syntax)

sadly, gcc gave me the following answer for -masm=intel :
gnat1: error: -masm=intel not supported in this configuration

Regards,

Vincent

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-02-26 21:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-25 16:41 ANN: gcc 4.9.1bis for Darwin Simon Wright
2015-01-25 18:26 ` David Botton
2015-01-27 14:49 ` RasikaSrinivasan
2015-01-29  0:08 ` Jerry
2015-02-21 10:22 ` vincent.diemunsch
2015-02-21 12:10   ` Simon Wright
2015-02-24 21:53     ` Vincent
2015-02-24 22:05       ` Simon Wright
2015-02-26 21:45         ` vdiem
2015-02-22 11:48   ` Simon Wright
2015-02-24 21:19     ` vdiem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox