On Sun, 05 Jun 2005 17:05:13 +0100, Nick Glencross <[EMAIL PROTECTED]> wrote:
> Folks, > > I hope that not too many of you are getting fed up with me going on > about HP-UX. I'm nearly there with having it working with manually > hacked Makefiles etc. > > Some tweaks will be needed to the Configure tests (not too many), but > I'd just like to summarise what I believe to be the 'big picture' in a > single email. > > I guess the main complexity comes from potentially having 3 C compilers > and 2 linkers. We have: > > * The Bundled C compiler: which comes as standard with HP-UX, > is a K&R compiler and is pretty much just intended to generate > a new kernel. It won't be up to compiling parrot. Because it is not an ANSI compliant compiler, and does not pretend to be one It's braindead and useless > * A purchased HP C compiler. This is invoked with 'c89' or 'cc -Aa'. > Full C compiler. cc -Ae > * GNU C. Invoked with gcc or perhaps cc > Most of us know and love it. On HP-UX, please use 3.0.4 or newer For 64bit compiles on HP-UX 11i, do NOT use 4.0.0 > * HP-UX linker, ld. Not sure if there is a bundled/commercial > version. there is only one. Please advice HP-UX users to check if they have applied the most recent patches, which makes a difference > * GNU ld. Not available for 32bit builds on HP-UX > gcc may be configured to use the HP-UX or GNU linker backends. > > HP-UX also has some quirks: > > * Shared libraries *must* have execute permissions > > * All C files which are to go into shared libraries *must* all be > compiled with 'Position Independent Code' flags -z +Z for HP C -fPIC for gcc > * The system ld doesn't export symbols in the main executable to be > visible to shared libraries by default > > * The HP-UX linker does not like -g Yes, it does, but not in combination with -O2 or higher HP C and GNU gcc with -O1 both work fine with -g > * [Some strange alignment rules?] > > I'll now try to clearly and concisely summarise the flags that are > required for compilation. > > HP-UX C compiler: > > cc: c89 or 'cc -Aa' -Ae > cc_shared: +z (should be Perl's cccdlflags variable) -z +Z (capital Z) > ccdlflags(?): -Wl,-E if used with HP-UX ld -Ae will automatically pass this to ld > GCC compiler: > > cc: cc or gcc > cc_shared: -fpic (Perl's cccdlflags variable) -fPIC > ccdlflags(?): -Wl,-E if used with HP-UX ld > > HP-UX ld: > > ld: ld > ld_share_flags: -b > > GNU ld: > > ld: ld > ld_share_flags: -shared > > The -Wl,-E (actually -E passed to ld) tells the linker to export symbols > from the resulting binary so that they are available to dynamically > loaded libraries. > > -fPIC is possible instead of -fpic, and +Z -z is better than -z (thanks > H.Merijn), but we'd use whatever Perl supplies. The most recent perl5 hints for HP-UX already do so IIRC > There basically seem to be a few assumptions in the configured system > which are a bit gcc/linux-centric. > > For instance, the following files need to be compiled with $(cc_shared) > as they make their way into dynamic libraries: > > src/extend.o > src/nci_test.o > dynclasses/*.o > > The parrot executable need to be linked with (what I've called above) > $(ccdlflags) for dynclasses to work. > > If no one sees any big misunderstands here, I'll press on with my tweaks > over the next few days, -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using Perl 5.6.2, 5.8.0, 5.8.5, & 5.9.2 on HP-UX 10.20, 11.00 & 11.11, AIX 4.3 & 5.2, SuSE 9.2 & 9.3, and Cygwin. http://www.cmve.net/~merijn Smoking perl: http://www.test-smoke.org, perl QA: http://qa.perl.org reports to: [EMAIL PROTECTED], perl-qa@perl.org