diff options
| -rw-r--r-- | meta/recipes-devtools/perl/files/determinism.patch | 81 | ||||
| -rw-r--r-- | meta/recipes-devtools/perl/perl_5.30.1.bb | 1 |
2 files changed, 82 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/files/determinism.patch b/meta/recipes-devtools/perl/files/determinism.patch new file mode 100644 index 0000000000..ed4d06f5ec --- /dev/null +++ b/meta/recipes-devtools/perl/files/determinism.patch | |||
| @@ -0,0 +1,81 @@ | |||
| 1 | Fixes to make the perl build reproducible: | ||
| 2 | |||
| 3 | a) Remove the \n from configure_attr.sh since it gets quoted differently depending on | ||
| 4 | whether the shell is bash or dash which can cause the test result to be incorrect. | ||
| 5 | Reported upstream: https://github.com/arsv/perl-cross/issues/87 | ||
| 6 | |||
| 7 | b) Sort the order of the module lists from configure_mods.sh since otherwise | ||
| 8 | the result isn't the same leading to makefile differences. | ||
| 9 | Reported upstream: https://github.com/arsv/perl-cross/issues/88 | ||
| 10 | |||
| 11 | c) Sort the Encode::Byte byte_t.fnm file output (and the makefile depends whilst | ||
| 12 | there for good measure) | ||
| 13 | This needs to go to upstream perl (not done) | ||
| 14 | |||
| 15 | d) Use bash for perl-cross configure since otherwise trnl gets set to "\n" with bash | ||
| 16 | and "" with dash | ||
| 17 | Reported upstream: https://github.com/arsv/perl-cross/issues/87 | ||
| 18 | |||
| 19 | RP 2020/2/7 | ||
| 20 | |||
| 21 | Upstream-Status: Pending [75% submitted] | ||
| 22 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org | ||
| 23 | |||
| 24 | Index: perl-5.30.1/cnf/configure_attr.sh | ||
| 25 | =================================================================== | ||
| 26 | --- perl-5.30.1.orig/cnf/configure_attr.sh | ||
| 27 | +++ perl-5.30.1/cnf/configure_attr.sh | ||
| 28 | @@ -131,7 +131,7 @@ if not hinted d_c99_variadic_macros 'sup | ||
| 29 | try_start | ||
| 30 | try_add '#include <stdio.h>' | ||
| 31 | try_add '#define foo(fmt, ...) printf(fmt, __VA_ARGS__)' | ||
| 32 | - try_add 'int main(void) { foo("%i\n", 1234); return 0; }' | ||
| 33 | + try_add 'int main(void) { foo("%i", 1234); return 0; }' | ||
| 34 | try_compile | ||
| 35 | resdef d_c99_variadic_macros 'supported' 'missing' | ||
| 36 | fi | ||
| 37 | Index: perl-5.30.1/cnf/configure_mods.sh | ||
| 38 | =================================================================== | ||
| 39 | --- perl-5.30.1.orig/cnf/configure_mods.sh | ||
| 40 | +++ perl-5.30.1/cnf/configure_mods.sh | ||
| 41 | @@ -82,7 +82,7 @@ extonlyif() { | ||
| 42 | } | ||
| 43 | |||
| 44 | definetrimspaces() { | ||
| 45 | - v=`echo "$2" | sed -r -e 's/\s+/ /g' -e 's/^\s+//' -e 's/\s+$//'` | ||
| 46 | + v=`echo "$2" | sed -r -e 's/\s+/ /g' -e 's/^\s+//' -e 's/\s+$//' | xargs -n1 | LANG=C sort | xargs` | ||
| 47 | define $1 "$v" | ||
| 48 | } | ||
| 49 | |||
| 50 | Index: perl-5.30.1/cpan/Encode/Byte/Makefile.PL | ||
| 51 | =================================================================== | ||
| 52 | --- perl-5.30.1.orig/cpan/Encode/Byte/Makefile.PL | ||
| 53 | +++ perl-5.30.1/cpan/Encode/Byte/Makefile.PL | ||
| 54 | @@ -171,7 +171,7 @@ sub postamble | ||
| 55 | my $lengthsofar = length($str); | ||
| 56 | my $continuator = ''; | ||
| 57 | $str .= "$table.c : $enc2xs Makefile.PL"; | ||
| 58 | - foreach my $file (@{$tables{$table}}) | ||
| 59 | + foreach my $file (sort (@{$tables{$table}})) | ||
| 60 | { | ||
| 61 | $str .= $continuator.' '.$self->catfile($dir,$file); | ||
| 62 | if ( length($str)-$lengthsofar > 128*$numlines ) | ||
| 63 | @@ -189,7 +189,7 @@ sub postamble | ||
| 64 | qq{\n\t\$(PERL) $plib $enc2xs $ucopts -o \$\@ -f $table.fnm\n\n}; | ||
| 65 | open (FILELIST, ">$table.fnm") | ||
| 66 | || die "Could not open $table.fnm: $!"; | ||
| 67 | - foreach my $file (@{$tables{$table}}) | ||
| 68 | + foreach my $file (sort (@{$tables{$table}})) | ||
| 69 | { | ||
| 70 | print FILELIST $self->catfile($dir,$file) . "\n"; | ||
| 71 | } | ||
| 72 | Index: perl-5.30.1/cnf/configure | ||
| 73 | =================================================================== | ||
| 74 | --- perl-5.30.1.orig/cnf/configure | ||
| 75 | +++ perl-5.30.1/cnf/configure | ||
| 76 | @@ -1,4 +1,4 @@ | ||
| 77 | -#!/bin/sh | ||
| 78 | +#!/bin/bash | ||
| 79 | |||
| 80 | base=${0%/*}; test -z "$base" && base=. | ||
| 81 | |||
diff --git a/meta/recipes-devtools/perl/perl_5.30.1.bb b/meta/recipes-devtools/perl/perl_5.30.1.bb index dcdabb692d..5d762710df 100644 --- a/meta/recipes-devtools/perl/perl_5.30.1.bb +++ b/meta/recipes-devtools/perl/perl_5.30.1.bb | |||
| @@ -21,6 +21,7 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \ | |||
| 21 | file://0001-enc2xs-Add-environment-variable-to-suppress-comments.patch \ | 21 | file://0001-enc2xs-Add-environment-variable-to-suppress-comments.patch \ |
| 22 | file://0002-Constant-Fix-up-shebang.patch \ | 22 | file://0002-Constant-Fix-up-shebang.patch \ |
| 23 | file://0001-tests-adjust-to-correctly-exclude-unbuilt-extensions.patch \ | 23 | file://0001-tests-adjust-to-correctly-exclude-unbuilt-extensions.patch \ |
| 24 | file://determinism.patch \ | ||
| 24 | " | 25 | " |
| 25 | SRC_URI_append_class-native = " \ | 26 | SRC_URI_append_class-native = " \ |
| 26 | file://perl-configpm-switch.patch \ | 27 | file://perl-configpm-switch.patch \ |
