This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] gdbserver: Add linux_get_hwcap
- From: Alan Hayward <Alan dot Hayward at arm dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: Simon Marchi <simark at simark dot ca>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, nd <nd at arm dot com>
- Date: Thu, 28 Mar 2019 11:35:04 +0000
- Subject: Re: [PATCH 2/2] gdbserver: Add linux_get_hwcap
- References: <20190328095036.A0EE1D802AE@oc3748833570.ibm.com>
> On 28 Mar 2019, at 09:50, Ulrich Weigand <uweigand@de.ibm.com> wrote:
>
> Alan Hayward wrote:
>
>> * linux-low.c (linux_get_auxv): New function.
>> (linux_get_hwcap): Likewise.
>> (linux_get_hwcap2): Likewise.
>
> This still breaks the build on my Cell/B.E. dailybuild:
>
> gdb/gdbserver/linux-low.c: In function 'CORE_ADDR linux_get_hwcap2(int)':
> gdb/gdbserver/linux-low.c:7471:36: error: 'AT_HWCAP2' was not declared in this scope
> return linux_get_auxv (wordsize, AT_HWCAP2);
> ^~~~~~~~~
>
> The system (RHEL5) is so old that the system headers do not
> yet provide AT_HWCAP2. The old code worked because
> linux-ppc-low.c got the define via #include "elf/common.h",
> which linux-low.c does not include.
>
Gah! Another failure. Apologies.
> I guess we should either have linux-low.c include the local
> file as well (if that is possible -- there may be conflicts
> with <elf.h> that is otherwise already included), or else
> provide a fallback define of AT_HWCAP2 only.
I’ve just tried adding the include and I get conflicts.
Linux-low already has some similar fallback defines, eg:
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#endif
I’ll send out a new OBV patch with the AT_HWCAP2 added in the same way.
Alan.
>
> Bye,
> Ulrich
>
> --
> Dr. Ulrich Weigand
> GNU/Linux compilers and toolchain
> Ulrich.Weigand@de.ibm.com
>