Fix compiler warnings building against Linux uapi headers

Message ID CAJgzZoo9c-JSgqXLjD863kRSngJuHhatUadaXrVTw20kDkunvw@mail.gmail.com
State New, archived
Headers

Commit Message

enh Aug. 25, 2015, 8:34 p.m. UTC
  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.




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
>
  

Comments

Yao Qi Aug. 26, 2015, 11:25 a.m. UTC | #1
enh <enh@google.com> writes:

> 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.

We need two changelog entries for gdb/ChangeLog and
gdb/gdbserver/ChangeLog respectively.  The last sentence "Fixes build
against Linux uapi headers" is not needed.

OK with the changes.
  
enh Aug. 26, 2015, 3:25 p.m. UTC | #2
2015-08-26  Elliott Hughes  <enh@google.com>

        * arm-linux-tdep.h: Only define HWCAP_VFP and friends if they're
        not already defined.

2015-08-26  Elliott Hughes  <enh@google.com>

        * linux-arm-low.c: Only define HWCAP_VFP and friends if they're
        not already defined.



On 8/26/15, Yao Qi <qiyaoltc@gmail.com> wrote:
> enh <enh@google.com> writes:
>
>> 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.
>
> We need two changelog entries for gdb/ChangeLog and
> gdb/gdbserver/ChangeLog respectively.  The last sentence "Fixes build
> against Linux uapi headers" is not needed.
>
> OK with the changes.
>
> --
> Yao (齐尧)
>
  

Patch

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>