Skip to contentSkip to conversation

perl: Fix encode module reproducibility issues

PATCH New Richard Purdie 1 participant 1 message Feb 18, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perl: Fix encode module reproducibility issues

The code is encoding host compiler parameters into target builds. Avoid this for our target builds. This should resolve builds which aren't reproducible between hosts with different compilers.

---
 .../perl/files/encodefix.patch                | 20 +++++++++++++++++++
 meta/recipes-devtools/perl/perl_5.30.1.bb     |  3 +++
 2 files changed, 23 insertions(+)
 create mode 100644 meta/recipes-devtools/perl/files/encodefix.patch
meta/recipes-devtools/perl/files/encodefix.patch new file +20 -0
new file mode 100644
index 00000000000..396ed0d53e3
@@ -0,0 +1,20 @@
+The code is encoding host compiler parameters into target builds. Avoid
+this for our target builds (patch is target specific, not native)
+
+Upstream-Status: Inappropriate [Cross compile hack]
+RP 2020/2/18
+Signed-off-by: Richard Purdie <[email protected]>
+
+Index: perl-5.30.1/cpan/Encode/bin/enc2xs
+===================================================================
+--- perl-5.30.1.orig/cpan/Encode/bin/enc2xs
++++ perl-5.30.1/cpan/Encode/bin/enc2xs
+@@ -195,7 +195,7 @@ sub compiler_info {
+     # above becomes false.
+     my $sized  = $declaration && !($compat && !$pedantic);
+ 
+-    return ($cpp, $static, $sized);
++    return (0, 1, 1);
+ }
+ 
+ 
meta/recipes-devtools/perl/perl_5.30.1.bb +3 -0
index 5d762710df3..b37f175f973 100644
@@ -26,6 +26,9 @@ SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \
 SRC_URI_append_class-native = " \
            file://perl-configpm-switch.patch \
 "
+SRC_URI_append_class-target = " \
+           file://encodefix.patch \
+"
 
 SRC_URI[perl.md5sum] = "6438eb7b8db9bbde28e01086de376a46"
 SRC_URI[perl.sha256sum] = "bf3d25571ff1ee94186177c2cdef87867fd6a14aa5a84f0b1fb7bf798f42f964"
Signature · 1 line
2.25.0