Compiling on HP-UX platforms

Jakob Ilves jakob.ilves@oracle.com
Thu Apr 17 08:48:00 2003


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.

I discovered this when compiling another open source package, rrdtool, which
bundles the source code for zlib (and other packages) together with the rrdtool
source so when building rrdtool all packages (rrdtool, zlib, libpng and others)
are built.  That build used by default long jump PIC (the configure script
decided to use that).  The resulting rrdtool binary worked fine as long as I
didn't try to use it to generate a graph in the PNG format.  Once I did it
called libpng which called zlib which were compiled with -fPIC (long jump PIC)
and therefore crashed. By editing the Makefile in the zlib subdirectory by hand
(editing autogenerated Makefiles by hand is bad practice but that's another
story) I managed to change the zlib so that package become built as a "short
jump" PIC (while the others packages remained long jump PIC).  After that,
rrdtool properly generated PNG images.

(Yes, I know, I should have been a good and well behaved open source community
member and reported this to the zlib maintainers so they can track down why
zlib with long jumps crashes on HP-UX or even better, do that track down myself
and provide them a patch. Ah what can I say to my defence?  Maybe that life is
short, even for us in the open source world.  Maybe I'll repent some day...
:->  Or maybe there's a zlib 1.1.4 out there not suffering from this?  So much
for being updated...)

But maybe this is totally irrelevant (I haven't read the vnc source and don't
know is zlib is part of it, sloppy of me) so my suggestion is just a quick
shot, provided because it took me quite a while finding out the above
peculiarity with the HPUX/zlib combination and if I can help others avoid that
debugging attempt it could still be worth it.

Best regards

/IlvJa


Wesley Hart wrote:

> Twas brillig, and Jeff Boerio scrobe:
> > Has anyone been successful in compiling Real VNC 3.3.7 on HP platforms?
> > I'm specifically interested in HP-UX 11.00, but also HP-UX 10.20?
> >
> > I've been able to generate binaries, but I can't get them to do anything
> > :)
> >
> > I'd be satisfied with a compilation on HP-UX 10.20, since it would
> > likely work on HP11.  The compile I get on 10.20 generates a binary, and
> > it runs.  But as soon as a client connects, it does.
> >
> > The binary I get on HP11 dumps core, unless you just say -help :)
> >
> > I would really like to hear what people did to get this to compile on
> > those platforms.
> >
>
> Jeff,
>
> I've mangaged to build RealVNC 3.3.7 on HP-UX 10.20, but like you, I get
> core dumps when using it.  By playing with the viewer's "-encoding" flag,
> and watching the Xvnc log file, I've convinced myself that the ZRLE
> encoding is the culprit - as soon as the server tries to enable ZRLE, it
> dies.
>
> If you're running VNC across a LAN, you can disable ZRLE in favor of
> one of the other encodings (probably hextile).
>
> If you have a slow (DSL, cable, or dialup) link bewteen server and viewer,
> then I'd recommend using TightVNC with tight encoding.  TightVNC builds
> on HP-UX 10.20 with only a few config file tweaks, and I have good evidence
> that my TightVNC 1.2.8 server binary also runs fine on HP-UX 11.00.
>
> --
> Wesley Hart                                     3000 Waterview Parkway
>                                                 Richardson, TX  75083
> Hewlett-Packard Company                         Phone: (972)497-4501
> High-Performance Technical Computing            hart@rsn.hp.com
> _______________________________________________
> VNC-List mailing list
> VNC-List@realvnc.com
> http://www.realvnc.com/mailman/listinfo/vnc-list

[demime 0.99d.1 removed an attachment of type text/x-vcard which had a name of jakob.ilves.vcf]