openpkg/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 428
f880f219c566
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	2011-06-09 22:04:29.000000000 +0200
     8 +++ installperl	2011-06-17 15:20:48.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 @@ -349,6 +351,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 (chdir "lib") {
    26      $do_installarchlib = ! samepath($installarchlib, '.');
    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	2011-09-19 15:18:22.000000000 +0200
    45 +++ hints/darwin.sh	2011-12-24 12:00:58.000000000 +0100
    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 +
    85 -----------------------------------------------------------------------------
    87 Port to Tru64 5.1:
    89 Under Tru64 our gcc has to be built without binutils and the system
    90 ld(1) does not accept a "-O" option, so remove the whole passing of
    91 optimization flags to ld(1). Under a brain-dead platform like Tru64 we
    92 really don't need any more optimization because we are already happy if
    93 it works at all.
    95 Index: hints/dec_osf.sh
    96 --- hints/dec_osf.sh.orig	2011-06-17 02:06:09.000000000 +0200
    97 +++ hints/dec_osf.sh	2011-06-17 15:20:48.000000000 +0200
    98 @@ -73,15 +73,6 @@
    99  *)            if $test "X$optimize" = "X$undef"; then
   100                        lddlflags="$lddlflags -msym"
   101                else
   102 -		  case "$myosvers" in
   103 -		  *4.0D*)
   104 -		      # QAR 56761: -O4 + .so may produce broken code,
   105 -		      # fixed in 4.0E or better.
   106 -		      ;;
   107 -		  *)
   108 -                      lddlflags="$lddlflags $optimize"
   109 -		      ;;
   110 -		  esac
   111  		  # -msym: If using a sufficiently recent /sbin/loader,
   112  		  # keep the module symbols with the modules.
   113                    lddlflags="$lddlflags -msym $_lddlflags_strict_ansi"
   115 -----------------------------------------------------------------------------
   117 Linker flag change for Solaris.
   119 Index: Configure
   120 --- Configure.orig	2011-06-09 22:04:29.000000000 +0200
   121 +++ Configure	2011-06-17 15:20:48.000000000 +0200
   122 @@ -8014,9 +8014,9 @@
   123  			      ;;
   124  			linux|irix*|gnu*)  dflt="-shared $optimize" ;;
   125  			next)  dflt='none' ;;
   126 -			solaris) dflt='-G' ;;
   127 +			solaris) dflt='-shared' ;;
   128  			sunos) dflt='-assert nodefinitions' ;;
   129 -			svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
   130 +			svr4*|esix*|nonstopux) dflt="-shared $ldflags" ;;
   131  	        *)     dflt='none' ;;
   132  			esac
   133  			;;
   135 -----------------------------------------------------------------------------
   137 Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl)
   139 Index: sv.c
   140 --- sv.c.orig	2011-06-17 02:06:09.000000000 +0200
   141 +++ sv.c	2011-06-17 15:20:48.000000000 +0200
   142 @@ -10283,7 +10283,10 @@
   143  	if ( (width = expect_number(&q)) ) {
   144  	    if (*q == '$') {
   145  		++q;
   146 -		efix = width;
   147 +		if (width > PERL_INT_MAX)
   148 +		    efix = PERL_INT_MAX;
   149 +		else
   150 +		    efix = width;
   151  	    } else {
   152  		goto gotwidth;
   153  	    }
   155 -----------------------------------------------------------------------------
   157 Do not use -fstack-protector as it causes too much portability issues.
   159 Index: Configure
   160 --- Configure.orig	2011-06-09 22:04:29.000000000 +0200
   161 +++ Configure	2011-06-17 15:20:48.000000000 +0200
   162 @@ -5103,17 +5103,6 @@
   163  		;;
   164  	esac
   166 -	# on x86_64 (at least) we require an extra library (libssp) in the
   167 -	# link command line. This library is not named, so I infer that it is
   168 -	# an implementation detail that may change. Hence the safest approach
   169 -	# is to add the flag to the flags passed to the compiler at link time,
   170 -	# as that way the compiler can do the right implementation dependant
   171 -	# thing. (NWC)
   172 -	case "$gccversion" in
   173 -	?*)	set stack-protector -fstack-protector
   174 -		eval $checkccflag
   175 -		;;
   176 -	esac
   177  	;;
   178  esac
   180 @@ -5241,15 +5241,6 @@
   181  	;;
   182  *) dflt="$ldflags";;
   183  esac
   184 -# See note above about -fstack-protector
   185 -case "$ccflags" in
   186 -*-fstack-protector*) 
   187 -	case "$dflt" in
   188 -	*-fstack-protector*) ;; # Don't add it again
   189 -	*) dflt="$dflt -fstack-protector" ;; 
   190 -	esac
   191 -	;;
   192 -esac
   194  : Try to guess additional flags to pick up local libraries.
   195  for thislibdir in $libpth; do
   196 @@ -8023,14 +8023,6 @@
   197  	''|' ') dflt='none' ;;
   198  	esac
   200 -	case "$ldflags" in
   201 -	*-fstack-protector*)
   202 -	    case "$dflt" in
   203 -			*-fstack-protector*) ;; # Don't add it again
   204 -			*) dflt="$dflt -fstack-protector" ;; 
   205 -		esac
   206 -		;;
   207 -	esac
   210      rp="Any special flags to pass to $ld to create a dynamically loaded library?"
   212 -----------------------------------------------------------------------------
   214 Make sure we install into <prefix>/lib/perl/ and not <prefix>/lib/perl5/
   216 Index: Configure
   217 --- Configure.orig	2009-08-24 18:33:49 +0200
   218 +++ Configure	2009-08-24 18:44:39 +0200
   219 @@ -1778,7 +1778,7 @@
   220  touch posthint.sh
   222  : set package name
   223 -package='perl5'
   224 +package='perl'
   225  first=`echo $package | sed -e 's/^\(.\).*/\1/'`
   226  last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
   227  case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
   229 -----------------------------------------------------------------------------
   231 Linking against just libgdbm_compat under at least SUSE fails 
   232 because it also needs libgdbm (which Perl doesn't pick up, too)
   234 Index: hints/linux.sh
   235 --- hints/linux.sh.orig	2011-06-09 22:04:29.000000000 +0200
   236 +++ hints/linux.sh	2011-06-17 15:20:48.000000000 +0200
   237 @@ -58,7 +58,9 @@
   238  libswanted="$*"
   240  # Debian 4.0 puts ndbm in the -lgdbm_compat library.
   241 -libswanted="$libswanted gdbm_compat"
   242 +if [ -f /etc/debian_version -o -f /etc/ubuntu_version ]; then
   243 +    libswanted="$libswanted gdbm_compat"
   244 +fi
   246  # If you have glibc, then report the version for ./myconfig bug reporting.
   247  # (Configure doesn't need to know the specific version since it just uses
   249 Index: Configure
   250 --- Configure.orig	2012-05-31 14:59:16.000000000 +0200
   251 +++ Configure	2012-05-31 15:04:27.000000000 +0200
   252 @@ -22206,6 +22206,7 @@
   253      for xxx in *; do
   254  	case "$xxx" in
   255  	    DynaLoader|dynaload) ;;
   256 +        \* ) ;;
   257  	    *)
   258  	    this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
   259  	    leaf=`echo $xxx | $sed -e s/.*-//`;

mercurial