Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Gnat 3.13p and shared libraries on HP-UX

2 views
Skip to first unread message

Pierre Favier

unread,
Jul 6, 2001, 7:34:54 AM7/6/01
to
Hello,

I am currently porting a piece of Ada code from Linux to HP-UX.
The build process creates shared libraries from the compiled Ada units
and then a main program which links against these libraries.

Under Linux with gnat 3.13p everything works fine.

Under HP-UX, the program links but during execution it seems to enter
an infinite loop somewhere when exceptions are raised (exceptions
which are normally handled by an appropriate exception block).

Am I missing some special compiler options on HP-UX (I am compiling
with -O0 -g -gnatwu -gnatf) or is it something which is not working in
the HP-UX version ov 3.13p?

Thanks in advance

Marc A. Criley

unread,
Jul 6, 2001, 9:02:01 AM7/6/01
to

I haven't done HP in a while, but isn't there supposed to be an -fPIC
option when compiling code that's going into shared libraries? Check
the "Creating an Ada Library" section of the GNAT User Guide. (I would,
though, drop the -O0 option since there's no benefit to doing that, and
-gnatf and -gnatwu have no effect on the generated code.)

Marc A. Criley
Senior Staff Engineer
Quadrus Corporation
www.quadruscorp.com

Florian Weimer

unread,
Jul 7, 2001, 4:42:17 AM7/7/01
to
fav...@sofreavia.fr (Pierre Favier) writes:

> I am currently porting a piece of Ada code from Linux to HP-UX.
> The build process creates shared libraries from the compiled Ada units
> and then a main program which links against these libraries.

It might be possible that under HP-UX, GNAT does not support shared
libraries at all. At least the README suggests that GNAT 3.13p does
not support a shared run-time library on HP-UX. :-(

Marc A. Criley

unread,
Jul 7, 2001, 5:13:29 PM7/7/01
to

Oh, GNAT certainly does support shared libraries on HP-UX, I built them
myself with 3.13b1 and 3.13b2 (prior to the release of 3.13p).

Pierre Favier

unread,
Jul 8, 2001, 5:56:31 AM7/8/01
to
"Marc A. Criley" wrote:
> I haven't done HP in a while, but isn't there supposed to be an -fPIC
> option when compiling code that's going into shared libraries? Check
> the "Creating an Ada Library" section of the GNAT User Guide. (I would,
> though, drop the -O0 option since there's no benefit to doing that, and
> -gnatf and -gnatwu have no effect on the generated code.)
>

It was a mistake on my part: I did compile with -fPIC. I also tried
with -O2 with the same result.

For further clarification, it is not the runtime I am trying to
dynamically link in my program but libraries of code belonging to my
application.

Marc A. Criley

unread,
Jul 8, 2001, 5:30:12 PM7/8/01
to

Yes, that's what I understood. Did you call adainit and adafinal?
(Just asking the obvious here...based on personal past experience :-)
Can you successfully build a small, test library to make sure that
works?

Marc

Robert Dewar

unread,
Jul 8, 2001, 10:21:51 PM7/8/01
to
"Marc A. Criley" <mcq...@earthlink.net> wrote in message news:<3B476EEB...@earthlink.net>...

> Oh, GNAT certainly does support shared libraries on HP-UX, I built
> them myself with 3.13b1 and 3.13b2 (prior to the release of 3.13p).
>
> Marc A. Criley
> Senior Staff Engineer
> Quadrus Corporation
> www.quadruscorp.com

Be careful, the fact that you can build libraries that appear to work
(but without systematic testing) does not mean that they are fully
supported (it took quite an effort to get shared libraries fully
working on some targets)

Marc A. Criley

unread,
Jul 9, 2001, 8:31:57 AM7/9/01
to
Robert Dewar wrote:
>
> "Marc A. Criley" <mcq...@earthlink.net> wrote in message news:<3B476EEB...@earthlink.net>...
> > Oh, GNAT certainly does support shared libraries on HP-UX, I built
> > them myself with 3.13b1 and 3.13b2 (prior to the release of 3.13p).
> >
>
> Be careful, the fact that you can build libraries that appear to work
> (but without systematic testing) does not mean that they are fully
> supported (it took quite an effort to get shared libraries fully
> working on some targets)

They definitely worked, this was on a production contract that had ACT
support.

Pierre Favier

unread,
Jul 10, 2001, 1:59:58 AM7/10/01
to
de...@gnat.com (Robert Dewar) wrote in message news:<5ee5b646.01070...@posting.google.com>...

I am still unsure from Robert Dewar's posting whether they should be
working or not on HP-UX.

Marc A. Criley

unread,
Jul 10, 2001, 9:13:52 AM7/10/01
to
Pierre Favier wrote:
>
> de...@gnat.com (Robert Dewar) wrote in message news:<5ee5b646.01070...@posting.google.com>...
> > "Marc A. Criley" <mcq...@earthlink.net> wrote in message news:<3B476EEB...@earthlink.net>...
> > > Oh, GNAT certainly does support shared libraries on HP-UX, I built
> > > them myself with 3.13b1 and 3.13b2 (prior to the release of 3.13p).
> >
> > Be careful, the fact that you can build libraries that appear to work
> > (but without systematic testing) does not mean that they are fully
> > supported (it took quite an effort to get shared libraries fully
> > working on some targets)
>
> I am still unsure from Robert Dewar's posting whether they should be
> working or not on HP-UX.

In 1999 and 2000, I personally successfully built shared libraries on
HP-UX 10.20 using GNAT 3.13b1 and GNAT 3.13b2. The 3.13b series was
then the version of GNAT available to ACT supported customers (3.12p was
the public version). This compiler led to the version that was
subsequently made publically available as 3.13p. The shared libraries
that were built were tested and delivered to a customer.

0 new messages