diff options
3 files changed, 78 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/yasm/yasm/0001-yasm-Set-build-date-to-SOURCE_DATE_EPOCH.patch b/meta-oe/recipes-devtools/yasm/yasm/0001-yasm-Set-build-date-to-SOURCE_DATE_EPOCH.patch new file mode 100644 index 0000000000..e65c9853e0 --- /dev/null +++ b/meta-oe/recipes-devtools/yasm/yasm/0001-yasm-Set-build-date-to-SOURCE_DATE_EPOCH.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | From eb164bb201c0f792fa8aa78270c47294065183a3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Oleh Matiusha <omatiush@cisco.com> | ||
| 3 | Date: Tue, 6 Feb 2024 09:33:11 +0000 | ||
| 4 | Subject: [PATCH 1/2] yasm: Set build date to SOURCE_DATE_EPOCH | ||
| 5 | |||
| 6 | If SOURCE_DATE_EPOCH is set, use it to generate a reproducible | ||
| 7 | string for BUILD_DATE. | ||
| 8 | |||
| 9 | Signed-off-by: Oleh Matiusha <omatiush@cisco.com> | ||
| 10 | --- | ||
| 11 | configure.ac | 8 ++++++++ | ||
| 12 | 1 file changed, 8 insertions(+) | ||
| 13 | |||
| 14 | diff --git a/configure.ac b/configure.ac | ||
| 15 | index 2823ecd..eeb51ce 100644 | ||
| 16 | --- a/configure.ac | ||
| 17 | +++ b/configure.ac | ||
| 18 | @@ -103,6 +103,14 @@ AM_WITH_DMALLOC | ||
| 19 | # | ||
| 20 | AC_CHECK_HEADERS([strings.h libgen.h unistd.h direct.h sys/stat.h]) | ||
| 21 | |||
| 22 | +# Use reproducible build date and time | ||
| 23 | +if test "$SOURCE_DATE_EPOCH"; then | ||
| 24 | + DATE_FMT="%d %b %Y %H:%M:%S" | ||
| 25 | + BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT") | ||
| 26 | + AC_DEFINE_UNQUOTED([BUILD_DATE], ["$BUILD_DATE"], [Use reproducidle build date]) | ||
| 27 | +fi | ||
| 28 | + | ||
| 29 | + | ||
| 30 | # | ||
| 31 | # Checks for typedefs, structures, and compiler characteristics. | ||
| 32 | # | ||
| 33 | -- | ||
| 34 | 2.33.0 | ||
| 35 | |||
diff --git a/meta-oe/recipes-devtools/yasm/yasm/0002-yasm-Use-BUILD_DATE-for-reproducibility.patch b/meta-oe/recipes-devtools/yasm/yasm/0002-yasm-Use-BUILD_DATE-for-reproducibility.patch new file mode 100644 index 0000000000..665f3afc9f --- /dev/null +++ b/meta-oe/recipes-devtools/yasm/yasm/0002-yasm-Use-BUILD_DATE-for-reproducibility.patch | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | From 19fffab74a201dc41c3da7e74d86eafa8f68bbc6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Oleh Matiusha <omatiush@cisco.com> | ||
| 3 | Date: Tue, 6 Feb 2024 09:34:26 +0000 | ||
| 4 | Subject: [PATCH] yasm: Use BUILD_DATE for reproducibility | ||
| 5 | |||
| 6 | Use reproducible build date instead of compilation time and date. | ||
| 7 | |||
| 8 | Signed-off-by: Oleh Matiusha <omatiush@cisco.com> | ||
| 9 | |||
| 10 | --- | ||
| 11 | tools/re2c/parser.c | 5 +++++ | ||
| 12 | 1 file changed, 5 insertions(+) | ||
| 13 | |||
| 14 | diff --git a/tools/re2c/parser.c b/tools/re2c/parser.c | ||
| 15 | index 02d5c66..1c90aee 100644 | ||
| 16 | --- a/tools/re2c/parser.c | ||
| 17 | +++ b/tools/re2c/parser.c | ||
| 18 | @@ -5,6 +5,7 @@ | ||
| 19 | #include "tools/re2c/globals.h" | ||
| 20 | #include "tools/re2c/parse.h" | ||
| 21 | #include "tools/re2c/parser.h" | ||
| 22 | +#include "config.h" | ||
| 23 | |||
| 24 | int yylex(void); | ||
| 25 | static RegExp *parse_expr(void); | ||
| 26 | @@ -233,7 +234,11 @@ void parse(FILE *i, FILE *o){ | ||
| 27 | peektok = NONE; | ||
| 28 | |||
| 29 | fputs("/* Generated by re2c 0.9.1-C on ", o); | ||
| 30 | +#ifndef BUILD_DATE | ||
| 31 | fprintf(o, "%-24s", ctime(&now)); | ||
| 32 | +#else | ||
| 33 | + fprintf(o, "%-24s", BUILD_DATE " "); | ||
| 34 | +#endif | ||
| 35 | fputs(" */\n", o); oline+=2; | ||
| 36 | |||
| 37 | in = Scanner_new(i); | ||
| 38 | -- | ||
| 39 | 2.33.0 | ||
| 40 | |||
diff --git a/meta-oe/recipes-devtools/yasm/yasm_git.bb b/meta-oe/recipes-devtools/yasm/yasm_git.bb index 079f805d6c..216b777667 100644 --- a/meta-oe/recipes-devtools/yasm/yasm_git.bb +++ b/meta-oe/recipes-devtools/yasm/yasm_git.bb | |||
| @@ -14,6 +14,8 @@ SRC_URI = "git://github.com/yasm/yasm.git;branch=master;protocol=https \ | |||
| 14 | file://0001-Do-not-use-AC_HEADER_STDC.patch \ | 14 | file://0001-Do-not-use-AC_HEADER_STDC.patch \ |
| 15 | file://CVE-2023-31975.patch \ | 15 | file://CVE-2023-31975.patch \ |
| 16 | file://CVE-2023-37732.patch \ | 16 | file://CVE-2023-37732.patch \ |
| 17 | file://0001-yasm-Set-build-date-to-SOURCE_DATE_EPOCH.patch \ | ||
| 18 | file://0002-yasm-Use-BUILD_DATE-for-reproducibility.patch \ | ||
| 17 | " | 19 | " |
| 18 | 20 | ||
| 19 | S = "${WORKDIR}/git" | 21 | S = "${WORKDIR}/git" |
| @@ -30,3 +32,4 @@ do_configure:prepend() { | |||
| 30 | # Don't include $CC (which includes path to sysroot) in generated header. | 32 | # Don't include $CC (which includes path to sysroot) in generated header. |
| 31 | sed -i -e "s/^echo \"\/\* generated \$ac_cv_stdint_message \*\/\" >>\$ac_stdint$"// ${S}/m4/ax_create_stdint_h.m4 | 33 | sed -i -e "s/^echo \"\/\* generated \$ac_cv_stdint_message \*\/\" >>\$ac_stdint$"// ${S}/m4/ax_create_stdint_h.m4 |
| 32 | } | 34 | } |
| 35 | |||
