1 |
commit: 057e21919e19feb2fd4d51e2bf18d3c0b4512a61 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 20 22:14:46 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 20 23:08:37 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=057e2191 |
7 |
|
8 |
dev-libs/libusb: fix build failure with -O3 |
9 |
|
10 |
Upstream patch (not yet merged, but simple enough) which works around |
11 |
a build failure (false positive) with -O3. |
12 |
|
13 |
Closes: https://bugs.gentoo.org/832732 |
14 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
15 |
|
16 |
.../files/libusb-1.0.25-fix-O3-warning.patch | 32 ++++++++++++++++++++++ |
17 |
dev-libs/libusb/libusb-1.0.25.ebuild | 4 +++ |
18 |
2 files changed, 36 insertions(+) |
19 |
|
20 |
diff --git a/dev-libs/libusb/files/libusb-1.0.25-fix-O3-warning.patch b/dev-libs/libusb/files/libusb-1.0.25-fix-O3-warning.patch |
21 |
new file mode 100644 |
22 |
index 000000000000..7270b057d172 |
23 |
--- /dev/null |
24 |
+++ b/dev-libs/libusb/files/libusb-1.0.25-fix-O3-warning.patch |
25 |
@@ -0,0 +1,32 @@ |
26 |
+https://github.com/libusb/libusb/pull/1062 |
27 |
+https://github.com/libusb/libusb/issues/1063 |
28 |
+https://bugs.gentoo.org/832732 |
29 |
+ |
30 |
+From 8bb81fe72286cdcb782c7af4f0d7ef715b2e137c Mon Sep 17 00:00:00 2001 |
31 |
+From: Yegor Yefremov <yegorslists@××××××××××.com> |
32 |
+Date: Sun, 6 Feb 2022 07:12:14 +0100 |
33 |
+Subject: [PATCH] linux_usbfs: fix maybe-uninitialized error |
34 |
+MIME-Version: 1.0 |
35 |
+Content-Type: text/plain; charset=UTF-8 |
36 |
+Content-Transfer-Encoding: 8bit |
37 |
+ |
38 |
+Initialize active_config to an invalid value to avoid the following |
39 |
+compilation error: |
40 |
+ |
41 |
+os/linux_usbfs.c: In function ‘op_get_configuration’: |
42 |
+os/linux_usbfs.c:1452:12: error: ‘active_config’ may be used uninitialized in this function [-Werror=maybe-uninitialized] |
43 |
+ 1452 | *config = (uint8_t)active_config; |
44 |
+ |
45 |
+Signed-off-by: Yegor Yefremov <yegorslists@××××××××××.com> |
46 |
+--- a/libusb/os/linux_usbfs.c |
47 |
++++ b/libusb/os/linux_usbfs.c |
48 |
+@@ -1429,7 +1429,7 @@ static int op_get_configuration(struct libusb_device_handle *handle, |
49 |
+ uint8_t *config) |
50 |
+ { |
51 |
+ struct linux_device_priv *priv = usbi_get_device_priv(handle->dev); |
52 |
+- int active_config; |
53 |
++ int active_config = -1; /* to please compiler */ |
54 |
+ int r; |
55 |
+ |
56 |
+ if (priv->sysfs_dir) { |
57 |
+ |
58 |
|
59 |
diff --git a/dev-libs/libusb/libusb-1.0.25.ebuild b/dev-libs/libusb/libusb-1.0.25.ebuild |
60 |
index 328fa227b1de..71c8364d0b70 100644 |
61 |
--- a/dev-libs/libusb/libusb-1.0.25.ebuild |
62 |
+++ b/dev-libs/libusb/libusb-1.0.25.ebuild |
63 |
@@ -21,6 +21,10 @@ DEPEND="${RDEPEND} |
64 |
!udev? ( virtual/os-headers )" |
65 |
BDEPEND="doc? ( app-doc/doxygen )" |
66 |
|
67 |
+PATCHES=( |
68 |
+ "${FILESDIR}"/${P}-fix-O3-warning.patch |
69 |
+) |
70 |
+ |
71 |
multilib_src_configure() { |
72 |
local myeconfargs=( |
73 |
$(use_enable static-libs static) |