Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/udev/, sys-fs/udev/files/
Date: Sun, 02 Jul 2017 16:11:10
Message-Id: 1499011861.247ffd39f221d14cf084a5119a5675b626837c1b.floppym@gentoo
1 commit: 247ffd39f221d14cf084a5119a5675b626837c1b
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 2 16:10:50 2017 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 2 16:11:01 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=247ffd39
7
8 sys-fs/udev: fix build failure on alpha/ia64
9
10 Bug: https://bugs.gentoo.org/612102
11 Package-Manager: Portage-2.3.6_p9, Repoman-2.3.2_p77
12
13 sys-fs/udev/files/233-format-warnings.patch | 84 +++++++++++++++++++++++++++++
14 sys-fs/udev/udev-233.ebuild | 18 ++-----
15 2 files changed, 89 insertions(+), 13 deletions(-)
16
17 diff --git a/sys-fs/udev/files/233-format-warnings.patch b/sys-fs/udev/files/233-format-warnings.patch
18 new file mode 100644
19 index 00000000000..7bb08f0a320
20 --- /dev/null
21 +++ b/sys-fs/udev/files/233-format-warnings.patch
22 @@ -0,0 +1,84 @@
23 +From 3e7d14d78c4d15ec7789299216cbf5c58e61547b Mon Sep 17 00:00:00 2001
24 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl>
25 +Date: Sat, 3 Jun 2017 05:41:17 -0400
26 +Subject: [PATCH] sd-bus: silence format warnings in kdbus code (#6072)
27 +MIME-Version: 1.0
28 +Content-Type: text/plain; charset=UTF-8
29 +Content-Transfer-Encoding: 8bit
30 +
31 +The code is mostly correct, but gcc is trying to outsmart us, and emits a
32 +warning for a "llu vs lu" mismatch, even though they are the same size (on alpha):
33 +
34 +src/libsystemd/sd-bus/bus-control.c: In function ‘kernel_get_list’:
35 +src/libsystemd/sd-bus/bus-control.c:267:42: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
36 + if (asprintf(&n, ":1.%llu", name->id) < 0) {
37 + ^
38 +src/libsystemd/sd-bus/bus-control.c: In function ‘bus_get_name_creds_kdbus’:
39 +src/libsystemd/sd-bus/bus-control.c:714:47: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=]
40 + if (asprintf(&c->unique_name, ":1.%llu", conn_info->id) < 0) {
41 + ^
42 +This is hard to work around properly, because kdbus.h uses __u64 which is
43 +defined-differently-despite-being-the-same-size then uint64_t. Thus the simple
44 +solution of using %PRIu64 fails on amd64:
45 +
46 +src/libsystemd/sd-bus/bus-control.c:714:47: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__u64 {aka long long unsigned int}’ [-Werror=format=]
47 + if (asprintf(&c->unique_name, ":1.%"PRIu64, conn_info->id) < 0) {
48 + ^~~~~~
49 +
50 +Let's just avoid the whole issue for now by silencing the warning.
51 +After the next release, we should just get rid of the kdbus code.
52 +
53 +Fixes #5561.
54 +---
55 + src/libsystemd/sd-bus/bus-control.c | 6 ++++++
56 + src/libsystemd/sd-bus/bus-kernel.c | 2 ++
57 + 2 files changed, 8 insertions(+)
58 +
59 +diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
60 +index 9e58ffbd8..303ae0f23 100644
61 +--- a/src/libsystemd/sd-bus/bus-control.c
62 ++++ b/src/libsystemd/sd-bus/bus-control.c
63 +@@ -264,10 +264,13 @@ static int kernel_get_list(sd_bus *bus, uint64_t flags, char ***x) {
64 + if ((flags & KDBUS_LIST_UNIQUE) && name->id != previous_id && !(name->flags & KDBUS_HELLO_ACTIVATOR)) {
65 + char *n;
66 +
67 ++#pragma GCC diagnostic push
68 ++#pragma GCC diagnostic ignored "-Wformat"
69 + if (asprintf(&n, ":1.%llu", name->id) < 0) {
70 + r = -ENOMEM;
71 + goto fail;
72 + }
73 ++#pragma GCC diagnostic pop
74 +
75 + r = strv_consume(x, n);
76 + if (r < 0)
77 +@@ -711,10 +714,13 @@ int bus_get_name_creds_kdbus(
78 + }
79 +
80 + if (mask & SD_BUS_CREDS_UNIQUE_NAME) {
81 ++#pragma GCC diagnostic push
82 ++#pragma GCC diagnostic ignored "-Wformat"
83 + if (asprintf(&c->unique_name, ":1.%llu", conn_info->id) < 0) {
84 + r = -ENOMEM;
85 + goto fail;
86 + }
87 ++#pragma GCC diagnostic pop
88 +
89 + c->mask |= SD_BUS_CREDS_UNIQUE_NAME;
90 + }
91 +diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
92 +index c82caeb3f..ca6aee7c0 100644
93 +--- a/src/libsystemd/sd-bus/bus-kernel.c
94 ++++ b/src/libsystemd/sd-bus/bus-kernel.c
95 +@@ -51,6 +51,8 @@
96 + #include "user-util.h"
97 + #include "util.h"
98 +
99 ++#pragma GCC diagnostic ignored "-Wformat"
100 ++
101 + #define UNIQUE_NAME_MAX (3+DECIMAL_STR_MAX(uint64_t))
102 +
103 + int bus_kernel_parse_unique_name(const char *s, uint64_t *id) {
104 +--
105 +2.13.2
106 +
107
108 diff --git a/sys-fs/udev/udev-233.ebuild b/sys-fs/udev/udev-233.ebuild
109 index 8662d86b43c..7cdbc7e3da1 100644
110 --- a/sys-fs/udev/udev-233.ebuild
111 +++ b/sys-fs/udev/udev-233.ebuild
112 @@ -9,13 +9,7 @@ if [[ ${PV} = 9999* ]]; then
113 EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
114 inherit git-r3
115 else
116 - patchset=
117 SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> systemd-${PV}.tar.gz"
118 - if [[ -n "${patchset}" ]]; then
119 - SRC_URI+="
120 - https://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz
121 - https://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz"
122 - fi
123 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
124 fi
125
126 @@ -61,6 +55,10 @@ PDEPEND=">=sys-apps/hwids-20140304[udev]
127
128 S=${WORKDIR}/systemd-${PV}
129
130 +PATCHES=(
131 + "${FILESDIR}"/233-format-warnings.patch
132 +)
133 +
134 check_default_rules() {
135 # Make sure there are no sudden changes to upstream rules file
136 # (more for my own needs than anything else ...)
137 @@ -104,11 +102,6 @@ src_prepare() {
138 fi
139 fi
140
141 - # backport some patches
142 - if [[ -n "${patchset}" ]]; then
143 - eapply "${WORKDIR}"/patch
144 - fi
145 -
146 cat <<-EOF > "${T}"/40-gentoo.rules
147 # Gentoo specific floppy and usb groups
148 ACTION=="add", SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
149 @@ -121,8 +114,7 @@ src_prepare() {
150 # stub out the am_path_libcrypt function
151 echo 'AC_DEFUN([AM_PATH_LIBGCRYPT],[:])' > m4/gcrypt.m4
152
153 - # apply user patches
154 - eapply_user
155 + default
156
157 eautoreconf