autoconf tests don't terminate on ix86-linux-gnu with -static -fPIE -pie on glibc-2.18 based systems

Matthias Klose doko@ubuntu.com
Fri Jan 10 12:17:00 GMT 2014


submitted as PR ld/16428

seen with packaging mistakes, when -static -fPIE -pie are passed together to
configure.

$ cat conftest.c
int main() { return 0; }

x86_64:
$ gcc -fPIE -pie -static conftest.c
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginT.o: relocation
R_X86_64_32 against `__TMC_END__' can not be used when making a shared object;
recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginT.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

i586-linux-gnu and glibc-2.17:
$ gcc -fPIE -pie -static conftest.c
$ echo $?
0
[no a.out produced]

i586-linux-gnu and glibc-2.18:
$ gcc -fPIE -pie -static conftest.c
*** Error in `/usr/bin/ld': corrupted double-linked list: 0x09bfc260 ***
^C
[doesn't terminate]

gold complains about the combination of the options

$ gcc -fuse-ld=gold -fPIE -pie -static conftest.c
/usr/bin/ld.gold: fatal error: -pie and -static are incompatible
collect2: error: ld returned 1 exit status

so should ld.bfd behave like ld.gold and giving an error message with this
combination of options?

  Matthias



More information about the Binutils mailing list