comp.lang.ada
 help / color / mirror / Atom feed
* Problem with GNAT 3.09 and gnatbind -n
@ 1997-02-27  0:00 Olivier Hainque
  0 siblings, 0 replies; 3+ messages in thread
From: Olivier Hainque @ 1997-02-27  0:00 UTC (permalink / raw)



Hi there,

As part of a simple test I just saw that gnatbind 3.09 generates 
__main_priority differently if invoqued with or without the
"-n" option :

with "-n", I have in b_xxx.c ->  int __main_priority ()  { return -1; }
without,   I have in b_xxx.c ->  int __main_priority = -1; 

I had a look at 7stasini.adb in the source code of the runtime library
of and saw :

Package System.Tasking.Initialization
...
begin
  declare
    Main_Priority : Priority;
    pragma Import (C, Main_Priority, "__main_priority");
  begin
    Init_RTS (Main_Priority);
  end;
end System.Tasking.Initialization;

IMHO, I think that there could be a huge problem in the case in which
__main_priority is a function.

Stated differently, I think that the tasking can have lots of difficulties
to run correctly when gnatbind is used with "-n". Unfortunatly, I was not
able to test this yet, but I will install the whole thing for solaris 2.5
and check. (I just saw that in a cross configuration sparc->m68k).

Anyone knows more about this ?    
It is possible that I make a huge mistake myself.

Thanks in advance.

-- Olivier 

--
Olivier Hainque
E-mail: hainque@inf.enst.fr 

P-mail: Telecom Paris
        46, rue Barrault - 75634 Paris cedex 13




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

* Problem with GNAT 3.09 and gnatbind -n
@ 1997-02-28  0:00 Olivier Hainque
  1997-03-02  0:00 ` Robert Dewar
  0 siblings, 1 reply; 3+ messages in thread
From: Olivier Hainque @ 1997-02-28  0:00 UTC (permalink / raw)




Hi there,

As I was doing some tests, I saw a strange think occurring while using
the different options of gnatbind 3.09 (sparc-solaris) :

In b_xxx.c, generated by gnatbind ...

If "-n" is used, __main_priority is defined as a function 
Otherwise, it is defined as an integer.

I had a look at 7stasini.adb in the sources of the runtime library
and saw :

package System.Tasking.Initialization
...
begin
   declare
     Main_Priority : Priority;
     pragma Import (C, Main_Priority, "__main_priority");
   begin
      Init_RTS (Main_Priority);
   end;
end xxx;

Priority comes from the "System" package, where it is defined as a kind
of integer.

I looked around in the other files for the library and found nothing
else significant related to __main_priority. I also had a quick look
at the documentation and found no more information.

Anyway, I think that there could be a problem in the tasking initialization
when __main_priority is defined as a function, ie when the gnatbind is
invoqued with "-n".

I re-installed the whole thing, compiling the library files with "-gnata",
and tried a simple thing :

- provide a trivial ada "foo" routine calling delay(2.0);
- provide a "main" c routine calling ada_init(), the ada routine and then 
  adafinal().
- make a big adalib.a file with all the .o's of the runtime library to avoid
  having to call gnatlink.

- compile :
gcc -c foo.adb main.c
gnatbind -n foo.ali    -> generates b_foo.c, containing __main_priority as
                          a function
gcc -c b_foo.c 

gcc -o foo b_foo.o foo.o main.o .../adalib.a -lthread -lposix4

- run :

foo 

I got a somewhat non surprising result (IMHO) :

Failed Runtime Assertion : GNULLI failure---Set_Priority
 
I may make a huge mistake myself and just wanted to know if somebody had
more information about this.


Thanks in advance for any kind of help.


-- Olivier Hainque

--
E-mail: hainque@inf.enst.fr 

P-mail: Telecom Paris
        46, rue Barrault - 75634 Paris cedex 13




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

* Re: Problem with GNAT 3.09 and gnatbind -n
  1997-02-28  0:00 Problem with GNAT 3.09 and gnatbind -n Olivier Hainque
@ 1997-03-02  0:00 ` Robert Dewar
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Dewar @ 1997-03-02  0:00 UTC (permalink / raw)



Olivier said

<<As I was doing some tests, I saw a strange think occurring while using
the different options of gnatbind 3.09 (sparc-solaris) :

In b_xxx.c, generated by gnatbind ...

If "-n" is used, __main_priority is defined as a function
Otherwise, it is defined as an integer.>>

I trust you reported this to report@gnat.com!!





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

end of thread, other threads:[~1997-03-02  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-28  0:00 Problem with GNAT 3.09 and gnatbind -n Olivier Hainque
1997-03-02  0:00 ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-02-27  0:00 Olivier Hainque

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