Re: [PATCH] IPA: Fix build problem on !HAVE_GETAUXVAL

Ulrich Weigand
2016-04-04T14:41:18Z

> On 03/04/16 18:20, Ulrich Weigand wrote:
> >> These files need AT_PHDR, which is defined in elf.h. If HAVE_GETAUXVAL
> >> is set, it's implicitely included by sys/auxv.h. Include it manually
> >> for the opposite case.
> >>
> >> gdb/gdbserver/ChangeLog:
> >>
> >> * linux-aarch64-ipa.c: Add <elf.h> include.
> >> * linux-ppc-ipa.c: Add <elf.h> include.
> >> * linux-s390-ipa.c: Add <elf.h> include.
> >> ---
> >> Here's a fix. Does that sound right?
> >
> > This is OK.
> >
> > Thanks,
> > Ulrich
> >
>
> Thanks, pushed.

Hmm, it turns out build still fails for me, this time in the link step:

linux-ppc-ipa.o: In function `alloc_jump_pad_buffer':
gdb/gdbserver/linux-ppc-ipa.c:121: undefined reference to `getauxval'

Looking at tracepoint.c, I notice that the definition of getauxval

#if !defined HAVE_GETAUXVAL && defined IN_PROCESS_AGENT
/* Retrieve the value of TYPE from the auxiliary vector. If TYPE is not
found, 0 is returned. This function is provided if glibc is too old. */

unsigned long
getauxval (unsigned long type)

is itself within a

#ifndef IN_PROCESS_AGENT

block, and so never has any effect ...

Bye,
Ulrich

--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com