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
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
> 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. :-(
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).
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.
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
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.
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.