diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-03 14:20:12 +0000 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2022-01-12 10:10:57 +0800 |
commit | 8666c89f44e5cebbba66019f3a85edc9176b922a (patch) | |
tree | f472e85a4339380e8e481382453d2a3126f8fff3 /meta/recipes-connectivity/openssl/openssl/reproducibility.patch | |
parent | 7d05ad298b0fc98c8ac9aef29d71ec2f948b5591 (diff) | |
download | openembedded-core-8666c89f44e5cebbba66019f3a85edc9176b922a.tar.gz |
openssl: Add reproducibility fix
When the date rolled from one year to another, it highlighted a reproducibility
issue in openssl. Patch a workaround for this to avoid autobuilder failures. Help
submitting upstream welcome.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f8281e290737dba16a46d7ae937c66b3266e0fe8)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'meta/recipes-connectivity/openssl/openssl/reproducibility.patch')
-rw-r--r-- | meta/recipes-connectivity/openssl/openssl/reproducibility.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/reproducibility.patch b/meta/recipes-connectivity/openssl/openssl/reproducibility.patch new file mode 100644 index 0000000000..8accbc9df2 --- /dev/null +++ b/meta/recipes-connectivity/openssl/openssl/reproducibility.patch @@ -0,0 +1,22 @@ +Using localtime() means the output can depend on the timezone of the build machine. +Using gmtime() is safer. For complete reproducibility use SOURCE_DATE_EPOCH if set. + +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> +Upstream-Status: Pending [should be suitable] + +Index: openssl-3.0.1/apps/progs.pl +=================================================================== +--- openssl-3.0.1.orig/apps/progs.pl ++++ openssl-3.0.1/apps/progs.pl +@@ -21,7 +21,10 @@ die "Unrecognised option, must be -C or + my %commands = (); + my $cmdre = qr/^\s*int\s+([a-z_][a-z0-9_]*)_main\(\s*int\s+argc\s*,/; + my $apps_openssl = shift @ARGV; +-my $YEAR = [localtime()]->[5] + 1900; ++my $YEAR = [gmtime()]->[5] + 1900; ++if (defined($ENV{SOURCE_DATE_EPOCH}) && $ENV{SOURCE_DATE_EPOCH} !~ /\D/) { ++ $YEAR = [gmtime($ENV{SOURCE_DATE_EPOCH})]->[5] + 1900; ++} + + # because the program apps/openssl has object files as sources, and + # they then have the corresponding C files as source, we need to chain |