From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31403 invoked by alias); 9 Sep 2014 15:09:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31393 invoked by uid 89); 9 Sep 2014 15:09:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 09 Sep 2014 15:09:05 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8C36811646A; Tue, 9 Sep 2014 11:09:03 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id n2c-uyh1SZSC; Tue, 9 Sep 2014 11:09:03 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 322D9116451; Tue, 9 Sep 2014 11:09:03 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id D2388477FF; Tue, 9 Sep 2014 08:09:04 -0700 (PDT) Date: Tue, 09 Sep 2014 15:09:00 -0000 From: Joel Brobecker To: Gary Benson Cc: gdb-patches@sourceware.org, Mark Kettenis , Pedro Alves Subject: [pushed] Fix missing "struct iovec" definition on some x86-linux. (was: "[PATCH 7/7 v2] Tidy #include lists") Message-ID: <20140909150904.GA24918@adacore.com> References: <1403878351-22974-1-git-send-email-gbenson@redhat.com> <1403878351-22974-8-git-send-email-gbenson@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <1403878351-22974-8-git-send-email-gbenson@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-09/txt/msg00230.txt.bz2 --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1361 > This commit tidies up the #include lists in {i386,amd64}-linux-nat.c, > removing headers that are no longer required and reordering some lines > so that both files roughly match. Additionally, an unused definition > was removed from the middle of the #include list in i386-linux-nat.c. > > This patch is unchanged from the original version in this series. > > gdb/ > 2014-06-27 Gary Benson > > * amd64-linux-nat.c (gdbcore.h): Removed include. > (regset.h): Likewise. > (nat/linux-btrace.h): Likewise. > (btrace.h): Likewise. > (gdb_assert.h): Likewise. > (string.h): Likewise. > (sys/uio.h): Likewise. > (sys/debugreg.h): Likewise. > (sys/syscall.h): Likewise. > (sys/procfs.h): Likewise. > (sys/user.h): Likewise. > (asm/ptrace.h): Likewise. > (i386-nat.h): Likewise. > * i386-linux-nat.c (i386-nat.h): Likewise. > (regset.h): Likewise. > (target.h): Likewise. > (linux-nat.h): Likewise. > (nat/linux-btrace.h): Likewise. > (btrace.h): Likewise. > (gdb_assert.h): Likewise. > (string.h): Likewise. > (sys/uio.h): Likewise. > (sys/user.h): Likewise. > (sys/procfs.h): Likewise. > (sys/reg.h): Likewise. > (sys/debugreg.h): Likewise. > (ORIG_EAX): Removed definition. Unfortunately, this patch broke GDB builds on some GNU/Linux distros. I fixed the issue I got by applying the attached patch. -- Joel --ikeVEW9yuYc//A+q Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Fix-missing-struct-iovec-definition-on-some-x86-linu.patch" Content-length: 2423 >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" -- 1.9.1 --ikeVEW9yuYc//A+q--