Building perl on IRIX needs a small patch to the ebuild: ;; *-aix*) osname="aix" ;; *-hpux*) osname="hpux" ;; + *-irix*) + osname="irix" + myconf -Dcc="cc -n32 -mips4" + use ithreads && myconf -Dlibs="-lm -lpthread" || myconf -Dlibs="-lm" + ;; *) osname="linux" ;; esac - myconf -Dccdlflags='-rdynamic' + case ${CHOST} in + *-irix*) + myconf -Dccdlflags='-exports' + ;; + *) + myconf -Dccdlflags='-rdynamic' + ;; + esac if use ithreads then einfo "using ithreads" (This might need adjusting for whitespace) I'm not sure why specifying libs is necessary - this should be picked-up by perl automatically, and is for the libperl ebuild! This probably warrants further investigation...) libperl needs only the following: ;; *-aix*) osname="aix" ;; *-hpux*) osname="hpux" ;; + *-irix*) + osname="irix" + myconf -Dcc="cc -n32 -mips4" + ;; *) osname="linux" ;; esac
I've just found the following additional perl patches: --- Configure +++ Configure @@ -17776,7 +17776,14 @@ RCAT(Rei,ser) ACAT(Cir,cus) EOCP $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1 -if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then +# MIPSPro compiler/preprocessor behaves differently if invoked on +# stdin vs file. Here we test for stdin, but lateron we use files. +# So force it to work the way we know it does: +if [ x"${OPSYS}" = x"IRIX" ]; then + echo "Hacking MIPSPro on file vs. stdin..." >&4 + echo "We know we can catify or stringify, separately or together!" + cpp_stuff=42 +elif $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then echo "Oh! Smells like ANSI's been here." >&4 echo "We can catify or stringify, separately or together!" cpp_stuff=42 ... and ... --- pp_sys.c +++ pp_sys.c @@ -4516,12 +4516,15 @@ PP(pp_gmtime) when = (Time_t)SvIVx(POPs); #endif - if (PL_op->op_type == OP_LOCALTIME) + if (PL_op->op_type == OP_LOCALTIME) { #ifdef LOCALTIME_EDGECASE_BROKEN tmbuf = S_my_localtime(aTHX_ &when); #else + /* Explicitly invoke tzset() as localtime_r may not. */ + tzset(); tmbuf = localtime(&when); #endif + } else tmbuf = gmtime(&when);
(In reply to comment #0) > Building perl on IRIX needs a small patch to the ebuild: > > ;; > *-aix*) osname="aix" ;; > *-hpux*) osname="hpux" ;; > + *-irix*) > + osname="irix" > + myconf -Dcc="cc -n32 -mips4" Is there any reason why you force 32-bits here? Could we somehow hide these settings (if you need them, looks like -mips4 is in more of your snippets) in a wrapper if it doesn't work without?
This was actually from perl's own README.irix document! (Admittedly that only specifies '-n32' rather than '-n32 -mips4' - and with a wrapper the '-mips4' is potentially superfluous I guess...)
Here's a patch that can be applied to latest 5.8.8 ebuilds for perl and libperl: --- sys-devel/libperl/libperl-5.8.8-r2.ebuild,orig Wed Aug 20 21:15:01 2008 +++ sys-devel/libperl/libperl-5.8.8-r2.ebuild Wed Aug 20 21:16:47 2008 @@ -218,7 +218,10 @@ *-aix*) osname="aix" ;; *-hpux*) osname="hpux" ;; *-interix*) osname="interix" ;; - *-irix*) osname="irix" ;; + *-irix*) + osname="irix" + myconf -Dcc="cc -n32 -mips4" + ;; *) osname="linux" ;; esac --- dev-lang/perl/perl-5.8.8-r5.ebuild,orig Wed Aug 20 21:06:16 2008 +++ dev-lang/perl/perl-5.8.8-r5.ebuild Wed Aug 20 21:12:50 2008 @@ -223,11 +223,25 @@ ;; *-aix*) osname="aix" ;; *-hpux*) osname="hpux" ;; + *-irix*) + osname="irix" + myconf -Dcc="cc -n32 -mips4" + use ithreads && myconf -Dlibs="-lm -lpthread" || myconf -Dlibs="-lm" + ;; *-interix*) osname='interix' ;; *) osname="linux" ;; esac + case ${CHOST} in + *-irix*) + myconf -Dccdlflags='-exports' + ;; + *) + myconf -Dccdlflags='-rdynamic' + ;; + esac + if use ithreads then einfo "using ithreads" @@ -306,7 +320,6 @@ sh Configure -des \ -Darchname="${myarch}" \ -Dcccdlflags='-fPIC' \ - -Dccdlflags='-rdynamic' \ -Dcc="$(tc-getCC)" \ -Dprefix="${EPREFIX}"'/usr' \ -Dvendorprefix="${EPREFIX}"'/usr' \
And another one for Configure and pp_sys.c: --- Configure,orig Wed Aug 20 21:37:48 2008 +++ Configure Wed Aug 20 21:39:49 2008 @@ -17710,7 +17710,14 @@ ACAT(Cir,cus) EOCP $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1 -if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then +# MIPSPro compiler/preprocessor behaves differently if invoked on +# stdin vs file. Here we test for stdin, but lateron we use files. +# So force it to work the way we know it does: +if [ x"${OPSYS}" = x"IRIX" ]; then + echo "Hacking MIPSPro on file vs. stdin..." >&4 + echo "We know we can catify or stringify, separately or together!" + cpp_stuff=42 +elif $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then echo "Oh! Smells like ANSI's been here." >&4 echo "We can catify or stringify, separately or together!" cpp_stuff=42 --- pp_sys.c,orig Wed Aug 20 21:40:10 2008 +++ pp_sys.c Wed Aug 20 21:43:13 2008 @@ -4516,12 +4516,15 @@ when = (Time_t)SvIVx(POPs); #endif - if (PL_op->op_type == OP_LOCALTIME) + if (PL_op->op_type == OP_LOCALTIME) { #ifdef LOCALTIME_EDGECASE_BROKEN tmbuf = S_my_localtime(aTHX_ &when); #else + /* Explicitly invoke tzset() as localtime_r may not. */ + tzset(); tmbuf = localtime(&when); #endif + } else tmbuf = gmtime(&when);
Created attachment 163417 [details, diff] libperl ebuild patch
Created attachment 163418 [details, diff] perl ebuild patch
Created attachment 163420 [details, diff] Perl Configure patch
Created attachment 163422 [details, diff] Perl pp_sys.c patch
Created attachment 163426 [details, diff] Improved perl 5.8.8-r5 ebuild patch This patch is a complete all-in-one patch for Perl ebuild. It's Stuart's patch, just prepared for easy application.
patch applied, thanks!
Created attachment 188966 [details, diff] ebuild patches required for perl & libperl on IRIX perl includes a symlink: $EPREFIX/usr/bin/perl -> perl5.8.8 ... but some builds (at least dev-libs/nspr) instead look for a 'perl5' binary, finding the outdated system perl binary. An $EPREFIX/usr/bin/perl5 -> perl5.8.8 link is also needed. In addition, the attached ebuild changes are still required for IRIX.
(Reopening for additional symlink and ebuild modifications)
(In reply to comment #12) > Created an attachment (id=188966) [edit] > ebuild patches required for perl & libperl on IRIX > > > perl includes a symlink: > > $EPREFIX/usr/bin/perl -> perl5.8.8 > > ... but some builds (at least dev-libs/nspr) instead look for a 'perl5' binary, > finding the outdated system perl binary. > > An $EPREFIX/usr/bin/perl5 -> perl5.8.8 link is also needed. > > In addition, the attached ebuild changes are still required for IRIX. > gentoo-x86 does not provide a perl5 symlink. This is unlikely to get accepted.
... but packages *are* looking for a 'perl5' binary and the system perl does provide a perl5 binary - so at least some builds are trying to build against system perl5.00405 rather than prefix perl5.8.8. The options seem to be auditing every package to check for this problem, or simply providing a 'perl5' in prefix perl. (Since system perl does include 'perl5', x86 omitting it seems more likely to be an oversight: On a system with only one perl distribution installed, this issue will likely not ever be encountered.) It could well be that the system perl only includes a 'perl5' symlink because the version is effectively 5.0.0, and so only having a 'perl5.8.8' symlink in portage is technically correct - but if builds are looking for the former, the perl package should probably provide it.
we don't want to provide perl5 for a single package (no real problems with having it, though)