diff mbox

[v2] _GCC_PICFLAG: use -fPIC for s390x targets

Message ID 1323362021-22093-1-git-send-email-vapier@gentoo.org
State New
Headers show

Commit Message

Mike Frysinger Dec. 8, 2011, 4:33 p.m. UTC
Building newer libiberty for s390x targets fails with relocation errors:
	libiberty/pic/libiberty.a(hashtab.o): In function 'htab_create':
	libiberty/hashtab.c:408:(.text+0x5e4): relocation truncated to fit:
		R_390_GOT12 against symbol 'xcalloc' defined in .text section in
		libiberty/pic/libiberty.a(xmalloc.o)
	libiberty/pic/libiberty.a(hashtab.o): In function 'htab_try_create':
	libiberty/hashtab.c:414:(.text+0x61c): relocation truncated to fit:
		R_390_GOT12 against symbol 'calloc@@GLIBC_2.2' defined in .text
		section in /lib/libc.so.6
	collect2: ld returned 1 exit status

Building with larger GOT (-fPIC rather than -fpic) fixes this.

CC: Aurelien Jarno <aurelien@aurel32.net>
CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>

config/:
2011-12-06  Mike Frysinger  <vapier@gentoo.org>

	* picflag.m4 (_GCC_PICFLAG): Set $1 to -fPIC for s390x*-*-*.

gcc/:
libada/:
libgcc/:
libiberty/:
2011-12-06  Mike Frysinger  <vapier@gentoo.org>

	* configure: Regenerate.
---
v2
	- fix typo when porting patch from older binutils

 config/picflag.m4 |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

Rainer Orth Dec. 8, 2011, 4:48 p.m. UTC | #1
Mike Frysinger <vapier@gentoo.org> writes:

> Building newer libiberty for s390x targets fails with relocation errors:
> 	libiberty/pic/libiberty.a(hashtab.o): In function 'htab_create':
> 	libiberty/hashtab.c:408:(.text+0x5e4): relocation truncated to fit:
> 		R_390_GOT12 against symbol 'xcalloc' defined in .text section in
> 		libiberty/pic/libiberty.a(xmalloc.o)
> 	libiberty/pic/libiberty.a(hashtab.o): In function 'htab_try_create':
> 	libiberty/hashtab.c:414:(.text+0x61c): relocation truncated to fit:
> 		R_390_GOT12 against symbol 'calloc@@GLIBC_2.2' defined in .text
> 		section in /lib/libc.so.6
> 	collect2: ld returned 1 exit status
>
> Building with larger GOT (-fPIC rather than -fpic) fixes this.

Unfortunately, you mostly ignored my review comments on the previous
version.

	Rainer
Mike Frysinger Dec. 12, 2011, 10:32 p.m. UTC | #2
On Thursday 08 December 2011 11:48:32 Rainer Orth wrote:
> Mike Frysinger <vapier@gentoo.org> writes:
> > Building newer libiberty for s390x targets fails with relocation errors:
> > 	libiberty/pic/libiberty.a(hashtab.o): In function 'htab_create':
> > 	
> > 	libiberty/hashtab.c:408:(.text+0x5e4): relocation truncated to fit:
> > 		R_390_GOT12 against symbol 'xcalloc' defined in .text section in
> > 		libiberty/pic/libiberty.a(xmalloc.o)
> > 	
> > 	libiberty/pic/libiberty.a(hashtab.o): In function 'htab_try_create':
> > 	
> > 	libiberty/hashtab.c:414:(.text+0x61c): relocation truncated to fit:
> > 		R_390_GOT12 against symbol 'calloc@@GLIBC_2.2' defined in .text
> > 		section in /lib/libc.so.6
> > 	
> > 	collect2: ld returned 1 exit status
> > 
> > Building with larger GOT (-fPIC rather than -fpic) fixes this.
> 
> Unfortunately, you mostly ignored my review comments on the previous
> version.

not really.  what you ask is way beyond scope of s390x and is up to someone 
else to decide.  i'm not an s390 maintainer.
-mike
Rainer Orth Dec. 13, 2011, 10:48 a.m. UTC | #3
Mike Frysinger <vapier@gentoo.org> writes:

>> > Building with larger GOT (-fPIC rather than -fpic) fixes this.
>> 
>> Unfortunately, you mostly ignored my review comments on the previous
>> version.
>
> not really.  what you ask is way beyond scope of s390x and is up to someone 
> else to decide.  i'm not an s390 maintainer.

That's why I've Cc'ed those.  And adding an explanation to picflag.m4
doesn't take an s390 maintainer, but helps others understand why some
specific target uses/requires -fpic rather than the -fPIC default
months/years later, rather than digging in mailing list archives as I
had to do when creating the file.

	Rainer
diff mbox

Patch

diff --git a/config/picflag.m4 b/config/picflag.m4
index f6f1b44..b871d99 100644
--- a/config/picflag.m4
+++ b/config/picflag.m4
@@ -51,6 +51,9 @@  case "${$2}" in
     m68k-*-*)
 	$1=-fpic
 	;;
+    s390x*-*-*)
+	$1=-fPIC
+	;;
     s390*-*-*)
 	$1=-fpic
 	;;