diff options
-rw-r--r-- | recipes-extended/diffutils/diffutils-2.8.1/0003-context-fix-compilation-with-64bit-time_t-on-32bit-a.patch | 46 | ||||
-rw-r--r-- | recipes-extended/diffutils/diffutils_2.8.1.bb | 1 |
2 files changed, 47 insertions, 0 deletions
diff --git a/recipes-extended/diffutils/diffutils-2.8.1/0003-context-fix-compilation-with-64bit-time_t-on-32bit-a.patch b/recipes-extended/diffutils/diffutils-2.8.1/0003-context-fix-compilation-with-64bit-time_t-on-32bit-a.patch new file mode 100644 index 0000000..a8fcde0 --- /dev/null +++ b/recipes-extended/diffutils/diffutils-2.8.1/0003-context-fix-compilation-with-64bit-time_t-on-32bit-a.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From 07c75310fecbaec62a24a3ee98b4209e1bf9ff62 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net> | ||
3 | Date: Mon, 6 Jan 2020 13:31:50 +0000 | ||
4 | Subject: [PATCH] context: fix compilation with 64bit time_t on 32bit arches | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | In file included from ../../diffutils-2.8.1/src/diff.h:23, | ||
10 | from ../../diffutils-2.8.1/src/context.c:23: | ||
11 | ../../diffutils-2.8.1/src/context.c: In function 'print_context_label': | ||
12 | ../../diffutils-2.8.1/src/system.h:41:52: error: size of array 'a' is negative | ||
13 | 41 | #define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; } | ||
14 | | ^ | ||
15 | ../../diffutils-2.8.1/src/context.c:65:4: note: in expansion of macro 'verify' | ||
16 | 65 | verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec); | ||
17 | | ^~~~~~ | ||
18 | |||
19 | struct stat::st_mtime is a time_t and will not fit into a | ||
20 | long (when 64bit time_t has been requested on a 32bit machine). | ||
21 | |||
22 | Signed-off-by: André Draszik <git@andred.net> | ||
23 | Upstream-Status: Inappropriate [fixing an old version] | ||
24 | --- | ||
25 | src/context.c | 4 ++-- | ||
26 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/src/context.c b/src/context.c | ||
29 | index 18d7023..d41efde 100644 | ||
30 | --- a/src/context.c | ||
31 | +++ b/src/context.c | ||
32 | @@ -61,9 +61,9 @@ print_context_label (char const *mark, | ||
33 | int nsec = TIMESPEC_NS (inf->stat.st_mtim); | ||
34 | if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec))) | ||
35 | { | ||
36 | - long sec = inf->stat.st_mtime; | ||
37 | + time_t sec = inf->stat.st_mtime; | ||
38 | verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec); | ||
39 | - sprintf (buf, "%ld.%.9d", sec, nsec); | ||
40 | + sprintf (buf, "%lld.%.9d", (long long) sec, nsec); | ||
41 | } | ||
42 | fprintf (outfile, "%s %s\t%s\n", mark, inf->name, buf); | ||
43 | } | ||
44 | -- | ||
45 | 2.23.0.rc1 | ||
46 | |||
diff --git a/recipes-extended/diffutils/diffutils_2.8.1.bb b/recipes-extended/diffutils/diffutils_2.8.1.bb index 5a71c94..4aad28f 100644 --- a/recipes-extended/diffutils/diffutils_2.8.1.bb +++ b/recipes-extended/diffutils/diffutils_2.8.1.bb | |||
@@ -10,6 +10,7 @@ SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.gz \ | |||
10 | file://fix_gcc6.patch \ | 10 | file://fix_gcc6.patch \ |
11 | file://0001-Make-it-build-with-compile-time-hardening-enabled.patch \ | 11 | file://0001-Make-it-build-with-compile-time-hardening-enabled.patch \ |
12 | file://0002-included-libc-use-mempcpy-instead-of.patch \ | 12 | file://0002-included-libc-use-mempcpy-instead-of.patch \ |
13 | file://0003-context-fix-compilation-with-64bit-time_t-on-32bit-a.patch \ | ||
13 | " | 14 | " |
14 | 15 | ||
15 | SRC_URI[md5sum] = "71f9c5ae19b60608f6c7f162da86a428" | 16 | SRC_URI[md5sum] = "71f9c5ae19b60608f6c7f162da86a428" |