From patchwork Mon Jun 22 19:09:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: enh X-Patchwork-Id: 7292 Received: (qmail 4288 invoked by alias); 22 Jun 2015 19:09:30 -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 4253 invoked by uid 89); 22 Jun 2015 19:09:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f180.google.com Received: from mail-ig0-f180.google.com (HELO mail-ig0-f180.google.com) (209.85.213.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 22 Jun 2015 19:09:28 +0000 Received: by igin14 with SMTP id n14so23232717igi.1 for ; Mon, 22 Jun 2015 12:09:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=V0YGsNgFbEt4U8V8VXJT1E3+ZLLCWQlAJA07Ms985/M=; b=dZUdk3lJP3YrdiKwhDjgEeMPc5B3YrYJf1qt2N634WiDfKROF0h6y9g9QQ5SzZP1sS j8HB/KmchxkWW9wQlOnA8mSlkd4jTvcvsqepEUBB39lN3Hu1quLgi05KpowL5F+fejTU hj6SdfRYTVBRy6EXd4P/ejLlNe/huYeQiYmS+Ej5MW+YGN41EboH7pWEOb971eOZlJka y3oFw5LbK4j2okVNZYn78q5dxtPCebus2ovMTqp3k0mWkGVUkj6Wv/CoJZtWfQocn7Gm pmrix2/J4zFe91iq85AweS1Tq6i3ss4z8rZAkW2rE/A3008lcBreenjz26WYoNWW8EOU gBvg== X-Gm-Message-State: ALoCoQk3iP5GGOAPJc707iJXOYfKXrxwG+Cg2ORvl/jiGOOndFqYlEHLoLvDLJFo3cNoSCSKGHoS MIME-Version: 1.0 X-Received: by 10.43.17.135 with SMTP id qc7mr27601814icb.14.1435000166650; Mon, 22 Jun 2015 12:09:26 -0700 (PDT) Received: by 10.36.24.7 with HTTP; Mon, 22 Jun 2015 12:09:26 -0700 (PDT) Date: Mon, 22 Jun 2015 12:09:26 -0700 Message-ID: Subject: [PATCH] Fix compiler warnings building against Linux uapi headers From: enh To: gdb-patches@sourceware.org Cc: Doug Evans building gdb against the Linux kernel's uapi headers (as used by Android's bionic C library) causes warnings such as: gdb/gdbserver/linux-arm-low.c:122:0: warning: "HWCAP_VFP" redefined [enabled by default] because linux-arm-low.c has #defines like this: #define HWCAP_VFP 64 but the current Linux kernel #define looks like this instead: #define HWCAP_VFP (1 << 6) I don't know whether you still need to support versions of glibc that don't have these constants at all; if you don't, a better fix would be to remove gdbserver's duplicate definitions. But on the assumption that you do need to support old versions of glibc, here's a patch to avoid the redefinition... 2015-06-22 Elliott Hughes * linux-arm-low.c: Only define HWCAP_VFP and friends if they're not already defined. Fixes build against Linux uapi headers. diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c index 303d9c8..f199b1c 100644 --- a/gdb/gdbserver/linux-arm-low.c +++ b/gdb/gdbserver/linux-arm-low.c @@ -119,11 +119,21 @@ struct arch_lwp_info static unsigned long arm_hwcap; /* These are in in current kernels. */ +#ifndef HWCAP_VFP #define HWCAP_VFP 64 +#endif +#ifndef HWCAP_IWMMXT #define HWCAP_IWMMXT 512 +#endif +#ifndef HWCAP_NEON #define HWCAP_NEON 4096 +#endif +#ifndef HWCAP_VFPv3 #define HWCAP_VFPv3 8192 +#endif +#ifndef HWCAP_VFPv3D16 #define HWCAP_VFPv3D16 16384 +#endif #ifdef HAVE_SYS_REG_H #include