perl/perl.patch

Thu, 02 Aug 2012 23:26:26 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 02 Aug 2012 23:26:26 +0200
changeset 452
30449282a0c7
parent 23
1eecce5d3fe6
child 501
4d4d275a712a
permissions
-rw-r--r--

Avoid a chicken and egg dilemma by removing dependency to flex(1).
Furthermore, use prefer FTP servers to webservers for source downloads.

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

mercurial