All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/kismet: fix build with gcc 9
@ 2020-08-22 20:23 Fabrice Fontaine
  2020-08-23 21:33 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2020-08-22 20:23 UTC (permalink / raw)
  To: buildroot

Fixes:
 - http://autobuild.buildroot.org/results/85f7c746ae1cc19f8839f892f0c280dcb0444ea9

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/kismet/0006-fix-cmsg_fd.patch | 31 +++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 package/kismet/0006-fix-cmsg_fd.patch

diff --git a/package/kismet/0006-fix-cmsg_fd.patch b/package/kismet/0006-fix-cmsg_fd.patch
new file mode 100644
index 0000000000..494486bb71
--- /dev/null
+++ b/package/kismet/0006-fix-cmsg_fd.patch
@@ -0,0 +1,31 @@
+Fix cmsg_fd
+
+Defining fd after a struct cmsghdr results in the following build
+failure with at least gcc 9:
+
+In file included from /home/buildroot/autobuild/instance-3/output-1/host/xtensa-buildroot-linux-uclibc/sysroot/usr/include/sys/socket.h:39,
+                 from ipc_remote.h:61,
+                 from ipc_remote.cc:34:
+/home/buildroot/autobuild/instance-3/output-1/host/xtensa-buildroot-linux-uclibc/sysroot/usr/include/bits/socket.h:289:33: error: flexible array member 'cmsghdr::__cmsg_data' not at end of 'struct<unnamed>'
+  289 |     __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data.  */
+      |                                 ^~~~~~~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/307f234edd6dffdb2419a2be5209ef5cd3b6d8d1
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: not upstreamable (offending code removed)]
+
+diff -Naurp kismet-2016-07-R1-orig/ipc_remote.cc kismet-2016-07-R1/ipc_remote.cc
+--- kismet-2016-07-R1-orig/ipc_remote.cc	2020-08-22 22:09:41.358657927 +0200
++++ kismet-2016-07-R1/ipc_remote.cc	2020-08-22 22:10:39.770835468 +0200
+@@ -941,8 +941,8 @@ int RootIPCRemote::OpenFDPassSock() {
+ }
+ 
+ typedef struct {
+-	struct cmsghdr header;
+ 	int            fd;
++	struct cmsghdr header;
+ } __attribute__((packed)) cmsg_fd;
+ 
+ int RootIPCRemote::SendDescriptor(int in_fd) {
-- 
2.28.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package/kismet: fix build with gcc 9
  2020-08-22 20:23 [Buildroot] [PATCH 1/1] package/kismet: fix build with gcc 9 Fabrice Fontaine
@ 2020-08-23 21:33 ` Thomas Petazzoni
  2020-08-24  6:47   ` Fabrice Fontaine
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2020-08-23 21:33 UTC (permalink / raw)
  To: buildroot

Hello Fabrice,

On Sat, 22 Aug 2020 22:23:50 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> + typedef struct {
> +-	struct cmsghdr header;
> + 	int            fd;
> ++	struct cmsghdr header;

Are you sure this fix is correct ?

The cmsghdr structure, as its name suggest, is meant to be the "header
of a message", and that's why it has this zero-length array at the end,
to access the payload of the message. I am not sure what the
consequences are in this specific case, but do you have some
evidence/explanation that this is correct, beyond "it builds fine" ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 1/1] package/kismet: fix build with gcc 9
  2020-08-23 21:33 ` Thomas Petazzoni
@ 2020-08-24  6:47   ` Fabrice Fontaine
  0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2020-08-24  6:47 UTC (permalink / raw)
  To: buildroot

Hello Thomas,

Le dim. 23 ao?t 2020 ? 23:33, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> a ?crit :
>
> Hello Fabrice,
>
> On Sat, 22 Aug 2020 22:23:50 +0200
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> > + typedef struct {
> > +-    struct cmsghdr header;
> > +     int            fd;
> > ++    struct cmsghdr header;
>
> Are you sure this fix is correct ?
>
> The cmsghdr structure, as its name suggest, is meant to be the "header
> of a message", and that's why it has this zero-length array at the end,
> to access the payload of the message. I am not sure what the
> consequences are in this specific case, but do you have some
> evidence/explanation that this is correct, beyond "it builds fine" ?
Nope I don't have any evidence so I'll send another patch setting --std=c++11.
I'll also check if the build failure can be reproduced with gcc < 9.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Best Regards,

Fabrice

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-24  6:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 20:23 [Buildroot] [PATCH 1/1] package/kismet: fix build with gcc 9 Fabrice Fontaine
2020-08-23 21:33 ` Thomas Petazzoni
2020-08-24  6:47   ` Fabrice Fontaine

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.