From 72fde3dfe9a2367abc593684b9b4d2343d367d85 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 9 Sep 2014 16:49:13 +0200 Subject: [PATCH] Fix missing "struct iovec" definition on some x86-linux. The following patch... commit 3116063bd617de56fbc3bad046a692b1fb363a9d Date: Fri Jun 27 09:52:29 2014 +0100 Subject: Tidy #include lists ... introduced a build failure on certain x86 GNU/Linux distributions (reproduced on SuSE 10 and RHES4) due to "struct iovec" not being defined. This struct is defined in , which used to be explicitly included, but no longer is after the commit above was applied. [...]/i386-linux-nat.c: In function 'fetch_xstateregs': [...]/i386-linux-nat.c:325:16: error: storage size of 'iov' isn't known [...]/i386-linux-nat.c: In function 'store_xstateregs': [...]/i386-linux-nat.c:348:16: error: storage size of 'iov' isn't known make[2]: *** [i386-linux-nat.o] Error 1 It seems to be working on newer GNU/Linux distros thanks to indirect inclusion of , but it does not work on some other versions of the same distros. This is why indirect includes of public APIs should be avoided if at all possible. This patch fixes the issue by adding the explicit include back. gdb/ChangeLog: * i386-linux-nat.c, x86-linux-nat.c: Add #include. --- gdb/ChangeLog | 4 ++++ gdb/i386-linux-nat.c | 1 + gdb/x86-linux-nat.c | 1 + 3 files changed, 6 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9d3f392..393e4a0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-09-09 Joel Brobecker + + * i386-linux-nat.c, x86-linux-nat.c: Add #include. + 2014-09-08 Doug Evans PR 17247 diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 32a82e9..a08b9b8 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -23,6 +23,7 @@ #include "regcache.h" #include "elf/common.h" #include +#include #include "gregset.h" #include "gdb_proc_service.h" diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c index 67300d8..b2141eb 100644 --- a/gdb/x86-linux-nat.c +++ b/gdb/x86-linux-nat.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "x86-nat.h" #include "linux-nat.h" -- 2.7.4