Fri, 16 Jan 2009 10:58:21 +0100
Correct and improve code logic, buildconf, and packaging. In particular:
1. Use descriptive variable names <var>libs instead of just <var>.
2. Although Nokia states in all Qt builds that 'NOTE: When linking
against OpenSSL, you can override the default library names
through OPENSSL_LIBS.' and even gives an example, their own
configuration logic rejects such an attempt. Correct this by
hard coding the OpenSSL library string in the configure script.
3. Consistently use the whitespace substitution [\t ] throughout.
4. Patch the buggy INCPATH of SQL plugin Qmake project files.
5. Add the 'x11' configuration variable to the qtconfig Qmake
project using the src/gui/gui.pro file as a model. This is
needed for qtconfig although not in other tools, because
the qtconfig buildconf indirectly includes qt_x11_p.h which
is dependent on X11 headers.
6. Avoid 'ld.so: fatal: hardware capability unsupported: SSE2 AMD_3DNow'
on platforms for which the config.tests/unix/[3dnow|sse2] succeed
although unsopported at run time by testing for the x86-64
instruction set at build time and regulating hardware capabilities.
7. Correctly install the desinger plugin by explicitly building it.
8. Remove custom plugin installation logic which is unnecessary.
9. Correct removal of temporary paths from shared object files.
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@22 | 7 | --- installperl.orig 2007-12-18 11:47:07 +0100 |
michael@22 | 8 | +++ installperl 2008-03-28 15:23:47 +0100 |
michael@22 | 9 | @@ -211,6 +211,8 @@ |
michael@22 | 10 | my $installarchlib = "$destdir$Config{installarchlib}"; |
michael@22 | 11 | my $installsitelib = "$destdir$Config{installsitelib}"; |
michael@22 | 12 | my $installsitearch = "$destdir$Config{installsitearch}"; |
michael@22 | 13 | +my $installvendorlib = "$destdir$Config{installvendorlib}"; |
michael@22 | 14 | +my $installvendorarch = "$destdir$Config{installvendorarch}"; |
michael@22 | 15 | my $installman1dir = "$destdir$Config{installman1dir}"; |
michael@22 | 16 | my $man1ext = $Config{man1ext}; |
michael@22 | 17 | my $libperl = $Config{libperl}; |
michael@22 | 18 | @@ -372,6 +374,8 @@ |
michael@22 | 19 | mkpath($installarchlib, $verbose, 0777); |
michael@22 | 20 | mkpath($installsitelib, $verbose, 0777) if ($installsitelib); |
michael@22 | 21 | mkpath($installsitearch, $verbose, 0777) if ($installsitearch); |
michael@22 | 22 | +mkpath($installvendorlib, $verbose, 0777) if ($installvendorlib); |
michael@22 | 23 | +mkpath($installvendorarch, $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 | By default, the Perl module search order is "use lib, -I, PERL[5]LIB, |
michael@22 | 31 | perl, site, vendor, other". This means that in OpenPKG both the modules |
michael@22 | 32 | installed via CPAN shell (in "site" area) and the "perl-xxx" packages |
michael@22 | 33 | (in "vendor" area) cannot override the (sometimes obsoleted) module |
michael@22 | 34 | versions distributed with Perl (in "perl" area). Hence, we change |
michael@22 | 35 | the search order to a more reasonable one for OpenPKG: "use lib, -I, |
michael@22 | 36 | PERL[5]LIB, site, vendor, perl, other". |
michael@22 | 37 | |
michael@22 | 38 | Index: perl.c |
michael@22 | 39 | --- perl.c.orig 2007-12-18 11:47:08 +0100 |
michael@22 | 40 | +++ perl.c 2008-03-28 15:23:47 +0100 |
michael@22 | 41 | @@ -4753,39 +4753,6 @@ |
michael@22 | 42 | incpush(APPLLIB_EXP, TRUE, TRUE, TRUE, TRUE); |
michael@22 | 43 | #endif |
michael@22 | 44 | |
michael@22 | 45 | -#ifdef ARCHLIB_EXP |
michael@22 | 46 | - incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE); |
michael@22 | 47 | -#endif |
michael@22 | 48 | -#ifdef MACOS_TRADITIONAL |
michael@22 | 49 | - { |
michael@22 | 50 | - Stat_t tmpstatbuf; |
michael@22 | 51 | - SV * privdir = newSV(0); |
michael@22 | 52 | - char * macperl = PerlEnv_getenv("MACPERL"); |
michael@22 | 53 | - |
michael@22 | 54 | - if (!macperl) |
michael@22 | 55 | - macperl = ""; |
michael@22 | 56 | - |
michael@22 | 57 | - Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl); |
michael@22 | 58 | - if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) |
michael@22 | 59 | - incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE); |
michael@22 | 60 | - Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl); |
michael@22 | 61 | - if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) |
michael@22 | 62 | - incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE); |
michael@22 | 63 | - |
michael@22 | 64 | - SvREFCNT_dec(privdir); |
michael@22 | 65 | - } |
michael@22 | 66 | - if (!PL_tainting) |
michael@22 | 67 | - incpush(":", FALSE, FALSE, TRUE, FALSE); |
michael@22 | 68 | -#else |
michael@22 | 69 | -#ifndef PRIVLIB_EXP |
michael@22 | 70 | -# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl" |
michael@22 | 71 | -#endif |
michael@22 | 72 | -#if defined(WIN32) |
michael@22 | 73 | - incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE); |
michael@22 | 74 | -#else |
michael@22 | 75 | - incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE); |
michael@22 | 76 | -#endif |
michael@22 | 77 | - |
michael@22 | 78 | #ifdef SITEARCH_EXP |
michael@22 | 79 | /* sitearch is always relative to sitelib on Windows for |
michael@22 | 80 | * DLL-based path intuition to work correctly */ |
michael@22 | 81 | @@ -4828,6 +4795,39 @@ |
michael@22 | 82 | incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE, TRUE); |
michael@22 | 83 | #endif |
michael@22 | 84 | |
michael@22 | 85 | +#ifdef ARCHLIB_EXP |
michael@22 | 86 | + incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE); |
michael@22 | 87 | +#endif |
michael@22 | 88 | +#ifdef MACOS_TRADITIONAL |
michael@22 | 89 | + { |
michael@22 | 90 | + Stat_t tmpstatbuf; |
michael@22 | 91 | + SV * privdir = newSV(0); |
michael@22 | 92 | + char * macperl = PerlEnv_getenv("MACPERL"); |
michael@22 | 93 | + |
michael@22 | 94 | + if (!macperl) |
michael@22 | 95 | + macperl = ""; |
michael@22 | 96 | + |
michael@22 | 97 | + Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl); |
michael@22 | 98 | + if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) |
michael@22 | 99 | + incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE); |
michael@22 | 100 | + Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl); |
michael@22 | 101 | + if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) |
michael@22 | 102 | + incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE); |
michael@22 | 103 | + |
michael@22 | 104 | + SvREFCNT_dec(privdir); |
michael@22 | 105 | + } |
michael@22 | 106 | + if (!PL_tainting) |
michael@22 | 107 | + incpush(":", FALSE, FALSE, TRUE, FALSE); |
michael@22 | 108 | +#else |
michael@22 | 109 | +#ifndef PRIVLIB_EXP |
michael@22 | 110 | +# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl" |
michael@22 | 111 | +#endif |
michael@22 | 112 | +#if defined(WIN32) |
michael@22 | 113 | + incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE); |
michael@22 | 114 | +#else |
michael@22 | 115 | + incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE); |
michael@22 | 116 | +#endif |
michael@22 | 117 | + |
michael@22 | 118 | #ifdef PERL_OTHERLIBDIRS |
michael@22 | 119 | incpush(PERL_OTHERLIBDIRS, TRUE, TRUE, TRUE, TRUE); |
michael@22 | 120 | #endif |
michael@22 | 121 | |
michael@22 | 122 | ----------------------------------------------------------------------------- |
michael@22 | 123 | |
michael@22 | 124 | Port to [Open]Darwin 6.6.2: |
michael@22 | 125 | |
michael@22 | 126 | 1. In OpenPKG, Perl does not use the vendor GCC and our GCC does not |
michael@22 | 127 | understand "-no-cpp-precomp", so remove this build option. |
michael@22 | 128 | |
michael@22 | 129 | 2. The <sys/mman.h> indirectly includes system specific headers |
michael@22 | 130 | which in turn have fields named "environ" while Perl uses |
michael@22 | 131 | a define of "environ" internally. So wrap the inclusion. |
michael@22 | 132 | |
michael@22 | 133 | 3. Darwin 6 no longer accepts the non-standard "#import" statements, |
michael@22 | 134 | so replace with "#include" and circumvent some header problem |
michael@22 | 135 | related to the non-standard "__private_extern__" attribute. |
michael@22 | 136 | |
michael@22 | 137 | Index: hints/darwin.sh |
michael@22 | 138 | --- hints/darwin.sh.orig 2007-12-18 11:47:07 +0100 |
michael@22 | 139 | +++ hints/darwin.sh 2008-03-28 15:23:47 +0100 |
michael@22 | 140 | @@ -120,9 +120,6 @@ |
michael@22 | 141 | *-2147483648) ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN" ;; |
michael@22 | 142 | esac |
michael@22 | 143 | |
michael@22 | 144 | -# Avoid Apple's cpp precompiler, better for extensions |
michael@22 | 145 | -cppflags="${cppflags} -no-cpp-precomp" |
michael@22 | 146 | - |
michael@22 | 147 | # This is necessary because perl's build system doesn't |
michael@22 | 148 | # apply cppflags to cc compile lines as it should. |
michael@22 | 149 | ccflags="${ccflags} ${cppflags}" |
michael@22 | 150 | @@ -182,8 +179,7 @@ |
michael@22 | 151 | esac |
michael@22 | 152 | ldlibpthname='DYLD_LIBRARY_PATH'; |
michael@22 | 153 | |
michael@22 | 154 | -# useshrplib=true results in much slower startup times. |
michael@22 | 155 | -# 'false' is the default value. Use Configure -Duseshrplib to override. |
michael@22 | 156 | +useshrplib='true' |
michael@22 | 157 | |
michael@22 | 158 | cat > UU/archname.cbu <<'EOCBU' |
michael@22 | 159 | # This script UU/archname.cbu will get 'called-back' by Configure |
michael@22 | 160 | Index: perlio.c |
michael@22 | 161 | --- perlio.c.orig 2007-12-18 11:47:08 +0100 |
michael@22 | 162 | +++ perlio.c 2008-03-28 15:23:47 +0100 |
michael@22 | 163 | @@ -472,7 +472,14 @@ |
michael@22 | 164 | #include <unistd.h> |
michael@22 | 165 | #endif |
michael@22 | 166 | #ifdef HAS_MMAP |
michael@22 | 167 | +#ifdef PERL_DARWIN |
michael@22 | 168 | +#define environ_safe environ |
michael@22 | 169 | +#undef environ |
michael@22 | 170 | #include <sys/mman.h> |
michael@22 | 171 | +#define environ environ_safe |
michael@22 | 172 | +#else |
michael@22 | 173 | +#include <sys/mman.h> |
michael@22 | 174 | +#endif |
michael@22 | 175 | #endif |
michael@22 | 176 | |
michael@22 | 177 | void |
michael@22 | 178 | Index: ext/DynaLoader/dl_dyld.xs |
michael@22 | 179 | --- ext/DynaLoader/dl_dyld.xs.orig 2007-12-18 11:47:07 +0100 |
michael@22 | 180 | +++ ext/DynaLoader/dl_dyld.xs 2008-03-28 15:23:47 +0100 |
michael@22 | 181 | @@ -45,7 +45,13 @@ |
michael@22 | 182 | |
michael@22 | 183 | #undef environ |
michael@22 | 184 | #undef bool |
michael@22 | 185 | +#ifdef PERL_DARWIN |
michael@22 | 186 | +#define __private_extern__ extern |
michael@22 | 187 | +#include <mach-o/dyld.h> |
michael@22 | 188 | +#undef __private_extern__ |
michael@22 | 189 | +#else |
michael@22 | 190 | #import <mach-o/dyld.h> |
michael@22 | 191 | +#endif |
michael@22 | 192 | |
michael@22 | 193 | static char *dlerror() |
michael@22 | 194 | { |
michael@22 | 195 | |
michael@22 | 196 | ----------------------------------------------------------------------------- |
michael@22 | 197 | |
michael@22 | 198 | Port to Tru64 5.1: |
michael@22 | 199 | |
michael@22 | 200 | Under Tru64 our gcc has to be built without binutils and the system |
michael@22 | 201 | ld(1) does not accept a "-O" option, so remove the whole passing of |
michael@22 | 202 | optimization flags to ld(1). Under a brain-dead platform like Tru64 we |
michael@22 | 203 | really don't need any more optimization because we are already happy if |
michael@22 | 204 | it works at all. |
michael@22 | 205 | |
michael@22 | 206 | Index: hints/dec_osf.sh |
michael@22 | 207 | --- hints/dec_osf.sh.orig 2007-12-18 11:47:07 +0100 |
michael@22 | 208 | +++ hints/dec_osf.sh 2008-03-28 15:23:47 +0100 |
michael@22 | 209 | @@ -73,15 +73,6 @@ |
michael@22 | 210 | *) if $test "X$optimize" = "X$undef"; then |
michael@22 | 211 | lddlflags="$lddlflags -msym" |
michael@22 | 212 | else |
michael@22 | 213 | - case "$myosvers" in |
michael@22 | 214 | - *4.0D*) |
michael@22 | 215 | - # QAR 56761: -O4 + .so may produce broken code, |
michael@22 | 216 | - # fixed in 4.0E or better. |
michael@22 | 217 | - ;; |
michael@22 | 218 | - *) |
michael@22 | 219 | - lddlflags="$lddlflags $optimize" |
michael@22 | 220 | - ;; |
michael@22 | 221 | - esac |
michael@22 | 222 | # -msym: If using a sufficiently recent /sbin/loader, |
michael@22 | 223 | # keep the module symbols with the modules. |
michael@22 | 224 | lddlflags="$lddlflags -msym $_lddlflags_strict_ansi" |
michael@22 | 225 | |
michael@22 | 226 | ----------------------------------------------------------------------------- |
michael@22 | 227 | |
michael@22 | 228 | http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0976 |
michael@22 | 229 | Multiple scripts in the perl package in Trustix Secure Linux 1.5 |
michael@22 | 230 | through 2.1, and possibly other operating systems, allows local |
michael@22 | 231 | users to overwrite files via a symlink attack on temporary files. |
michael@22 | 232 | |
michael@22 | 233 | Index: lib/CGI/Cookie.pm |
michael@22 | 234 | --- lib/CGI/Cookie.pm.orig 2007-12-18 11:47:07 +0100 |
michael@22 | 235 | +++ lib/CGI/Cookie.pm 2008-03-28 15:23:47 +0100 |
michael@22 | 236 | @@ -470,7 +470,7 @@ |
michael@22 | 237 | You may also retrieve cookies that were stored in some external |
michael@22 | 238 | form using the parse() class method: |
michael@22 | 239 | |
michael@22 | 240 | - $COOKIES = `cat /usr/tmp/Cookie_stash`; |
michael@22 | 241 | + $COOKIES = `cat /var/run/www/Cookie_stash`; |
michael@22 | 242 | %cookies = parse CGI::Cookie($COOKIES); |
michael@22 | 243 | |
michael@22 | 244 | If you are in a mod_perl environment, you can save some overhead by |
michael@22 | 245 | Index: lib/Shell.pm |
michael@22 | 246 | --- lib/Shell.pm.orig 2007-12-18 11:47:07 +0100 |
michael@22 | 247 | +++ lib/Shell.pm 2008-03-28 15:23:47 +0100 |
michael@22 | 248 | @@ -151,7 +151,7 @@ |
michael@22 | 249 | use Shell qw(cat ps cp); |
michael@22 | 250 | $passwd = cat('</etc/passwd'); |
michael@22 | 251 | @pslines = ps('-ww'), |
michael@22 | 252 | - cp("/etc/passwd", "/tmp/passwd"); |
michael@22 | 253 | + cp("/etc/passwd", "/etc/passwd.orig"); |
michael@22 | 254 | |
michael@22 | 255 | # object oriented |
michael@22 | 256 | my $sh = Shell->new; |
michael@22 | 257 | |
michael@22 | 258 | ----------------------------------------------------------------------------- |
michael@22 | 259 | |
michael@22 | 260 | Index: Configure |
michael@22 | 261 | --- Configure.orig 2007-12-18 11:47:07 +0100 |
michael@22 | 262 | +++ Configure 2008-03-28 15:23:47 +0100 |
michael@22 | 263 | @@ -7871,7 +7871,7 @@ |
michael@22 | 264 | ;; |
michael@22 | 265 | linux|irix*|gnu*) dflt="-shared $optimize" ;; |
michael@22 | 266 | next) dflt='none' ;; |
michael@22 | 267 | - solaris) dflt='-G' ;; |
michael@22 | 268 | + solaris) dflt='-shared' ;; |
michael@22 | 269 | sunos) dflt='-assert nodefinitions' ;; |
michael@22 | 270 | svr4*|esix*|nonstopux) dflt="-G $ldflags" ;; |
michael@22 | 271 | *) dflt='none' ;; |
michael@22 | 272 | |
michael@22 | 273 | ----------------------------------------------------------------------------- |
michael@22 | 274 | |
michael@22 | 275 | Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl) |
michael@22 | 276 | |
michael@22 | 277 | Index: sv.c |
michael@22 | 278 | --- sv.c.orig 2007-12-18 11:47:08 +0100 |
michael@22 | 279 | +++ sv.c 2008-03-28 15:23:47 +0100 |
michael@22 | 280 | @@ -8667,7 +8667,10 @@ |
michael@22 | 281 | if ( (width = expect_number(&q)) ) { |
michael@22 | 282 | if (*q == '$') { |
michael@22 | 283 | ++q; |
michael@22 | 284 | - efix = width; |
michael@22 | 285 | + if (width > PERL_INT_MAX) |
michael@22 | 286 | + efix = PERL_INT_MAX; |
michael@22 | 287 | + else |
michael@22 | 288 | + efix = width; |
michael@22 | 289 | } else { |
michael@22 | 290 | goto gotwidth; |
michael@22 | 291 | } |
michael@22 | 292 | |
michael@22 | 293 | ----------------------------------------------------------------------------- |
michael@22 | 294 | |
michael@22 | 295 | Detect NetBSD 5.x as well |
michael@22 | 296 | |
michael@22 | 297 | Index: hints/netbsd.sh |
michael@22 | 298 | --- hints/netbsd.sh.orig 2007-12-18 11:47:07.000000000 +0100 |
michael@22 | 299 | +++ hints/netbsd.sh 2008-12-24 10:51:08.000000000 +0100 |
michael@22 | 300 | @@ -79,7 +79,7 @@ |
michael@22 | 301 | ;; |
michael@22 | 302 | esac |
michael@22 | 303 | case "$osvers" in |
michael@22 | 304 | -0.9*|1.*|2.*|3.*|4.*) |
michael@22 | 305 | +0.9*|1.*|2.*|3.*|4.*|5.*) |
michael@22 | 306 | d_getprotoent_r="$undef" |
michael@22 | 307 | d_getprotobyname_r="$undef" |
michael@22 | 308 | d_getprotobynumber_r="$undef" |
michael@22 | 309 | |
michael@23 | 310 | ----------------------------------------------------------------------------- |
michael@23 | 311 | |
michael@23 | 312 | Corrections for Solaris 11: |
michael@23 | 313 | |
michael@23 | 314 | Index: perl.h |
michael@23 | 315 | diff -Nau perl.h.orig perl.h |
michael@23 | 316 | --- perl.h.orig 2007-12-18 11:47:08.000000000 +0100 |
michael@23 | 317 | +++ perl.h 2009-01-06 15:28:45.843276063 +0100 |
michael@23 | 318 | @@ -1393,6 +1393,7 @@ |
michael@23 | 319 | */ |
michael@23 | 320 | |
michael@23 | 321 | #if defined(I_SYSMODE) && !defined(PERL_MICRO) |
michael@23 | 322 | +#include <sys/vnode.h> |
michael@23 | 323 | #include <sys/mode.h> |
michael@23 | 324 | #endif |
michael@23 | 325 |