comp.lang.ada
 help / color / mirror / Atom feed
* Cross compilation problem
@ 2009-04-30 14:37 Bryan
  2009-05-01 14:39 ` anhvofrcaus
  2009-05-01 17:41 ` Robert A Duff
  0 siblings, 2 replies; 5+ messages in thread
From: Bryan @ 2009-04-30 14:37 UTC (permalink / raw)


I have been trying to create a gcc cross compiler from cygwin to ARM
for a project at work and managed to get it somewhat functional but I
have run into a problem that is preventing all but my most basic tests
from compiling. I am receiving an error that states I am violating the
No_Implicit_Dynamic_Code restriction and I have tracked this down to
the compiler generating dynamic code on the stack for certain
features. Does anyone know how I can fix this issue in the compiler?
Or is this occurring because there is no official ARM Linux port for
the compiler?



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

* Re: Cross compilation problem
  2009-04-30 14:37 Cross compilation problem Bryan
@ 2009-05-01 14:39 ` anhvofrcaus
  2009-05-01 14:43   ` anhvofrcaus
  2009-05-01 17:41 ` Robert A Duff
  1 sibling, 1 reply; 5+ messages in thread
From: anhvofrcaus @ 2009-05-01 14:39 UTC (permalink / raw)


On Apr 30, 7:37 am, Bryan <kamikaze.de...@gmail.com> wrote:
> I have been trying to create a gcc cross compiler from cygwin to ARM
> for a project at work and managed to get it somewhat functional but I
> have run into a problem that is preventing all but my most basic tests
> from compiling. I am receiving an error that states I am violating the
> No_Implicit_Dynamic_Code restriction and I have tracked this down to
> the compiler generating dynamic code on the stack for certain
> features. Does anyone know how I can fix this issue in the compiler?
> Or is this occurring because there is no official ARM Linux port for
> the compiler?

I have the same problem event I was building gcc-4.4.0 GNAT for host
cygwin itself. It is interesting is that GNAT distribution (gcc-4.3.2)
under current cygwin does not have this problem. Therefore, there must
be a way to build GNAT / GCC-4.3.2 correctly using the older version
of GNAT. I will pursue this problem once I have some time.

Anh Vo



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

* Re: Cross compilation problem
  2009-05-01 14:39 ` anhvofrcaus
@ 2009-05-01 14:43   ` anhvofrcaus
  0 siblings, 0 replies; 5+ messages in thread
From: anhvofrcaus @ 2009-05-01 14:43 UTC (permalink / raw)


On May 1, 7:39 am, anhvofrc...@gmail.com wrote:
> On Apr 30, 7:37 am, Bryan <kamikaze.de...@gmail.com> wrote:
>
> > I have been trying to create a gcc cross compiler from cygwin to ARM
> > for a project at work and managed to get it somewhat functional but I
> > have run into a problem that is preventing all but my most basic tests
> > from compiling. I am receiving an error that states I am violating the
> > No_Implicit_Dynamic_Code restriction and I have tracked this down to
> > the compiler generating dynamic code on the stack for certain
> > features. Does anyone know how I can fix this issue in the compiler?
> > Or is this occurring because there is no official ARM Linux port for
> > the compiler?
>
> I have the same problem event I was building gcc-4.4.0 GNAT for host
> cygwin itself. It is interesting is that GNAT distribution (gcc-4.3.2)
> under current cygwin does not have this problem. Therefore, there must
> be a way to build GNAT / GCC-4.3.2 correctly using the older version
> of GNAT. I will pursue this problem once I have some time.
>
> Anh Vo

Oop! there is a typo in the first sentence. I meant even not event.



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

* Re: Cross compilation problem
  2009-04-30 14:37 Cross compilation problem Bryan
  2009-05-01 14:39 ` anhvofrcaus
@ 2009-05-01 17:41 ` Robert A Duff
  2009-05-01 17:50   ` Bryan
  1 sibling, 1 reply; 5+ messages in thread
From: Robert A Duff @ 2009-05-01 17:41 UTC (permalink / raw)


Bryan <kamikaze.decoy@gmail.com> writes:

> I have been trying to create a gcc cross compiler from cygwin to ARM
> for a project at work and managed to get it somewhat functional but I
> have run into a problem that is preventing all but my most basic tests
> from compiling. I am receiving an error that states I am violating the
> No_Implicit_Dynamic_Code restriction and I have tracked this down to
> the compiler generating dynamic code on the stack for certain
> features.

In older versions of GNAT, trampolines are generated whenever you do
'Access of nested subprograms, or use related features (e.g. nested task
bodies, nested type extensions, which do such a 'Access internally).
These trampolines are, as you say, code generated at run time on the
stack, and they violate the No_Implicit_Dynamic_Code restriction.

In later versions of GNAT, trampolines are generated only for
fairly rare cases.  I don't know whether this fix exists in
whatever public version you are using.  If it does not yet,
it will eventually.

You might want to post an example that causes trouble.

>... Does anyone know how I can fix this issue in the compiler?

You could remove the Restrictions pragma from your code.

If you run code with trampolines, you need to turn off Data
Execution Protection (DEP).  That's what windows calls it;
there's a similar feature in Linux.  If you have DEP turned
on, then when you call a trampoline, your program will fail
in some mysterious way.

> Or is this occurring because there is no official ARM Linux port for
> the compiler?

I don't know.

- Bob



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

* Re: Cross compilation problem
  2009-05-01 17:41 ` Robert A Duff
@ 2009-05-01 17:50   ` Bryan
  0 siblings, 0 replies; 5+ messages in thread
From: Bryan @ 2009-05-01 17:50 UTC (permalink / raw)


On May 1, 1:41 pm, Robert A Duff <bobd...@shell01.TheWorld.com> wrote:
> Bryan <kamikaze.de...@gmail.com> writes:
> > I have been trying to create a gcc cross compiler from cygwin to ARM
> > for a project at work and managed to get it somewhat functional but I
> > have run into a problem that is preventing all but my most basic tests
> > from compiling. I am receiving an error that states I am violating the
> > No_Implicit_Dynamic_Code restriction and I have tracked this down to
> > the compiler generating dynamic code on the stack for certain
> > features.
>
> In older versions of GNAT, trampolines are generated whenever you do
> 'Access of nested subprograms, or use related features (e.g. nested task
> bodies, nested type extensions, which do such a 'Access internally).
> These trampolines are, as you say, code generated at run time on the
> stack, and they violate the No_Implicit_Dynamic_Code restriction.
>
> In later versions of GNAT, trampolines are generated only for
> fairly rare cases.  I don't know whether this fix exists in
> whatever public version you are using.  If it does not yet,
> it will eventually.
>
> You might want to post an example that causes trouble.
>
> >... Does anyone know how I can fix this issue in the compiler?
>
> You could remove the Restrictions pragma from your code.
>
> If you run code with trampolines, you need to turn off Data
> Execution Protection (DEP).  That's what windows calls it;
> there's a similar feature in Linux.  If you have DEP turned
> on, then when you call a trampoline, your program will fail
> in some mysterious way.
>
> > Or is this occurring because there is no official ARM Linux port for
> > the compiler?
>
> I don't know.
>
> - Bob

The restrictions pragma is not in code that I control but rather in
the runtime.I suspect that this pragma is only being applied because
of the lack of an official ARM target it is reverting to the default
system.ads file which specifies this pragma although I have no firm
evidence to back this up.



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

end of thread, other threads:[~2009-05-01 17:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-30 14:37 Cross compilation problem Bryan
2009-05-01 14:39 ` anhvofrcaus
2009-05-01 14:43   ` anhvofrcaus
2009-05-01 17:41 ` Robert A Duff
2009-05-01 17:50   ` Bryan

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