summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2018-06-02 09:00:34 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-12 22:34:24 (GMT)
commit982b07cd0c2e8c7daa67a21259354f369becbb35 (patch)
tree1d09af29b6ad9d6cc15e454b9ab13dea9d6fdaec
parentace62c17118a0c0b14fe14a25d4897568b3fde2a (diff)
downloadpoky-982b07cd0c2e8c7daa67a21259354f369becbb35.zip
poky-982b07cd0c2e8c7daa67a21259354f369becbb35.tar.gz
poky-982b07cd0c2e8c7daa67a21259354f369becbb35.tar.bz2
systemd: fix build with gcc8
(From OE-Core rev: b0fdaedc6e9c233f357022b0fb706cb19757f5c4) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/systemd/systemd/0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch53
-rw-r--r--meta/recipes-core/systemd/systemd_237.bb1
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch b/meta/recipes-core/systemd/systemd/0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch
new file mode 100644
index 0000000..fcc7c50
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch
@@ -0,0 +1,53 @@
+From f9fd4546c25a15629544bc4642a74d7909cc0840 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 1 Jun 2018 15:22:28 +0000
+Subject: [PATCH] time-util: fix build with gcc8 -Werror=format-truncation=
+
+* it fails with gcc8 when -O1 or -Os is used (and -ftree-vrp which is added by -O2 and higher isn't used)
+
+../git/src/basic/time-util.c: In function 'format_timespan':
+../git/src/basic/time-util.c:508:46: error: '%0*llu' directive output between 1 and 2147483647 bytes may cause result to exceed 'INT_MAX' [-Werror=format-truncation=]
+ "%s"USEC_FMT".%0*"PRI_USEC"%s",
+ ^~~~
+../git/src/basic/time-util.c:508:60: note: format string is defined here
+ "%s"USEC_FMT".%0*"PRI_USEC"%s",
+../git/src/basic/time-util.c:508:46: note: directive argument in the range [0, 18446744073709551614]
+ "%s"USEC_FMT".%0*"PRI_USEC"%s",
+ ^~~~
+../git/src/basic/time-util.c:507:37: note: 'snprintf' output 4 or more bytes (assuming 2147483651) into a destination of size 4294967295
+ k = snprintf(p, l,
+ ^~~~~~~~~~~~~~
+ "%s"USEC_FMT".%0*"PRI_USEC"%s",
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ p > buf ? " " : "",
+ ~~~~~~~~~~~~~~~~~~~
+ a,
+ ~~
+ j,
+ ~~
+ b,
+ ~~
+ table[i].suffix);
+ ~~~~~~~~~~~~~~~~
+cc1: some warnings being treated as errors
+
+Upstream-Status: Submitted https://github.com/systemd/systemd/pull/9156
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/basic/time-util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/basic/time-util.c b/src/basic/time-util.c
+index 0601d4fa9..db5a9cd78 100644
+--- a/src/basic/time-util.c
++++ b/src/basic/time-util.c
+@@ -484,7 +484,7 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) {
+ /* Let's see if we should shows this in dot notation */
+ if (t < USEC_PER_MINUTE && b > 0) {
+ usec_t cc;
+- int j;
++ signed char j;
+
+ j = 0;
+ for (cc = table[i].usec; cc > 1; cc /= 10)
diff --git a/meta/recipes-core/systemd/systemd_237.bb b/meta/recipes-core/systemd/systemd_237.bb
index 2e6558d..0113c2d 100644
--- a/meta/recipes-core/systemd/systemd_237.bb
+++ b/meta/recipes-core/systemd/systemd_237.bb
@@ -54,6 +54,7 @@ SRC_URI += "file://touchscreen.rules \
file://libmount.patch \
file://0034-Fix-format-truncation-compile-failure-by-typecasting.patch \
file://0035-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
+ file://0036-time-util-fix-build-with-gcc8-Werror-format-truncati.patch \
"
SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"