From: Jarkko Hietaniemi Date: Sun, 24 Aug 2003 10:46:42 +0000 (+0000) Subject: Various tweaks for getting Perl to compile on SunOS 4.x. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b76f91fcea858b4c9ff8318bb0e9892afb37cbc8;p=p5sagit%2Fp5-mst-13.2.git Various tweaks for getting Perl to compile on SunOS 4.x. Doesn't work well yet, something broken in DynaLoader/XSLoader? p4raw-id: //depot/perl@20867 --- diff --git a/README.solaris b/README.solaris index 47338b6..202c8ff 100644 --- a/README.solaris +++ b/README.solaris @@ -233,6 +233,16 @@ You may have to manually edit config.sh and add the -Wl,-E flags yourself, or else run Configure interactively and add the flags at the appropriate prompts. +In SunOS 4.x you most probably want to use the SunOS ld, /usr/bin/ld, +since the more recent versions of GNU ld (like 2.13) do not seem to +work for building Perl anymore. When linking the extensions, the +GNU ld gets very unhappy and spews a lot of errors like this + + ... relocation truncated to fit: BASE13 ... + +and dies. Therefore the SunOS 4.1 hints file explicitly sets the +ld to be /usr/bin/ld. + If your gcc is configured to use GNU as and ld but you want to use the Solaris ones instead to build perl, then you'll need to add -B/usr/ccs/bin/ to the gcc command line. One convenient way to do diff --git a/ext/IO/poll.c b/ext/IO/poll.c index 02a99b9..9d39d57 100644 --- a/ext/IO/poll.c +++ b/ext/IO/poll.c @@ -135,3 +135,12 @@ again: } #endif /* EMULATE_POLL_WITH_SELECT */ + +/* gcc for SunOS 4 produces code from an empty (code/symbolwise) + * source code file that makes the SunOS 4.x /usr/bin/ld fail with + * ld: poll.o: premature EOF + * To avoid this, have at least something in here. */ +#if defined(__sun) && !defined(__SVR4) && defined(__GNUC__) +static int dummy; +#endif + diff --git a/hints/sunos_4_1.sh b/hints/sunos_4_1.sh index 650b551..4c9ff14 100644 --- a/hints/sunos_4_1.sh +++ b/hints/sunos_4_1.sh @@ -82,3 +82,9 @@ fi # library. # # Thanks to William Setzer for this info. + +# Don't use the GNU ld, that doesn't work, you'll get a lot of +# relocation truncated to fit: BASE13 ... +# from many extensions, like B and Data::Dumper. +ld=/usr/bin/ld +