This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix compiler warnings building against Linux uapi headers
- From: enh <enh at google dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, enh <enh at google dot com>, gdb-patches at sourceware dot org, Doug Evans <dje at google dot com>
- Date: Tue, 25 Aug 2015 13:34:32 -0700
- Subject: Re: [PATCH] Fix compiler warnings building against Linux uapi headers
- Authentication-results: sourceware.org; auth=none
- References: <CAJgzZopOniu-Uh128-y3f61zx04D=U-QtjgYTps7sxvef-Nw8g at mail dot gmail dot com> <86egkyqxwg dot fsf at gmail dot com> <20150805085012 dot GF26572 at vapier>
sorry; been too busy to get back to this. new patch addresses earlier comment:
2015-08-25 Elliott Hughes <enh@google.com>
* arm-linux-tdep.h, 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/arm-linux-tdep.h b/gdb/arm-linux-tdep.h
index dc05edf..d6a1181 100644
--- a/gdb/arm-linux-tdep.h
+++ b/gdb/arm-linux-tdep.h
@@ -61,9 +61,19 @@ void arm_linux_collect_nwfpe (const struct regset *regset,
/* ARM GNU/Linux HWCAP values. These are in defined in
<asm/elf.h> 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
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index 6a27e6e..60645de 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -117,11 +117,21 @@ struct arch_lwp_info
};
/* These are in <asm/elf.h> 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 <sys/reg.h>
On 8/5/15, Mike Frysinger <vapier@gentoo.org> wrote:
> On 26 Jun 2015 16:42, Yao Qi wrote:
>> enh <enh@google.com> writes:
>> > 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...
>>
>> We should avoid the redefinition in gdb/arm-linux-tdep.h too. Could you
>> please fix it there too?
>>
>> > 2015-06-22 Elliott Hughes <enh@google.com>
>> >
>> > * linux-arm-low.c: Only define HWCAP_VFP and friends if they're
>> > not already defined. Fixes build against Linux uapi headers.
>>
>> OK with the changes.
>
> Elliott: you going to respin this ?
> -mike
>
--
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.