Compiling on HP-UX platforms
Wesley Hart
hart@rsn.hp.com
Thu Apr 17 16:56:01 2003
Twas brillig, and Jakob Ilves scrobe:
> Hello!
>
> Does ZRLE use zlib (specifically zlib 1.1.3)? When compiling zlib compiler
> flags are used to create a binary which is position independent code (PIC) and
> there are two flavours of PIC: PIC that uses long jumps and PIC that doesn't
> (let's call it "short jump" PIC). If using the -fPIC flag to gcc you get a
> binary using long jumps in it's PIC and using -fpic you get a "short jump" PIC.
>
> (IIRC, on the HP C compiler one uses -z or -Z to create PIC code. I think -z
> is for "short jump" and -Z for long jump... or maybe they were reversed. Your
> man page will tell you which :-)
>
> The thing is, when compiling zlib on HP-UX using long jump PIC (the -fPIC
> flag), the resulting binary dumps core as soon as zlib code is called. When
> compiling zlib to only use short jumps (-fpic), the zlib code works properly.
>
This is an interesting conjecture, but it doesn't seem to be the culprit
in the server aborts I'm seeing.
RealVNC bundles a copy of the zlib 1.1.4 source code, and libz is created
during the build process. However, it seems to only be built as an archive
(*.a) library, so no PIC mode is specified in the Makefile. Also, the libz
example test program that's linked against the library runs without any
problems, so the libz.a looks to be good.
Thanks anyway!
--
Wesley Hart