From bbca412819702789556ed015bcdee35edccc07a8 Mon Sep 17 00:00:00 2001 From: Nagy Karoly Gabriel Date: Fri, 12 Sep 2008 19:48:19 +0300 Subject: [PATCH] package: revorked perl to crosscompile, WIP --- .../perl-5.8.8-Configure_multilib-1.patch | 54 +++++++++++++++ perl/perl/perl-5.8.8-regex_ssp-1.patch | 40 ++++++++++++ perl/perl/perl.conf | 65 ++++--------------- perl/perl/unistd.patch | 44 +++++++++++++ 4 files changed, 150 insertions(+), 53 deletions(-) create mode 100644 perl/perl/perl-5.8.8-Configure_multilib-1.patch create mode 100644 perl/perl/perl-5.8.8-regex_ssp-1.patch create mode 100644 perl/perl/unistd.patch diff --git a/perl/perl/perl-5.8.8-Configure_multilib-1.patch b/perl/perl/perl-5.8.8-Configure_multilib-1.patch new file mode 100644 index 000000000..b43662776 --- /dev/null +++ b/perl/perl/perl-5.8.8-Configure_multilib-1.patch @@ -0,0 +1,54 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../perl/perl-5.8.8-Configure_multilib-1.patch +# Copyright (C) 2008 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +This patch comes from: +http://www.linuxfromscratch.org/patches/downloads/perl/perl-5.8.8-Configure_multilib-1.patch + +Submitted By: Ryan Oliver +Date: 2005-10-20 +Initial Package Version: 5.8.7 +Origin: Ryan Oliver +Description: this patch allows perl to be installed in /usr/lib32 or /usr/lib64 instead of /usr/lib. + +--- perl-5.8.7/Configure-ORIG 2005-10-20 11:49:47.571389008 +1000 ++++ perl-5.8.7/Configure 2005-10-20 12:30:35.571236464 +1000 +@@ -5930,6 +5930,8 @@ + : The default "style" setting is made in installstyle.U + case "$installstyle" in + *lib/perl5*) set dflt privlib lib/$package/$version ;; ++*lib32/perl5*) set dflt privlib lib32/$package/$version ;; ++*lib64/perl5*) set dflt privlib lib64/$package/$version ;; + *) set dflt privlib lib/$version ;; + esac + eval $prefixit +@@ -6433,6 +6435,8 @@ + case "$sitelib" in + '') case "$installstyle" in + *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;; ++ *lib32/perl5*) dflt=$siteprefix/lib32/$package/site_$prog/$version ;; ++ *lib64/perl5*) dflt=$siteprefix/lib64/$package/site_$prog/$version ;; + *) dflt=$siteprefix/lib/site_$prog/$version ;; + esac + ;; +@@ -6560,6 +6564,8 @@ + prog=`echo $package | $sed 's/-*[0-9.]*$//'` + case "$installstyle" in + *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;; ++ *lib32/perl5*) dflt=$vendorprefix/lib32/$package/vendor_$prog/$version ;; ++ *lib64/perl5*) dflt=$vendorprefix/lib64/$package/vendor_$prog/$version ;; + *) dflt=$vendorprefix/lib/vendor_$prog/$version ;; + esac + ;; diff --git a/perl/perl/perl-5.8.8-regex_ssp-1.patch b/perl/perl/perl-5.8.8-regex_ssp-1.patch new file mode 100644 index 000000000..0b8a4e2d4 --- /dev/null +++ b/perl/perl/perl-5.8.8-regex_ssp-1.patch @@ -0,0 +1,40 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../perl/perl-5.8.8-regex_ssp-1.patch +# Copyright (C) 2008 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +This patch comes from: +http://www.linuxfromscratch.org/patches/downloads/perl/perl-5.8.8-regex_ssp-1.patch + +Submitted By: Robert Connolly (ashes) +Date: 2005-10-02 +Initial Package Version: 5.8.7 +Upstream Status: Unknown +Origin: http://linuxfromscratch.org/pipermail/hlfs-dev/2005-August/002360.html +Description: The regex code in this version of Perl segfaults when compiled +with stack smashing protector. This patch disables stack smashing protector +just on the affected files. + +diff -Naur perl-5.8.7.orig/cflags.SH perl-5.8.7/cflags.SH +--- perl-5.8.7.orig/cflags.SH 2002-09-30 10:59:07.000000000 +0000 ++++ perl-5.8.7/cflags.SH 2005-10-02 04:08:39.000000000 +0000 +@@ -165,6 +165,8 @@ + esac + + : Can we perhaps use $ansi2knr here ++ [[ $file == regcomp ]] && export ccflags="${ccflags} -fno-stack-protector" ++ [[ $file == regexec ]] && export ccflags="${ccflags} -fno-stack-protector" + echo "$cc -c -DPERL_CORE $ccflags $optimize $warn" + eval "$also "'"$cc -DPERL_CORE -c $ccflags $optimize $warn"' + diff --git a/perl/perl/perl.conf b/perl/perl/perl.conf index ec81ee292..d4ca1dc8b 100644 --- a/perl/perl/perl.conf +++ b/perl/perl/perl.conf @@ -2,8 +2,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../perl/perl.conf -# Copyright (C) 2004 - 2006 The T2 SDE Project -# Copyright (C) 1998 - 2004 Clifford Wolf +# Copyright (C) 2008 The OpenSDE Project # # More information can be found in the files COPYING and README. # @@ -15,10 +14,12 @@ perl_cross_bootstrap() { - # build a native miniperl - eval $MAKE miniperl - cp miniperl miniperl.native - $MAKE clean + # FIXME !!!!! build a native microperl DO WE WANT IT?? + makeopt="-f Makefile.micro CC=$HOSTCC" + eval $MAKE $makeopt + cp microperl microperl.native + makeopt="-f Makefile.micro" + $MAKE $makeopt clean # setup cross compiler cat >> config.sh <<-EOT @@ -26,54 +27,12 @@ cc='$CC' ccname='$CC' ld='$CC' EOT - eval $MAKE $makeopt miniperl - cp -f miniperl.native miniperl + makeopt="-f Makefile.micro CC=$CC LD=$CC" + eval $MAKE $makeopt + makeinstopt= + cp -a microperl $root$bindir/microperl } - -perl_postmake() { - cat > $root/usr/bin/cpan <<- EOT - #!/usr/bin/perl - use POSIX; - use locale; - use CPAN; - - setlocale(LANGUAGE, "en_US"); - setlocale(LC_ALL, "en_US"); - shell; - EOT - chmod +x $root/usr/bin/cpan - - if atstage native; then - eval `perl -V:archlib` - touch ${archlib}/perllocal.pod - - h2ph $( grep ' usr/include/.*\.h$' \ - $root/var/adm/flists/glibc* | sed 's,^.*: ,/,' ) - fi -} - -runconfig=0 - -[[ $libdir = *lib64 ]] && var_append patchfiles ' ' "$confdir/lib64.diff" -libpth="/usr/local/${libdir##*/} /${libdir##*/} /usr/${libdir##*/}" -confopt="-des -Dcc=gcc -Darchname=$arch_target -Dprefix=/$prefix \ - -Dmyhostname=$SDECFG_PKG_PERL5_HOST_NAME \ - -Dsiteprefix=/$SDECFG_PKG_PERL5_SITE_PREFIX \ - -Dvendorprefix=/$SDECFG_PKG_PERL5_VENDOR_PREFIX" - -for lp in $libpth; do - var_append confopt ' ' "-Alibpth=$lp" -done - -[ "$SDECFG_PKG_PERL5_SUIDPERL" != "0" ] && confopt="$confopt -Dd_dosuid" -[ "$SDECFG_PKG_PERL5_THREADS" = "1" ] && confopt="$confopt -Dusethreads" -[ "$SDECFG_PKG_PERL5_USE_DB3" = "1" ] && patchfiles="$patchfiles $confdir/use_db3.diff" - -hook_add preconf 2 "( rm -f config.sh Policy.sh; sh Configure \$confopt; )" if ! atstage native; then - var_append confopt " " "-Ddynamic_ext=none -Dstatic_ext=none" - hook_add premake 3 "perl_cross_bootstrap" + hook_add premake 3 "perl_cross_bootstrap" fi -hook_add postmake 4 "perl_postmake" - diff --git a/perl/perl/unistd.patch b/perl/perl/unistd.patch new file mode 100644 index 000000000..431cbb5c2 --- /dev/null +++ b/perl/perl/unistd.patch @@ -0,0 +1,44 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../perl/unistd.patch +# Copyright (C) 2008 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +--- perl-5.8.8/perl.h.orig 2008-09-12 18:46:18.000000000 +0300 ++++ perl-5.8.8/perl.h 2008-09-12 18:47:35.000000000 +0300 +@@ -2928,12 +2928,14 @@ + + #ifndef __cplusplus + #ifndef UNDER_CE ++#ifndef I_UNISTD + Uid_t getuid (void); + Uid_t geteuid (void); + Gid_t getgid (void); + Gid_t getegid (void); + #endif + #endif ++#endif + + #ifndef Perl_debug_log + # define Perl_debug_log PerlIO_stderr() +--- perl-5.8.8/uconfig.h.orig 2008-09-12 18:50:36.000000000 +0300 ++++ perl-5.8.8/uconfig.h 2008-09-12 19:05:31.000000000 +0300 +@@ -847,7 +847,7 @@ + * This symbol, if defined, indicates to the C program that it should + * include . + */ +-/*#define I_UNISTD / **/ ++#define I_UNISTD + + /* I_UTIME: + * This symbol, if defined, indicates to the C program that it should