perl/perl.patch

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 358
832ab278201b
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

     1 By default, the "vendor" area is not used, so Perl's installation
     2 procedure forgot to create its top-level paths, too. In OpenPKG we use
     3 the "vendor" area, so make sure it is created the same way the "site"
     4 area is.
     6 Index: installperl
     7 --- installperl.orig	2012-04-25 02:18:34.000000000 +0200
     8 +++ installperl	2012-05-31 21:51:43.000000000 +0200
     9 @@ -196,6 +196,8 @@
    10  my $installarchlib = "$opts{destdir}$Config{installarchlib}";
    11  my $installsitelib = "$opts{destdir}$Config{installsitelib}";
    12  my $installsitearch = "$opts{destdir}$Config{installsitearch}";
    13 +my $installvendorlib = "$opts{destdir}$Config{installvendorlib}";
    14 +my $installvendorarch = "$opts{destdir}$Config{installvendorarch}";
    15  my $installman1dir = "$opts{destdir}$Config{installman1dir}";
    16  my $man1ext = $Config{man1ext};
    17  my $libperl = $Config{libperl};
    18 @@ -347,6 +349,8 @@
    19  mkpath($installarchlib, $opts{verbose}, 0777);
    20  mkpath($installsitelib, $opts{verbose}, 0777) if ($installsitelib);
    21  mkpath($installsitearch, $opts{verbose}, 0777) if ($installsitearch);
    22 +mkpath($installvendorlib, $opts{verbose}, 0777) if ($installvendorlib);
    23 +mkpath($installvendorarch, $opts{verbose}, 0777) if ($installvendorarch);
    25  if (-d 'lib') {
    26      find({no_chdir => 1, wanted => \&installlib}, 'lib')
    28 -----------------------------------------------------------------------------
    30 Port to [Open]Darwin 6.6.2:
    32 1. In OpenPKG, Perl does not use the vendor GCC and our GCC does not
    33    understand "-no-cpp-precomp", so remove this build option.
    35 2. The <sys/mman.h> indirectly includes system specific headers
    36    which in turn have fields named "environ" while Perl uses
    37    a define of "environ" internally. So wrap the inclusion.
    39 3. Darwin 6 no longer accepts the non-standard "#import" statements,
    40    so replace with "#include" and circumvent some header problem
    41    related to the non-standard "__private_extern__" attribute.
    43 Index: hints/darwin.sh
    44 --- hints/darwin.sh.orig	2012-02-20 20:48:38.000000000 +0100
    45 +++ hints/darwin.sh	2012-05-31 21:51:43.000000000 +0200
    46 @@ -181,6 +181,20 @@
    47     ldflags="${ldflags} -flat_namespace"
    48     lddlflags="${ldflags} -bundle -undefined suppress"
    49     ;;
    50 +9.*)
    51 +   lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
    52 +   case "$ld" in
    53 +       *MACOSX_DEVELOPMENT_TARGET*) ;;
    54 +       *) ld="env MACOSX_DEPLOYMENT_TARGET=10.5 ${ld}" ;;
    55 +   esac
    56 +   ;;
    57 +10.*)
    58 +   lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
    59 +   case "$ld" in
    60 +       *MACOSX_DEVELOPMENT_TARGET*) ;;
    61 +       *) ld="env MACOSX_DEPLOYMENT_TARGET=10.6 ${ld}" ;;
    62 +   esac
    63 +   ;;
    64  *) 
    65     lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
    66     case "$ld" in
    67 @@ -191,8 +205,7 @@
    68  esac
    69  ldlibpthname='DYLD_LIBRARY_PATH';
    71 -# useshrplib=true results in much slower startup times.
    72 -# 'false' is the default value.  Use Configure -Duseshrplib to override.
    73 +useshrplib='true'
    75  cat > UU/archname.cbu <<'EOCBU'
    76  # This script UU/archname.cbu will get 'called-back' by Configure 
    77 @@ -326,3 +339,6 @@
    78  # makefile in the same place.  Since Darwin uses GNU make, this dodges
    79  # the problem.
    80  firstmakefile=GNUmakefile;
    81 +
    82 +usenm='false'
    83 +
    84 Index: ext/DynaLoader/dl_dyld.xs
    85 --- ext/DynaLoader/dl_dyld.xs.orig	2012-02-15 05:44:47.000000000 +0100
    86 +++ ext/DynaLoader/dl_dyld.xs	2012-05-31 21:51:43.000000000 +0200
    87 @@ -47,7 +47,13 @@
    89  #undef environ
    90  #undef bool
    91 +#ifdef PERL_DARWIN
    92 +#define __private_extern__ extern
    93 +#include <mach-o/dyld.h>
    94 +#undef __private_extern__
    95 +#else
    96  #import <mach-o/dyld.h>
    97 +#endif
    99  static char *dlerror()
   100  {
   102 -----------------------------------------------------------------------------
   104 Port to Tru64 5.1:
   106 Under Tru64 our gcc has to be built without binutils and the system
   107 ld(1) does not accept a "-O" option, so remove the whole passing of
   108 optimization flags to ld(1). Under a brain-dead platform like Tru64 we
   109 really don't need any more optimization because we are already happy if
   110 it works at all.
   112 Index: hints/dec_osf.sh
   113 --- hints/dec_osf.sh.orig	2012-04-25 02:18:34.000000000 +0200
   114 +++ hints/dec_osf.sh	2012-05-31 21:51:43.000000000 +0200
   115 @@ -73,15 +73,6 @@
   116  *)            if $test "X$optimize" = "X$undef"; then
   117                        lddlflags="$lddlflags -msym"
   118                else
   119 -		  case "$myosvers" in
   120 -		  *4.0D*)
   121 -		      # QAR 56761: -O4 + .so may produce broken code,
   122 -		      # fixed in 4.0E or better.
   123 -		      ;;
   124 -		  *)
   125 -                      lddlflags="$lddlflags $optimize"
   126 -		      ;;
   127 -		  esac
   128  		  # -msym: If using a sufficiently recent /sbin/loader,
   129  		  # keep the module symbols with the modules.
   130                    lddlflags="$lddlflags -msym $_lddlflags_strict_ansi"
   132 -----------------------------------------------------------------------------
   134 Linker flag change for Solaris.
   136 Index: Configure
   137 --- Configure.orig	2012-04-25 02:18:30.000000000 +0200
   138 +++ Configure	2012-05-31 21:51:44.000000000 +0200
   139 @@ -8014,9 +7994,9 @@
   140  			      ;;
   141  			linux|irix*|gnu*)  dflt="-shared $optimize" ;;
   142  			next)  dflt='none' ;;
   143 -			solaris) dflt='-G' ;;
   144 +			solaris) dflt='-shared' ;;
   145  			sunos) dflt='-assert nodefinitions' ;;
   146 -			svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
   147 +			svr4*|esix*|nonstopux) dflt="-shared $ldflags" ;;
   148  	        *)     dflt='none' ;;
   149  			esac
   150  			;;
   152 -----------------------------------------------------------------------------
   154 Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl)
   156 Index: sv.c
   157 --- sv.c.orig	2012-04-25 02:18:35.000000000 +0200
   158 +++ sv.c	2012-05-31 21:51:44.000000000 +0200
   159 @@ -10283,7 +10283,10 @@
   160  	if ( (width = expect_number(&q)) ) {
   161  	    if (*q == '$') {
   162  		++q;
   163 -		efix = width;
   164 +		if (width > PERL_INT_MAX)
   165 +		    efix = PERL_INT_MAX;
   166 +		else
   167 +		    efix = width;
   168  	    } else {
   169  		goto gotwidth;
   170  	    }
   172 -----------------------------------------------------------------------------
   174 Do not use -fstack-protector as it causes too much portability issues.
   176 Index: Configure
   177 --- Configure.orig	2012-04-25 02:18:30.000000000 +0200
   178 +++ Configure	2012-05-31 21:51:44.000000000 +0200
   179 @@ -5103,17 +5103,6 @@
   180  		;;
   181  	esac
   183 -	# on x86_64 (at least) we require an extra library (libssp) in the
   184 -	# link command line. This library is not named, so I infer that it is
   185 -	# an implementation detail that may change. Hence the safest approach
   186 -	# is to add the flag to the flags passed to the compiler at link time,
   187 -	# as that way the compiler can do the right implementation dependant
   188 -	# thing. (NWC)
   189 -	case "$gccversion" in
   190 -	?*)	set stack-protector -fstack-protector
   191 -		eval $checkccflag
   192 -		;;
   193 -	esac
   194  	;;
   195  esac
   197 @@ -5252,15 +5241,6 @@
   198  	;;
   199  *) dflt="$ldflags";;
   200  esac
   201 -# See note above about -fstack-protector
   202 -case "$ccflags" in
   203 -*-fstack-protector*) 
   204 -	case "$dflt" in
   205 -	*-fstack-protector*) ;; # Don't add it again
   206 -	*) dflt="$dflt -fstack-protector" ;; 
   207 -	esac
   208 -	;;
   209 -esac
   211  : Try to guess additional flags to pick up local libraries.
   212  for thislibdir in $libpth; do
   213 @@ -8043,14 +8023,6 @@
   214  	''|' ') dflt='none' ;;
   215  	esac
   217 -	case "$ldflags" in
   218 -	*-fstack-protector*)
   219 -	    case "$dflt" in
   220 -			*-fstack-protector*) ;; # Don't add it again
   221 -			*) dflt="$dflt -fstack-protector" ;; 
   222 -		esac
   223 -		;;
   224 -	esac
   227      rp="Any special flags to pass to $ld to create a dynamically loaded library?"
   229 -----------------------------------------------------------------------------
   231 Make sure we install into <prefix>/lib/perl/ and not <prefix>/lib/perl5/
   233 Index: Configure
   234 --- Configure.orig	2012-04-25 02:18:30.000000000 +0200
   235 +++ Configure	2012-05-31 21:51:44.000000000 +0200
   236 @@ -1778,7 +1778,7 @@
   237  touch posthint.sh
   239  : set package name
   240 -package='perl5'
   241 +package='perl'
   242  first=`echo $package | sed -e 's/^\(.\).*/\1/'`
   243  last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
   244  case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
   246 -----------------------------------------------------------------------------
   248 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0976
   249     Multiple scripts in the perl package in Trustix Secure Linux 1.5
   250     through 2.1, and possibly other operating systems, allows local
   251     users to overwrite files via a symlink attack on temporary files.
   253 Index: cpan/CGI/lib/CGI/Cookie.pm
   254 --- cpan/CGI/lib/CGI/Cookie.pm.orig	2012-02-15 05:44:36.000000000 +0100
   255 +++ cpan/CGI/lib/CGI/Cookie.pm	2012-05-31 21:51:44.000000000 +0200
   256 @@ -464,7 +464,7 @@
   257  You may also retrieve cookies that were stored in some external
   258  form using the parse() class method:
   260 -       $COOKIES = `cat /usr/tmp/Cookie_stash`;
   261 +       $COOKIES = `cat /var/run/www/Cookie_stash`;
   262         %cookies = CGI::Cookie->parse($COOKIES);
   264  If you are in a mod_perl environment, you can save some overhead by
   266 -----------------------------------------------------------------------------
   268 Linking against just libgdbm_compat under at least SUSE fails 
   269 because it also needs libgdbm (which Perl doesn't pick up, too)
   271 Index: hints/linux.sh
   272 --- hints/linux.sh.orig	2012-05-14 21:49:22.000000000 +0200
   273 +++ hints/linux.sh	2012-05-31 21:51:44.000000000 +0200
   274 @@ -58,7 +58,9 @@
   275  libswanted="$*"
   277  # Debian 4.0 puts ndbm in the -lgdbm_compat library.
   278 -libswanted="$libswanted gdbm_compat"
   279 +if [ -f /etc/debian_version -o -f /etc/ubuntu_version ]; then
   280 +    libswanted="$libswanted gdbm_compat"
   281 +fi
   283  # If you have glibc, then report the version for ./myconfig bug reporting.
   284  # (Configure doesn't need to know the specific version since it just uses

mercurial