This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
autoconf tests don't terminate on ix86-linux-gnu with -static -fPIE -pie on glibc-2.18 based systems
- From: Matthias Klose <doko at ubuntu dot com>
- To: binutils <binutils at sourceware dot org>
- Date: Fri, 10 Jan 2014 13:17:06 +0100
- Subject: autoconf tests don't terminate on ix86-linux-gnu with -static -fPIE -pie on glibc-2.18 based systems
- Authentication-results: sourceware.org; auth=none
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