[lto, build] Provide elf_getshdrstrndx replacement

Richard Guenther richard.guenther@gmail.com
Mon Apr 19 13:55:00 GMT 2010


On Mon, Apr 19, 2010 at 3:47 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Fri, Apr 16, 2010 at 3:45 PM, Rainer Orth
> <ro@cebitec.uni-bielefeld.de> wrote:
>> Diego Novillo <dnovillo@google.com> writes:
>>
>>> OK for trunk.  Thanks for fixing this wart.
>>
>> Thanks, installed with a one-line change to install.texi.
>>
>>> I suppose that it's also OK for 4.5.1, but the RMs should decide that.
>>
>> Ok, I'll ask again in a week or two.
>
> This broke all LTO tests on a previously working (lto disabled)
> configuration with
>
> lto1: error: could not locate ELF string table: ^M
> lto-wrapper: /home/abuild/rguenther/obj/gcc/xgcc returned 1 exit status^M
> collect2: lto-wrapper returned 1 exit status^M
>
> I have
>
> /* Define to 1 if you have the `elf_getshdrstrndx' function. */
> #ifndef USED_FOR_TARGET
> /* #undef HAVE_ELF_GETSHDRSTRNDX */
> #endif
>
>
> /* Define to 1 if you have the `elf_getshstrndx' function. */
> #ifndef USED_FOR_TARGET
> #define HAVE_ELF_GETSHSTRNDX 1
> #endif
>
> and elfutils libelf.
>
> Appearantly your elf_getshdrstrnd wrapper doesn't work.
> elf_getshstrndx returns zero for me.  So it appears
> that instead of ? 0 : -1 you should simply forward the
> return value.

Because ...

conftest.c:111:2: error: expected identifier or '(' before ',' token
conftest.c:112:1: error: stray '\' in program
configure:8465: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
...
| #include <stdlib.h>
| #include <libelf.h>
| int main()
| {
|   return elf_getshstrndx (NULL, 0) == 0;
| },
| printf %s\n "#define HAVE_ELF_GETSHSTRNDX_GABI 1" >>confdefs.h

Richard.



More information about the Gcc-patches mailing list