perl/perl.patch

Sat, 24 Mar 2012 21:40:49 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 24 Mar 2012 21:40:49 +0100
changeset 414
fd611cde817f
parent 23
1eecce5d3fe6
child 501
4d4d275a712a
permissions
-rw-r--r--

Introduce many changes to the buildconf and source code including:
(01) clean up, update, and partially update default config files,
(02) seems that Melware is unable to perform release engineering so
update chan_capi to new daily snapshot to solve echo problems,
(03) correct Asterisk inadequate hard coded gmime version check,
(04) force postgresql pthreads linkage to solve build problem,
(05) remove buggy hard coded LibXML configure definitions,
(06) remove local architecture specification to allow GCC
internal logic to determine proper CPU type instead,
(07) remove vendor sound install target causing uncontrolled
downloads and non RPM managed file installation,
(08) solve long outstanding bug in tcptls causing Asterisk
to ignore any intermediate CA certificate signatures,
(09) back out Digium engineering team's bright idea of replacing the
very portable and pervasive POSIX rand(1) with ast_random(), and
then not even implementing it causing all references to fail in
platforms not providing the very new POSIX.1-2008 mkdtemp(3)
function only distributed by BSD and some Linux,
(10) withdraw advanced linker symbol manipulations from SVR5 builds
until either Binutils supports hybrid versioned and anonymous
linker scripts or GCC stops hard coding versioned linker scripts,
(11) correct missing library linkage, some tailored to a specific OS,
(12) remove outdated logic for the no longer distributed gmime-config(1),
(13) remove local gmime buildconf hacks now that Asterisk has corrected
their own build configuration to almost portably support gmime,
(14) solve build problems relating to undetected LibXML paths,
(15) correct erroneous out of tree include definitions,
(16) improve some variable and comment naming,
(17) simplify sound language path hierarchy creation,
and correct australian english installation logic.

     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 @@ -200,6 +200,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-06-09 22:04:29.000000000 +0200
    45 +++ hints/darwin.sh	2011-06-17 15:20:48.000000000 +0200
    46 @@ -189,8 +189,7 @@
    47  esac
    48  ldlibpthname='DYLD_LIBRARY_PATH';
    50 -# useshrplib=true results in much slower startup times.
    51 -# 'false' is the default value.  Use Configure -Duseshrplib to override.
    52 +useshrplib='true'
    54  cat > UU/archname.cbu <<'EOCBU'
    55  # This script UU/archname.cbu will get 'called-back' by Configure 
    56 Index: ext/DynaLoader/dl_dyld.xs
    57 --- ext/DynaLoader/dl_dyld.xs.orig	2011-04-13 13:36:34.000000000 +0200
    58 +++ ext/DynaLoader/dl_dyld.xs	2011-06-17 15:20:48.000000000 +0200
    59 @@ -47,7 +47,13 @@
    61  #undef environ
    62  #undef bool
    63 +#ifdef PERL_DARWIN
    64 +#define __private_extern__ extern
    65 +#include <mach-o/dyld.h>
    66 +#undef __private_extern__
    67 +#else
    68  #import <mach-o/dyld.h>
    69 +#endif
    71  static char *dlerror()
    72  {
    73 Index: perlio.c
    74 --- perlio.c.orig	2011-06-09 22:04:29.000000000 +0200
    75 +++ perlio.c	2011-06-17 15:20:48.000000000 +0200
    76 @@ -476,7 +476,14 @@
    77  #include <unistd.h>
    78  #endif
    79  #ifdef HAS_MMAP
    80 +#ifdef PERL_DARWIN
    81 +#define environ_safe environ
    82 +#undef environ
    83  #include <sys/mman.h>
    84 +#define environ environ_safe
    85 +#else
    86 +#include <sys/mman.h>
    87 +#endif
    88  #endif
    90  void
    92 -----------------------------------------------------------------------------
    94 Port to Tru64 5.1:
    96 Under Tru64 our gcc has to be built without binutils and the system
    97 ld(1) does not accept a "-O" option, so remove the whole passing of
    98 optimization flags to ld(1). Under a brain-dead platform like Tru64 we
    99 really don't need any more optimization because we are already happy if
   100 it works at all.
   102 Index: hints/dec_osf.sh
   103 --- hints/dec_osf.sh.orig	2011-06-17 02:06:09.000000000 +0200
   104 +++ hints/dec_osf.sh	2011-06-17 15:20:48.000000000 +0200
   105 @@ -73,15 +73,6 @@
   106  *)            if $test "X$optimize" = "X$undef"; then
   107                        lddlflags="$lddlflags -msym"
   108                else
   109 -		  case "$myosvers" in
   110 -		  *4.0D*)
   111 -		      # QAR 56761: -O4 + .so may produce broken code,
   112 -		      # fixed in 4.0E or better.
   113 -		      ;;
   114 -		  *)
   115 -                      lddlflags="$lddlflags $optimize"
   116 -		      ;;
   117 -		  esac
   118  		  # -msym: If using a sufficiently recent /sbin/loader,
   119  		  # keep the module symbols with the modules.
   120                    lddlflags="$lddlflags -msym $_lddlflags_strict_ansi"
   122 -----------------------------------------------------------------------------
   124 Linker flag change for Solaris.
   126 Index: Configure
   127 --- Configure.orig	2011-06-09 22:04:29.000000000 +0200
   128 +++ Configure	2011-06-17 15:20:48.000000000 +0200
   129 @@ -8078,9 +8058,9 @@
   130  			      ;;
   131  			linux|irix*|gnu*)  dflt="-shared $optimize" ;;
   132  			next)  dflt='none' ;;
   133 -			solaris) dflt='-G' ;;
   134 +			solaris) dflt='-shared' ;;
   135  			sunos) dflt='-assert nodefinitions' ;;
   136 -			svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
   137 +			svr4*|esix*|nonstopux) dflt="-shared $ldflags" ;;
   138  	        *)     dflt='none' ;;
   139  			esac
   140  			;;
   142 -----------------------------------------------------------------------------
   144 Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl)
   146 Index: sv.c
   147 --- sv.c.orig	2011-06-17 02:06:09.000000000 +0200
   148 +++ sv.c	2011-06-17 15:20:48.000000000 +0200
   149 @@ -10198,7 +10198,10 @@
   150  	if ( (width = expect_number(&q)) ) {
   151  	    if (*q == '$') {
   152  		++q;
   153 -		efix = width;
   154 +		if (width > PERL_INT_MAX)
   155 +		    efix = PERL_INT_MAX;
   156 +		else
   157 +		    efix = width;
   158  	    } else {
   159  		goto gotwidth;
   160  	    }
   162 -----------------------------------------------------------------------------
   164 Do not use -fstack-protector as it causes too much portability issues.
   166 Index: Configure
   167 --- Configure.orig	2011-06-09 22:04:29.000000000 +0200
   168 +++ Configure	2011-06-17 15:20:48.000000000 +0200
   169 @@ -5158,17 +5158,6 @@
   170  		;;
   171  	esac
   173 -	# on x86_64 (at least) we require an extra library (libssp) in the
   174 -	# link command line. This library is not named, so I infer that it is
   175 -	# an implementation detail that may change. Hence the safest approach
   176 -	# is to add the flag to the flags passed to the compiler at link time,
   177 -	# as that way the compiler can do the right implementation dependant
   178 -	# thing. (NWC)
   179 -	case "$gccversion" in
   180 -	?*)	set stack-protector -fstack-protector
   181 -		eval $checkccflag
   182 -		;;
   183 -	esac
   184  	;;
   185  esac
   187 @@ -5307,15 +5296,6 @@
   188  	;;
   189  *) dflt="$ldflags";;
   190  esac
   191 -# See note above about -fstack-protector
   192 -case "$ccflags" in
   193 -*-fstack-protector*) 
   194 -	case "$dflt" in
   195 -	*-fstack-protector*) ;; # Don't add it again
   196 -	*) dflt="$dflt -fstack-protector" ;; 
   197 -	esac
   198 -	;;
   199 -esac
   201  : Try to guess additional flags to pick up local libraries.
   202  for thislibdir in $libpth; do
   203 @@ -8107,14 +8087,6 @@
   204  	''|' ') dflt='none' ;;
   205  	esac
   207 -	case "$ldflags" in
   208 -	*-fstack-protector*)
   209 -	    case "$dflt" in
   210 -			*-fstack-protector*) ;; # Don't add it again
   211 -			*) dflt="$dflt -fstack-protector" ;; 
   212 -		esac
   213 -		;;
   214 -	esac
   217      rp="Any special flags to pass to $ld to create a dynamically loaded library?"
   219 -----------------------------------------------------------------------------
   221 Make sure we install into <prefix>/lib/perl/ and not <prefix>/lib/perl5/
   223 Index: Configure
   224 --- Configure.orig	2009-08-24 18:33:49 +0200
   225 +++ Configure	2009-08-24 18:44:39 +0200
   226 @@ -1769,7 +1769,7 @@
   227  touch posthint.sh
   229  : set package name
   230 -package='perl5'
   231 +package='perl'
   232  first=`echo $package | sed -e 's/^\(.\).*/\1/'`
   233  last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
   234  case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
   236 -----------------------------------------------------------------------------
   238 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0976
   239     Multiple scripts in the perl package in Trustix Secure Linux 1.5
   240     through 2.1, and possibly other operating systems, allows local
   241     users to overwrite files via a symlink attack on temporary files.
   243 Index: cpan/CGI/lib/CGI/Cookie.pm
   244 --- cpan/CGI/lib/CGI/Cookie.pm.orig	2011-06-09 22:04:29.000000000 +0200
   245 +++ cpan/CGI/lib/CGI/Cookie.pm	2011-06-17 15:22:59.000000000 +0200
   246 @@ -464,7 +464,7 @@
   247  You may also retrieve cookies that were stored in some external
   248  form using the parse() class method:
   250 -       $COOKIES = `cat /usr/tmp/Cookie_stash`;
   251 +       $COOKIES = `cat /var/run/www/Cookie_stash`;
   252         %cookies = CGI::Cookie->parse($COOKIES);
   254  If you are in a mod_perl environment, you can save some overhead by
   255 Index: cpan/Shell/Shell.pm
   256 --- cpan/Shell/Shell.pm.orig	2011-06-17 02:06:09.000000000 +0200
   257 +++ cpan/Shell/Shell.pm	2011-06-17 15:20:48.000000000 +0200
   258 @@ -153,7 +153,7 @@
   259     use Shell qw(cat ps cp);
   260     $passwd = cat('</etc/passwd');
   261     @pslines = ps('-ww'),
   262 -   cp("/etc/passwd", "/tmp/passwd");
   263 +   cp("/etc/passwd", "/etc/passwd.orig");
   265     # object oriented 
   266     my $sh = Shell->new;
   268 -----------------------------------------------------------------------------
   270 Linking against just libgdbm_compat under at least SUSE fails 
   271 because it also needs libgdbm (which Perl doesn't pick up, too)
   273 Index: hints/linux.sh
   274 --- hints/linux.sh.orig	2011-06-09 22:04:29.000000000 +0200
   275 +++ hints/linux.sh	2011-06-17 15:20:48.000000000 +0200
   276 @@ -55,7 +55,9 @@
   277  libswanted="$*"
   279  # Debian 4.0 puts ndbm in the -lgdbm_compat library.
   280 -libswanted="$libswanted gdbm_compat"
   281 +if [ -f /etc/debian_version -o -f /etc/ubuntu_version ]; then
   282 +    libswanted="$libswanted gdbm_compat"
   283 +fi
   285  # If you have glibc, then report the version for ./myconfig bug reporting.
   286  # (Configure doesn't need to know the specific version since it just uses

mercurial