From: Marcel Denia Date: Fri, 25 Sep 2015 06:26:58 +0000 (+0200) Subject: perl: Reorganize patches X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3aaaede7b2b1f91c7f69674d56ae9a49b9dc8cb3;p=feed%2Fpackages.git perl: Reorganize patches The old scheme didn't make any sense...not that there was a scheme really. Signed-off-by: Marcel Denia --- diff --git a/lang/perl/README.patches b/lang/perl/README.patches new file mode 100644 index 0000000000..5f3b5951d9 --- /dev/null +++ b/lang/perl/README.patches @@ -0,0 +1,9 @@ +The patches in this package are loosely sorted into the following categories: + +0xx - Bugfixes +1xx - Cross-compile fixes +3xx - Workarounds +7xx - Testsuite fixes + +Feel free to add another one if your new patch doesn't seem to fit into an +existing category. \ No newline at end of file diff --git a/lang/perl/patches/010-musl-compat.patch b/lang/perl/patches/010-musl-compat.patch new file mode 100644 index 0000000000..8dbad78f4c --- /dev/null +++ b/lang/perl/patches/010-musl-compat.patch @@ -0,0 +1,11 @@ +--- a/pp.c ++++ b/pp.c +@@ -43,7 +43,7 @@ extern Pid_t getpid (void); + * Some BSDs and Cygwin default to POSIX math instead of IEEE. + * This switches them over to IEEE. + */ +-#if defined(LIBM_LIB_VERSION) ++#if defined(LIBM_LIB_VERSION) && (defined(__GLIBC__) || defined(__UCLIBC__)) + _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_; + #endif + diff --git a/lang/perl/patches/020-host-libc-dir-moved-debian+derivatives.patch b/lang/perl/patches/020-host-libc-dir-moved-debian+derivatives.patch new file mode 100644 index 0000000000..761f8b9273 --- /dev/null +++ b/lang/perl/patches/020-host-libc-dir-moved-debian+derivatives.patch @@ -0,0 +1,27 @@ +--- a/hints/linux.sh ++++ b/hints/linux.sh +@@ -204,6 +204,24 @@ case "$libc" in + ;; + esac + ++# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries ++# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us ++# where to look. We don't want gcc's own libraries, however, so we ++# filter those out. ++# This could be conditional on Unbuntu, but other distributions may ++# follow suit, and this scheme seems to work even on rather old gcc's. ++# This unconditionally uses gcc because even if the user is using another ++# compiler, we still need to find the math library and friends, and I don't ++# know how other compilers will cope with that situation. ++# Still, as an escape hatch, allow Configure command line overrides to ++# plibpth to bypass this check. ++case "$plibpth" in ++'') plibpth=`gcc -print-search-dirs | grep libraries | ++ cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'` ++ plibpth="$plibpth" # Collapse all entries on one line ++ ;; ++esac ++ + # Are we using ELF? Thanks to Kenneth Albanowski + # for this test. + cat >try.c <<'EOM' diff --git a/lang/perl/patches/100-fix-cross-compile-endianness-detection.patch b/lang/perl/patches/100-fix-cross-compile-endianness-detection.patch new file mode 100644 index 0000000000..e187941eb8 --- /dev/null +++ b/lang/perl/patches/100-fix-cross-compile-endianness-detection.patch @@ -0,0 +1,22 @@ +--- a/config_h.SH ++++ b/config_h.SH +@@ -52,6 +52,19 @@ sed <$CONFIG_H -e 's!^#und + #ifndef _config_h_ + #define _config_h_ + ++#if defined(USE_CROSS_COMPILE) && !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) ++# include ++# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN) ++# if (__BYTE_ORDER == __LITTLE_ENDIAN) ++# define __LITTLE_ENDIAN__ ++# elif (__BYTE_ORDER == __BIG_ENDIAN) ++# define __BIG_ENDIAN__ ++# else ++# error Unknown endianness ++# endif ++# endif ++#endif ++ + /* LOC_SED: + * This symbol holds the complete pathname to the sed program. + */ diff --git a/lang/perl/patches/100-musl-compat.patch b/lang/perl/patches/100-musl-compat.patch deleted file mode 100644 index 8dbad78f4c..0000000000 --- a/lang/perl/patches/100-musl-compat.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/pp.c -+++ b/pp.c -@@ -43,7 +43,7 @@ extern Pid_t getpid (void); - * Some BSDs and Cygwin default to POSIX math instead of IEEE. - * This switches them over to IEEE. - */ --#if defined(LIBM_LIB_VERSION) -+#if defined(LIBM_LIB_VERSION) && (defined(__GLIBC__) || defined(__UCLIBC__)) - _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_; - #endif - diff --git a/lang/perl/patches/101-fix-cross-compile-endianness-detection.patch b/lang/perl/patches/101-fix-cross-compile-endianness-detection.patch deleted file mode 100644 index e187941eb8..0000000000 --- a/lang/perl/patches/101-fix-cross-compile-endianness-detection.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/config_h.SH -+++ b/config_h.SH -@@ -52,6 +52,19 @@ sed <$CONFIG_H -e 's!^#und - #ifndef _config_h_ - #define _config_h_ - -+#if defined(USE_CROSS_COMPILE) && !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) -+# include -+# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN) -+# if (__BYTE_ORDER == __LITTLE_ENDIAN) -+# define __LITTLE_ENDIAN__ -+# elif (__BYTE_ORDER == __BIG_ENDIAN) -+# define __BIG_ENDIAN__ -+# else -+# error Unknown endianness -+# endif -+# endif -+#endif -+ - /* LOC_SED: - * This symbol holds the complete pathname to the sed program. - */ diff --git a/lang/perl/patches/110-always_use_miniperl.patch b/lang/perl/patches/110-always_use_miniperl.patch new file mode 100644 index 0000000000..f8f8a65deb --- /dev/null +++ b/lang/perl/patches/110-always_use_miniperl.patch @@ -0,0 +1,27 @@ +--- a/Makefile.SH ++++ b/Makefile.SH +@@ -315,22 +315,11 @@ MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE + + !GROK!THIS! + +-case "$usecrosscompile$perl" in +-define?*) +- $spitshell >>$Makefile <>$Makefile <>$Makefile <>$Makefile < - # for this test. - cat >try.c <<'EOM' diff --git a/lang/perl/patches/300-add-relink-hack.patch b/lang/perl/patches/300-add-relink-hack.patch new file mode 100644 index 0000000000..fd3d3861f4 --- /dev/null +++ b/lang/perl/patches/300-add-relink-hack.patch @@ -0,0 +1,6 @@ +--- /dev/null ++++ b/relink/Makefile.PL +@@ -0,0 +1,3 @@ ++use ExtUtils::MakeMaker; ++ ++WriteMakefile(NAME => "relink"); diff --git a/lang/perl/patches/300-always_use_miniperl.patch b/lang/perl/patches/300-always_use_miniperl.patch deleted file mode 100644 index f8f8a65deb..0000000000 --- a/lang/perl/patches/300-always_use_miniperl.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/Makefile.SH -+++ b/Makefile.SH -@@ -315,22 +315,11 @@ MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE - - !GROK!THIS! - --case "$usecrosscompile$perl" in --define?*) -- $spitshell >>$Makefile <>$Makefile <>$Makefile <>$Makefile < "relink"); diff --git a/lang/perl/patches/600-tie_fetch_count_t-handle_missing_crypt.patch b/lang/perl/patches/600-tie_fetch_count_t-handle_missing_crypt.patch deleted file mode 100644 index 32914dde72..0000000000 --- a/lang/perl/patches/600-tie_fetch_count_t-handle_missing_crypt.patch +++ /dev/null @@ -1,28 +0,0 @@ -Index: perl-5.22.0/t/op/tie_fetch_count.t -=================================================================== ---- perl-5.22.0.orig/t/op/tie_fetch_count.t -+++ perl-5.22.0/t/op/tie_fetch_count.t -@@ -250,12 +250,17 @@ for ([chdir=>''],[chmod=>'0,'],[chown=>' - check_count "$op $args\\\$tied_glob$postargs"; - } - --$dummy = crypt $var,0; check_count 'crypt $tied, ...'; --$dummy = crypt 0,$var; check_count 'crypt ..., $tied'; --$var = substr(chr 256,0,0); --$dummy = crypt $var,0; check_count 'crypt $tied_utf8, ...'; --$var = substr(chr 256,0,0); --$dummy = crypt 0,$var; check_count 'crypt ..., $tied_utf8'; -+SKIP: { -+ use Config; -+ skip "crypt() is unavailable", 4, unless defined $Config{'d_crypt'}; -+ -+ $dummy = crypt $var,0; check_count 'crypt $tied, ...'; -+ $dummy = crypt 0,$var; check_count 'crypt ..., $tied'; -+ $var = substr(chr 256,0,0); -+ $dummy = crypt $var,0; check_count 'crypt $tied_utf8, ...'; -+ $var = substr(chr 256,0,0); -+ $dummy = crypt 0,$var; check_count 'crypt ..., $tied_utf8'; -+} - - SKIP: - { diff --git a/lang/perl/patches/700-threads_join-skip_ps_on_busybox.patch b/lang/perl/patches/700-threads_join-skip_ps_on_busybox.patch deleted file mode 100644 index 27ee75749a..0000000000 --- a/lang/perl/patches/700-threads_join-skip_ps_on_busybox.patch +++ /dev/null @@ -1,83 +0,0 @@ -perl: Skip $0 test on busybox - -This test requires a ps which provides the -f option, as well as suitable output. -We can't provide either with busybox. Just skip it for now. - -Signed-off-by: Marcel Denia - -Index: perl-5.22.0/dist/threads/t/join.t -=================================================================== ---- perl-5.22.0.orig/dist/threads/t/join.t -+++ perl-5.22.0/dist/threads/t/join.t -@@ -110,36 +110,41 @@ sub skip { - - # We parse ps output so this is OS-dependent. - if ($^O eq 'linux') { -- # First modify $0 in a subthread. -- #print "# mainthread: \$0 = $0\n"; -- threads->create(sub{ #print "# subthread: \$0 = $0\n"; -- $0 = "foobar"; -- #print "# subthread: \$0 = $0\n" -- })->join; -- #print "# mainthread: \$0 = $0\n"; -- #print "# pid = $$\n"; -- if (open PS, "ps -f |") { # Note: must work in (all) systems. -- my ($sawpid, $sawexe); -- while () { -- chomp; -- #print "# [$_]\n"; -- if (/^\s*\S+\s+$$\s/) { -- $sawpid++; -- if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces. -- $sawexe++; -- } -- last; -- } -- } -- close PS or die; -- if ($sawpid) { -- ok($sawpid && $sawexe, 'altering $0 is effective'); -- } else { -- skip("\$0 check: did not see pid $$ in 'ps -f |'"); -- } -- } else { -- skip("\$0 check: opening 'ps -f |' failed: $!"); -- } -+ if (readlink('/bin/ps') ne 'busybox') { -+ # First modify $0 in a subthread. -+ #print "# mainthread: \$0 = $0\n"; -+ threads->create(sub{ #print "# subthread: \$0 = $0\n"; -+ $0 = "foobar"; -+ #print "# subthread: \$0 = $0\n" -+ })->join; -+ #print "# mainthread: \$0 = $0\n"; -+ #print "# pid = $$\n"; -+ if (open PS, "ps -f |") { # Note: must work in (all) systems. -+ my ($sawpid, $sawexe); -+ while () { -+ chomp; -+ #print "# [$_]\n"; -+ if (/^\s*\S+\s+$$\s/) { -+ $sawpid++; -+ if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces. -+ $sawexe++; -+ } -+ last; -+ } -+ } -+ close PS or die; -+ if ($sawpid) { -+ ok($sawpid && $sawexe, 'altering $0 is effective'); -+ } else { -+ skip("\$0 check: did not see pid $$ in 'ps -f |'"); -+ } -+ } else { -+ skip("\$0 check: opening 'ps -f |' failed: $!"); -+ } -+ } -+ else { -+ skip("\$0 check: incompatible with busybox"); -+ } - } else { - skip("\$0 check: only on Linux"); - } diff --git a/lang/perl/patches/700-tie_fetch_count_t-handle_missing_crypt.patch b/lang/perl/patches/700-tie_fetch_count_t-handle_missing_crypt.patch new file mode 100644 index 0000000000..32914dde72 --- /dev/null +++ b/lang/perl/patches/700-tie_fetch_count_t-handle_missing_crypt.patch @@ -0,0 +1,28 @@ +Index: perl-5.22.0/t/op/tie_fetch_count.t +=================================================================== +--- perl-5.22.0.orig/t/op/tie_fetch_count.t ++++ perl-5.22.0/t/op/tie_fetch_count.t +@@ -250,12 +250,17 @@ for ([chdir=>''],[chmod=>'0,'],[chown=>' + check_count "$op $args\\\$tied_glob$postargs"; + } + +-$dummy = crypt $var,0; check_count 'crypt $tied, ...'; +-$dummy = crypt 0,$var; check_count 'crypt ..., $tied'; +-$var = substr(chr 256,0,0); +-$dummy = crypt $var,0; check_count 'crypt $tied_utf8, ...'; +-$var = substr(chr 256,0,0); +-$dummy = crypt 0,$var; check_count 'crypt ..., $tied_utf8'; ++SKIP: { ++ use Config; ++ skip "crypt() is unavailable", 4, unless defined $Config{'d_crypt'}; ++ ++ $dummy = crypt $var,0; check_count 'crypt $tied, ...'; ++ $dummy = crypt 0,$var; check_count 'crypt ..., $tied'; ++ $var = substr(chr 256,0,0); ++ $dummy = crypt $var,0; check_count 'crypt $tied_utf8, ...'; ++ $var = substr(chr 256,0,0); ++ $dummy = crypt 0,$var; check_count 'crypt ..., $tied_utf8'; ++} + + SKIP: + { diff --git a/lang/perl/patches/710-threads_join-skip_ps_on_busybox.patch b/lang/perl/patches/710-threads_join-skip_ps_on_busybox.patch new file mode 100644 index 0000000000..27ee75749a --- /dev/null +++ b/lang/perl/patches/710-threads_join-skip_ps_on_busybox.patch @@ -0,0 +1,83 @@ +perl: Skip $0 test on busybox + +This test requires a ps which provides the -f option, as well as suitable output. +We can't provide either with busybox. Just skip it for now. + +Signed-off-by: Marcel Denia + +Index: perl-5.22.0/dist/threads/t/join.t +=================================================================== +--- perl-5.22.0.orig/dist/threads/t/join.t ++++ perl-5.22.0/dist/threads/t/join.t +@@ -110,36 +110,41 @@ sub skip { + + # We parse ps output so this is OS-dependent. + if ($^O eq 'linux') { +- # First modify $0 in a subthread. +- #print "# mainthread: \$0 = $0\n"; +- threads->create(sub{ #print "# subthread: \$0 = $0\n"; +- $0 = "foobar"; +- #print "# subthread: \$0 = $0\n" +- })->join; +- #print "# mainthread: \$0 = $0\n"; +- #print "# pid = $$\n"; +- if (open PS, "ps -f |") { # Note: must work in (all) systems. +- my ($sawpid, $sawexe); +- while () { +- chomp; +- #print "# [$_]\n"; +- if (/^\s*\S+\s+$$\s/) { +- $sawpid++; +- if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces. +- $sawexe++; +- } +- last; +- } +- } +- close PS or die; +- if ($sawpid) { +- ok($sawpid && $sawexe, 'altering $0 is effective'); +- } else { +- skip("\$0 check: did not see pid $$ in 'ps -f |'"); +- } +- } else { +- skip("\$0 check: opening 'ps -f |' failed: $!"); +- } ++ if (readlink('/bin/ps') ne 'busybox') { ++ # First modify $0 in a subthread. ++ #print "# mainthread: \$0 = $0\n"; ++ threads->create(sub{ #print "# subthread: \$0 = $0\n"; ++ $0 = "foobar"; ++ #print "# subthread: \$0 = $0\n" ++ })->join; ++ #print "# mainthread: \$0 = $0\n"; ++ #print "# pid = $$\n"; ++ if (open PS, "ps -f |") { # Note: must work in (all) systems. ++ my ($sawpid, $sawexe); ++ while () { ++ chomp; ++ #print "# [$_]\n"; ++ if (/^\s*\S+\s+$$\s/) { ++ $sawpid++; ++ if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces. ++ $sawexe++; ++ } ++ last; ++ } ++ } ++ close PS or die; ++ if ($sawpid) { ++ ok($sawpid && $sawexe, 'altering $0 is effective'); ++ } else { ++ skip("\$0 check: did not see pid $$ in 'ps -f |'"); ++ } ++ } else { ++ skip("\$0 check: opening 'ps -f |' failed: $!"); ++ } ++ } ++ else { ++ skip("\$0 check: incompatible with busybox"); ++ } + } else { + skip("\$0 check: only on Linux"); + }