From patchwork Fri Aug 12 14:15:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthew Wahab X-Patchwork-Id: 14518 Received: (qmail 20615 invoked by alias); 12 Aug 2016 14:16:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 20606 invoked by uid 89); 12 Aug 2016 14:16:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Functions, Matthew, matthew X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Aug 2016 14:15:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9855A28 for ; Fri, 12 Aug 2016 07:17:22 -0700 (PDT) Received: from [10.2.206.222] (e108033-lin.cambridge.arm.com [10.2.206.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 423B53F213 for ; Fri, 12 Aug 2016 07:15:52 -0700 (PDT) From: Matthew Wahab To: gdb-patches@sourceware.org Subject: [GDB][PR gdb/20457] Fix builds broken by proc-service changes. Message-ID: <57ADDA16.9060201@foss.arm.com> Date: Fri, 12 Aug 2016 15:15:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Hello, GLIBC BZ#20311 introduced a change to install proc_service.h so that gdb didn't have to use the version it embeds in gdb_proc_service.h. The embedded version is guarded by HAVE_PROC_SERVICE_H and gdb_proc_service.h has a number other of includes and definitions, all of which are uncondional except for an include for gregset.h. This is only included if HAVE_PROC_SERIVCE_H is not defined. This causes a build failure when cross compiling gdb with the latest glibc because type definitions in gregset are used independently of HAVE_PROC_SERIVCE_H. In particular, they are used in gdb_proc_service.h when PRFPREGSET_T_BROKEN is set. The error messages on the failure are ---- binutils-gdb/gdb/gdb_proc_service.h:173:9: error: ‘gdb_fpregset_t’ does not name a type; did you mean ‘elf_fpregset_t’? typedef gdb_fpregset_t gdb_prfpregset_t; ^~~~~~~~~~~~~~ elf_fpregset_t binutils-gdb/gdb/gdb_proc_service.h:173:9: error: ‘gdb_fpregset_t’ does not name a type; did you mean ‘elf_fpregset_t’? typedef gdb_fpregset_t gdb_prfpregset_t; ^~~~~~~~~~~~~~ elf_fpregset_t binutils-gdb/gdb/proc-service.c:218:15: error: ‘gdb_prfpregset_t’ does not name a type; did you mean ‘gdb_fpregset_t’? const gdb_prfpregset_t *fpregset) ^~~~~~~~~~~~~~~~ gdb_fpregset_t ---- This patch moves the include for gregset.h to before the code guarded by HAVE_PROC_SERIVCE_H, so that it is always included. This is enough to fix the build. The macro PRFPREGSET_T_BROKEN is set by the configure script which uses AC_TRY_RUN to test the sizeof (prfregset_t) and is always set for cross-compiled builds. It's probably better to do the test using AC_CHECK_SIZEOF, so that cross-compiled build get the correct value. I'll send a follow-up patch to do that. Tested by building gdb for target and host aarch64-none-linux-gnu against previous and current glibc and by cross-compiling for aarch64-none-linux-gnu with new glibc on an x86_64-pc-linux-gnu host. Is this ok? Matthew 2016-08-12 Matthew Wahab PR gdb/20457 * gdb_proc_service.h: Add an include of gregset.h [!HAVE_PROC_SERVICE_H]: Remove the include of gregset.h. From 03f2f5abae5c5cd0c37609d5a4056aed83524a1d Mon Sep 17 00:00:00 2001 From: Matthew Wahab Date: Tue, 9 Aug 2016 09:49:55 +0100 Subject: [PATCH] [GDB] Fix builds broken by proc-service changes. This patch moves the include for gregset.h to before the code guarded by HAVE_PROC_SERIVCE_H, so that it is always included. This is enough to fix the build. 2016-08-12 Matthew Wahab PR gdb/20457 * gdb_proc_service.h: Add an include of gregset.h [!HAVE_PROC_SERVICE_H]: Remove the include of gregset.h. --- gdb/gdb_proc_service.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/gdb_proc_service.h b/gdb/gdb_proc_service.h index 04d3c03..38b98fc 100644 --- a/gdb/gdb_proc_service.h +++ b/gdb/gdb_proc_service.h @@ -21,6 +21,8 @@ #include +#include "gregset.h" + #ifdef HAVE_PROC_SERVICE_H /* glibc's proc_service.h doesn't wrap itself with extern "C". Need @@ -60,8 +62,6 @@ EXTERN_C_POP #include #endif -#include "gregset.h" - EXTERN_C_PUSH /* Functions in this interface return one of these status codes. */ -- 2.1.4