Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 209156 - sys-devel/libperl-5.8.8-r2 & dev-lang/perl-5.8.8-r5 patches for IRIX
Summary: sys-devel/libperl-5.8.8-r2 & dev-lang/perl-5.8.8-r5 patches for IRIX
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All IRIX
: High major (vote)
Assignee: Gentoo non-Linux Team
URL:
Whiteboard:
Keywords:
Depends on: 267068
Blocks:
  Show dependency tree
 
Reported: 2008-02-06 15:58 UTC by Stuart Shelton
Modified: 2009-04-28 19:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
libperl ebuild patch (libperl-5.8.8-r2.ebuild.irix.patch,391 bytes, patch)
2008-08-20 21:52 UTC, Davor Ocelic
Details | Diff
perl ebuild patch (perl-5.8.8-r5.ebuild.irix.patch,828 bytes, patch)
2008-08-20 21:53 UTC, Davor Ocelic
Details | Diff
Perl Configure patch (Configure.irix.patch,791 bytes, patch)
2008-08-20 21:53 UTC, Davor Ocelic
Details | Diff
Perl pp_sys.c patch (pp_sys.c.irix.patch,458 bytes, patch)
2008-08-20 21:53 UTC, Davor Ocelic
Details | Diff
Improved perl 5.8.8-r5 ebuild patch (perl-5.8.8-r5.ebuild.patch,2.52 KB, patch)
2008-08-20 22:18 UTC, Davor Ocelic
Details | Diff
ebuild patches required for perl & libperl on IRIX (perl.ebuild.patch,4.41 KB, patch)
2009-04-20 14:58 UTC, Stuart Shelton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2008-02-06 15:58:29 UTC
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
Comment 1 Stuart Shelton 2008-02-06 16:06:12 UTC
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);
Comment 2 Fabian Groffen gentoo-dev 2008-02-11 10:41:55 UTC
(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?
Comment 3 Stuart Shelton 2008-02-11 12:45:46 UTC
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...)
Comment 4 Davor Ocelic 2008-08-20 21:36:37 UTC
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' \
Comment 5 Davor Ocelic 2008-08-20 21:47:20 UTC
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);
 
Comment 6 Davor Ocelic 2008-08-20 21:52:36 UTC
Created attachment 163417 [details, diff]
libperl ebuild patch
Comment 7 Davor Ocelic 2008-08-20 21:53:06 UTC
Created attachment 163418 [details, diff]
perl ebuild patch
Comment 8 Davor Ocelic 2008-08-20 21:53:25 UTC
Created attachment 163420 [details, diff]
Perl Configure patch
Comment 9 Davor Ocelic 2008-08-20 21:53:48 UTC
Created attachment 163422 [details, diff]
Perl pp_sys.c patch
Comment 10 Davor Ocelic 2008-08-20 22:18:57 UTC
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.
Comment 11 Fabian Groffen gentoo-dev 2008-12-27 18:35:35 UTC
patch applied, thanks!
Comment 12 Stuart Shelton 2009-04-20 14:58:22 UTC
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.
Comment 13 Stuart Shelton 2009-04-20 14:58:59 UTC
(Reopening for additional symlink and ebuild modifications)
Comment 14 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-20 15:41:31 UTC
(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.
Comment 15 Stuart Shelton 2009-04-22 09:50:54 UTC
... 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.
Comment 16 Fabian Groffen gentoo-dev 2009-04-28 19:38:01 UTC
we don't want to provide perl5 for a single package (no real problems with having it, though)