[PATCH] gnu: libusb-0.1: fix build failure on newer gcc

  • Done
  • quality assurance status badge
Details
2 participants
  • Christopher Howard
  • Jakub K?dzio?ka
Owner
unassigned
Submitted by
Christopher Howard
Severity
normal
C
C
Christopher Howard wrote on 3 May 2020 00:47
(address . guix-patches@gnu.org)
1a3c1bf5091742ae78a5946c92a622206dcdf596.camel@librehacker.com
I need libusb-0.1 to build some older software, but libusb-0.1 build
fails due to a warning from the current GCC version. (Evidently libusb-
0.1 is set to die on any warning.) The attached patch silences the
warning.

--
Christopher Howard
p: +1 (907) 374-0257
gpg: ADDEAADE5D607C8D (keys.gnupg.net)
From 351bb7004f9bbe8d50bbc7a2e2a1cb3900551e27 Mon Sep 17 00:00:00 2001
From: Christopher Howard <christopher@librehacker.com>
Date: Sat, 2 May 2020 14:41:00 -0800
Subject: [PATCH] gnu: libusb-0.1: fix build failure on newer gcc

Package build fails on truncation warning from current gcc. Silences
this warning.
---
gnu/packages/libusb.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm
index 01c138cb4e..3bb2dcd186 100644
--- a/gnu/packages/libusb.scm
+++ b/gnu/packages/libusb.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2017 Jonathan Brielmaier <jonathan.brielmaier@web.de>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
+;;; Copyright © 2020 Christopher Howard <christopher@librehacker.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -113,7 +114,8 @@ version of libusb to run with newer libusb.")
(sha256
(base32
"0i4bacxkyr7xyqxbmb00ypkrv4swkgm0mghbzjsnw6blvvczgxip"))
- (patches (search-patches "libusb-0.1-disable-tests.patch"))))))
+ (patches (search-patches "libusb-0.1-disable-tests.patch"))))
+ (arguments `(#:configure-flags (list "CFLAGS=-Wno-format-truncation")))))
(define-public libusb4java
;; There is no public release so we take the latest version from git.
--
2.26.2
J
J
Jakub K?dzio?ka wrote on 3 May 2020 12:58
(name . Christopher Howard)(address . christopher@librehacker.com)(address . guix-patches@gnu.org)
20200503105846.fvouqze7r5qhb5nf@gravity
On Sat, May 02, 2020 at 02:47:56PM -0800, Christopher Howard wrote:
Toggle quote (5 lines)
> I need libusb-0.1 to build some older software, but libusb-0.1 build
> fails due to a warning from the current GCC version. (Evidently libusb-
> 0.1 is set to die on any warning.) The attached patch silences the
> warning.

Thanks for your patch! I'm wondering though, whether it wouldn't be more
resilient to add a -Wno-error flag instead. After all, the compiler is
going to get upgraded sooner or later, which will introduce new
warnings, and libusb 0.1 isn't getting any upgrades...

A quick grep suggests that this wouldn't be the first package to disable
Werror. Makes sense, since this mode is mostly useful to developers, and
not packagers.

What do you think?

Kind regards,
Jakub K?dzio?ka
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl6uo+UACgkQ4xWnWEYT
FWT9+Q/9HjHQs3ctKLH6EnMjWfaOyxGmCPE7TjpTr8mMG1F1eR0ONLOnSxHe88Ac
VItBgOUkh9On7dTvaLCP902lMn1oyvGvDADpIgf9COSr+X/U8RRHiSVACCe/4DeL
Lf0+1nFItKgrpGPA4K9nwhKq8AExdbokMCtxpGQfmORbtcY0p7b9VZNTUSrEdcZK
EJrlvv+EiLkyzB8ovmWqDSbyPpJ/3Oj6TcXaJFaXTzQtzQUfXb1YxXxuPSf6VuRZ
QMA76RywZiZGRJBk+Qmka7FtP6YWlsh75Pd+DIwybrwGG4Sz/68atDNC9gOXVykC
p3dSrwYqgxfpD4IaVLWNvzRxRRoVdp8dApoC89xZnvVGe0nn0Zqz47wPgqGPNiP4
IH1jvdhqBRRb8kfVJIxArZD0qpwxiHE8LtNt5DCoqCYO86GKbbk+sbltZa53YBSz
Hbqbi+dGitNZlOZNhv2tYg+R7NyrTTspccdrtgixnskbO/BLLURq8unJeewjUUCn
qDFQ2LjDxX11ifApTYZAs8KY5U3jHqVkeDQY6peTJSVDIvLZjWeekCUbC7grJ0wG
UYYziXkzJBxkkEukjQuKp049UWxJsiEU5aXJzebkTN/ZdNKgbcAYKh24AgGnc4PN
rxRGf/Ta1N1U+Hzaj89dsUXPP3uSMP6khFv5m2UDxG55Y2JawZk=
=vddo
-----END PGP SIGNATURE-----


C
C
Christopher Howard wrote on 3 May 2020 18:13
(name . Jakub K?dzio?ka)(address . kuba@kadziolka.net)(address . guix-patches@gnu.org)
ab5e62e0da536c777dbb2856400620808b3de963.camel@librehacker.com
Sounds good to me. Can you make the edit to the patch?

--
Christopher Howard
p: +1 (907) 374-0257
gpg: ADDEAADE5D607C8D (keys.gnupg.net)

On Sun, 2020-05-03 at 12:58 +0200, Jakub K?dzio?ka wrote:
Toggle quote (25 lines)
> On Sat, May 02, 2020 at 02:47:56PM -0800, Christopher Howard wrote:
> > I need libusb-0.1 to build some older software, but libusb-0.1
> > build
> > fails due to a warning from the current GCC version. (Evidently
> > libusb-
> > 0.1 is set to die on any warning.) The attached patch silences the
> > warning.
>
> Thanks for your patch! I'm wondering though, whether it wouldn't be
> more
> resilient to add a -Wno-error flag instead. After all, the compiler
> is
> going to get upgraded sooner or later, which will introduce new
> warnings, and libusb 0.1 isn't getting any upgrades...
>
> A quick grep suggests that this wouldn't be the first package to
> disable
> Werror. Makes sense, since this mode is mostly useful to developers,
> and
> not packagers.
>
> What do you think?
>
> Kind regards,
> Jakub K?dzio?ka
J
J
Jakub K?dzio?ka wrote on 3 May 2020 22:56
(name . Christopher Howard)(address . christopher@librehacker.com)(address . 41033-done@debbugs.gnu.org)
20200503205659.yee5vejdbqoic2c3@gravity
On Sun, May 03, 2020 at 08:13:32AM -0800, Christopher Howard wrote:
Toggle quote (2 lines)
> Sounds good to me. Can you make the edit to the patch?

Sure! I pushed the modified patch:

commit 96e399ee30251a0767a45b2bde3f052b25c62714 (HEAD -> master, upstream/master)
Author: Christopher Howard <christopher@librehacker.com>
Date: Sat May 2 14:41:00 2020 -0800

gnu: libusb-0.1: fix build failure on newer gcc

* gnu/packages/libusb.scm (libusb-0.1): Disable -Werror.

Signed-off-by: Jakub K?dzio?ka <kuba@kadziolka.net>

Cheers!
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl6vMBcACgkQ4xWnWEYT
FWQRMA/9EIyjFBDApsKuaNieoMUYVh40J4rZKmsf8eFQxHtGiPMrvveoJ+lC8jOs
WFjJewl3MVcsLwIhLFJXVapRLJhmORyxe57V2vhsk17oQkuS0inPee18K8rRYz4l
wAdL7vxfuILTwlpgqIgLxM29MqU/9NqXEMC+P6/gplJIJ450xtgiUTfi6Mqg5Xsm
wXm5M073xU2rI2fQxjv3G9QKo4MCSoJ9UrQhbqt28UbclWUGXPw/+X5CA9gLUq6J
jPjKG3r0M1nzY8FpKcIwjgdPhoi3vzSCbwCztXyFUzvWly9sUKOAsGy4rwczt0M1
wPxm0jBQBSGDBVUji2nJHnBAmzxOkoRWah02c95zmGEbr2T8KtZK2wCvLRnnvAXu
oo2OKEO/wkWUUFXIZn40wmN5QFbmPbb1E72xx5Oj8moJ6Dl7nwpukGiOQeGnw5xu
kNQhqb3n0dsbL4GP1UsEiC6t5X6fuAsWwWxTErJqy5kUqGptsIW2J3PMJWjsVx6D
k767VLsMZ1c7OegxqSjQbAy/4lfqW1Eh7Hj+1Ewcs41R5+iZe753B71aDG8rVYth
uLS8j8R1IDQTBKV0cV6RG1uQlf/8anSA3s0KSPy2yTmKx2mE2lhhpB/KNMnFZu5U
vNXNUx/Y/d51N8jtIxwNw0rFit1gyoTzXrkebIcx95Wzrpf6OmA=
=VBpW
-----END PGP SIGNATURE-----


Closed
?