[PATCH] Fix compiler warnings building against Linux uapi headers

enh enh@google.com
Tue Aug 25 20:34:00 GMT 2015


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.



More information about the Gdb-patches mailing list