Operating System - HP-UX
1753389 Members
7088 Online
108792 Solutions
New Discussion юеВ

migrating C code from hp11 32-bit to hp11.11 64-bit

 
SOLVED
Go to solution
deleted2908
New Member

migrating C code from hp11 32-bit to hp11.11 64-bit

Hi,

We are currently in the process of compiling all our C code on HP-UX 11.11i 64-bit in preparation for a migration from our current HP-UX 11.00 32-bit system. We are getting a few errors around libraries not being there anymore.

e.g.
cc: informational note 404: LPATH is /usr/lib/pa20_64:/opt/langtools/lib/pa20_64
:
/usr/ccs/bin/ld /opt/langtools/lib/pa20_64/crt0.o cxdm200a.o -L/usr3/devel/lib/
-L/opt/informix/lib/esql -L/opt/informix/lib -lwb -lNoncomp -ltamm -ldbio_inf -l
wb -lNoncomp -lmap -ltamm -lwb -lNoncomp -ltblio -lcurses -lsql -lasf /opt/infor
mix/lib/netstub.a /usr/epic/lib/xcs.a /opt/informix/lib/esql/libixos.a -lsec -lg
en -lgls -los -lm -lm -lmalloc -lsgm -o /usr3/devel/bin/cxdm200a -u main -lc
cc: informational note 413: Entering Link editor.
ld: Can't find library for -lmalloc
Fatal error.

This also happens for -lnet.

The compiler is looking for libnet.a and libmalloc.a which reside in /usr/lib. However when compiling in 64-bit mode it doesn't look in /usr/lib for libraries but in /usr/lib/pa20_64 which I assume are all the 64bit libraries. but libnet.a and libmalloc.a are not in that path and copying the versions in /usr/lib to the new path doesn't work either. I assume that's because they are 32-bit and not recognised.

My questions are (eventually!):
1. Are there 64-bit versions of libnet.a and libmalloc.a?
2. If not, can I just take them out of the compilation and hope that the system works OK?

Please excuse my ignorance at what these libraries are for. Although I now support this system I didn't originally write the code so I have no idea what libnet.a and libmalloc.a do and whether we need them!

Thanks in anticipation!

Dave
9 REPLIES 9
rick jones
Honored Contributor

Re: migrating C code from hp11 32-bit to hp11.11 64-bit

It is at least worth a shot :) If nothing else, it will show you what routines go missing.
there is no rest for the wicked yet the virtuous have no pillows
deleted2908
New Member

Re: migrating C code from hp11 32-bit to hp11.11 64-bit

Thanks for your response Rick. I guess it's a case of "suck it and see"!
rick jones
Honored Contributor

Re: migrating C code from hp11 32-bit to hp11.11 64-bit

If I were a compiler/libs guy I might be able to say exactly what changed there, but being a networking guy I'm afraid I'm left with "try it and see" :)

BTW, not to muddy the waters, and certainly not to delay a 64-bit port, but you do know that 11iv1 does still support 32-bit _applications_ right? Ditto for 11iv2 (11.23), which if your hardware supports it I would suggest as the migration goal over 11iv1 (11.11).
there is no rest for the wicked yet the virtuous have no pillows
doug hosking
Esteemed Contributor
Solution

Re: migrating C code from hp11 32-bit to hp11.11 64-bit

If you run 'nm' on these libraries, you will see:

__emptylib | 0|extern|entry |$CODE$

While my memory of the really old libraries is foggy, I'd guess the __emptylib is a strong sign that the contents of these libraries long ago moved to some other library, such as libc, and that the empty libraries were kept around to maintain compatibility for those who had not updated their makefiles, etc.

If I were in your shoes, I would be very strongly tempted to just remove the '-lmalloc' and '-lnet' and move on.

By the way, even on 10.20, libmalloc.a has the '__emptylib' symbol in it, so this change was probably made long, long ago. I no longer have easy access to pre-10.20 systems to dig further back.

deleted2908
New Member

Re: migrating C code from hp11 32-bit to hp11.11 64-bit

Thanks guys! I've searched the internet for libmalloc and libnet and I think you might be right in that libc and libm might actually have replaced those two. My application actually links to libc and libm as well! I can't tell you if it works yet because I'm having problems with a third party piece of software which we link to but has 32 bit libraries. I'll let you know FYI when I get that resolved.

Thanks again for your responses!
rick jones
Honored Contributor

Re: migrating C code from hp11 32-bit to hp11.11 64-bit

While you wait for the third-party to get their libs to 64-bit you could try a 32-bit compile on 11iv1 if you want. Just drop the +DD64 from the compile options.
there is no rest for the wicked yet the virtuous have no pillows
deleted2908
New Member

Re: migrating C code from hp11 32-bit to hp11.11 64-bit

I've compiled the code as 32-bit as suggested by Rick which has worked well. We are still waiting on our 3rd party supplier to provide 64-bit libraries of THEIR code. Thanks for your help Rick!

Doug also answered my initial question about what whether I could just leave the libraries out. Cheers Doug!


TMcB
Super Advisor

Re: migrating C code from hp11 32-bit to hp11.11 64-bit

is this sorted
Dennis Handly
Acclaimed Contributor

Re: migrating C code from hp11 32-bit to hp11.11 64-bit

Doug is correct. libmalloc has been obsolete for years and has finally been removed in 11.23.

At one time it was a higher performance malloc but the one in libc was fixed to be faster.
(I'm not sure what was in libnet.)

>I assume that's because they are 32-bit and not recognised.

Exactly.