public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Using -fPIC for libiberty on s390x
@ 2011-07-25  1:18 Aurelien Jarno
  2011-12-05  6:03 ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Aurelien Jarno @ 2011-07-25  1:18 UTC (permalink / raw)
  To: binutils

Building binutils on s390x leads to relocation issues:

| /home/aurel32/binutils/bfd/../libiberty/pic/libiberty.a(hashtab.o): In function `htab_create':
| /home/aurel32/binutils/libiberty/../../libiberty/hashtab.c:408:(.text+0x5e4): relocation truncated to fit: R_390_GOT12 against symbol `xcalloc' defined in .text section in /home/aurel32/binutils/bfd/../libiberty/pic/libiberty.a(xmalloc.o)
| /home/aurel32/binutils/bfd/../libiberty/pic/libiberty.a(hashtab.o): In function `htab_try_create':
| /home/aurel32/binutils/libiberty/../../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


Using -fPIC instead of -fpic there fixes the issue.

2011-07-23  Aurelien Jarno  <aurelien@aurel32.net>

	* configure.ac: Use -fPIC instead of -fpic on s390x.

--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -216,6 +216,7 @@
 			  *-fpic* ) PICFLAG=-fpic ;;
 			  * ) PICFLAG=-fPIC ;;
 			esac ;;
+    s390x*-*-*)		PICFLAG=-fPIC ;;
     s390*-*-*)		PICFLAG=-fpic ;;
     sh*-*-*)		PICFLAG=-fPIC ;;
   esac


-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Using -fPIC for libiberty on s390x
  2011-07-25  1:18 [PATCH] Using -fPIC for libiberty on s390x Aurelien Jarno
@ 2011-12-05  6:03 ` Mike Frysinger
  2011-12-05  8:47   ` Martin Schwidefsky
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2011-12-05  6:03 UTC (permalink / raw)
  To: binutils, Martin Schwidefsky; +Cc: Aurelien Jarno

[-- Attachment #1: Type: Text/Plain, Size: 1657 bytes --]

On Saturday 23 July 2011 06:51:53 Aurelien Jarno wrote:
> Building binutils on s390x leads to relocation issues:
> | /home/aurel32/binutils/bfd/../libiberty/pic/libiberty.a(hashtab.o): In
> | function `htab_create':
> | /home/aurel32/binutils/libiberty/../../libiberty/hashtab.c:408:(.text+0x
> | 5e4): relocation truncated to fit: R_390_GOT12 against symbol `xcalloc'
> | defined in .text section in
> | /home/aurel32/binutils/bfd/../libiberty/pic/libiberty.a(xmalloc.o)
> |
> | /home/aurel32/binutils/bfd/../libiberty/pic/libiberty.a(hashtab.o): In 
function `htab_try_create':
> | /home/aurel32/binutils/libiberty/../../libiberty/hashtab.c:414:(.text+0x6
> | 1c): 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
> 
> Using -fPIC instead of -fpic there fixes the issue.
> 
> 2011-07-23  Aurelien Jarno  <aurelien@aurel32.net>
> 
> 	* configure.ac: Use -fPIC instead of -fpic on s390x.
> 
> --- a/libiberty/configure.ac
> +++ b/libiberty/configure.ac
> @@ -216,6 +216,7 @@
>  			  *-fpic* ) PICFLAG=-fpic ;;
>  			  * ) PICFLAG=-fPIC ;;
>  			esac ;;
> +    s390x*-*-*)		PICFLAG=-fPIC ;;
>      s390*-*-*)		PICFLAG=-fpic ;;
>      sh*-*-*)		PICFLAG=-fPIC ;;
>    esac

i've run into this issue on Gentoo systems and binutils-2.22.  but now with 
all the pic code being unified with gcc, we need to do:

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Using -fPIC for libiberty on s390x
  2011-12-05  6:03 ` Mike Frysinger
@ 2011-12-05  8:47   ` Martin Schwidefsky
  2011-12-05 15:24     ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Schwidefsky @ 2011-12-05  8:47 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils, Aurelien Jarno

[-- Attachment #1: Type: text/plain, Size: 2104 bytes --]

On Mon, 5 Dec 2011 02:02:10 -0500
Mike Frysinger <vapier@gentoo.org> wrote:

> On Saturday 23 July 2011 06:51:53 Aurelien Jarno wrote:
> > Building binutils on s390x leads to relocation issues:
> > | /home/aurel32/binutils/bfd/../libiberty/pic/libiberty.a(hashtab.o): In
> > | function `htab_create':
> > | /home/aurel32/binutils/libiberty/../../libiberty/hashtab.c:408:(.text+0x
> > | 5e4): relocation truncated to fit: R_390_GOT12 against symbol `xcalloc'
> > | defined in .text section in
> > | /home/aurel32/binutils/bfd/../libiberty/pic/libiberty.a(xmalloc.o)
> > |
> > | /home/aurel32/binutils/bfd/../libiberty/pic/libiberty.a(hashtab.o): In 
> function `htab_try_create':
> > | /home/aurel32/binutils/libiberty/../../libiberty/hashtab.c:414:(.text+0x6
> > | 1c): 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
> > 
> > Using -fPIC instead of -fpic there fixes the issue.
> > 
> > 2011-07-23  Aurelien Jarno  <aurelien@aurel32.net>
> > 
> > 	* configure.ac: Use -fPIC instead of -fpic on s390x.
> > 
> > --- a/libiberty/configure.ac
> > +++ b/libiberty/configure.ac
> > @@ -216,6 +216,7 @@
> >  			  *-fpic* ) PICFLAG=-fpic ;;
> >  			  * ) PICFLAG=-fPIC ;;
> >  			esac ;;
> > +    s390x*-*-*)		PICFLAG=-fPIC ;;
> >      s390*-*-*)		PICFLAG=-fpic ;;
> >      sh*-*-*)		PICFLAG=-fPIC ;;
> >    esac
> 
> i've run into this issue on Gentoo systems and binutils-2.22.  but now with 
> all the pic code being unified with gcc, we need to do:
> 
> --- a/config/picflag.m4
> +++ b/config/picflag.m4
> @@ -51,6 +51,9 @@ case "${$2}" in
>      m68k-*-*)
>  	$1=-fpic
>  	;;
> +    s390x*-*-*)
> +	$1=-fPIC
> +	;;
>      s390*-*-*)
>  	$1=-fpic
>  	;;

Whenever you see a R_390_GOT12 relocation truncated to fit, the correct solution
is to switch from -fpic to -fPIC. I assume that the picflag.m4 replace the old
configure.ac solution, no?

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Using -fPIC for libiberty on s390x
  2011-12-05  8:47   ` Martin Schwidefsky
@ 2011-12-05 15:24     ` Mike Frysinger
  2011-12-05 15:36       ` Martin Schwidefsky
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2011-12-05 15:24 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: binutils, Aurelien Jarno

[-- Attachment #1: Type: Text/Plain, Size: 1494 bytes --]

On Monday 05 December 2011 03:46:55 Martin Schwidefsky wrote:
> On Mon, 5 Dec 2011 02:02:10 -0500 Mike Frysinger wrote:
> > On Saturday 23 July 2011 06:51:53 Aurelien Jarno wrote:
> > > Building binutils on s390x leads to relocation issues:
> > > | /home/aurel32/binutils/bfd/../libiberty/pic/libiberty.a(hashtab.o):
> > > | In function `htab_create':
> > > | /home/aurel32/binutils/libiberty/../../libiberty/hashtab.c:408:(.text
> > > | +0x 5e4): relocation truncated to fit: R_390_GOT12 against symbol
> > > | `xcalloc' defined in .text section in
> > > 
> > > Using -fPIC instead of -fpic there fixes the issue.
> > > 
> > > 2011-07-23  Aurelien Jarno  <aurelien@aurel32.net>
> > > 
> > > 	* configure.ac: Use -fPIC instead of -fpic on s390x.
> > 
> > i've run into this issue on Gentoo systems and binutils-2.22.  but now
> > with all the pic code being unified with gcc, we need to do:
> > 
> > --- a/config/picflag.m4
> > +++ b/config/picflag.m4
> > @@ -51,6 +51,9 @@ case "${$2}" in
> >      m68k-*-*)
> >  	$1=-fpic
> >  	;;
> > +    s390x*-*-*)
> > +	$1=-fPIC
> > +	;;
> >      s390*-*-*)
> >  	$1=-fpic
> >  	;;
> 
> Whenever you see a R_390_GOT12 relocation truncated to fit, the correct
> solution is to switch from -fpic to -fPIC. I assume that the picflag.m4
> replace the old configure.ac solution, no?

yeah, seems all the picflag logic has been consolidated in picflag.m4 in the gcc 
project.  i can send a patch there if you want.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Using -fPIC for libiberty on s390x
  2011-12-05 15:24     ` Mike Frysinger
@ 2011-12-05 15:36       ` Martin Schwidefsky
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Schwidefsky @ 2011-12-05 15:36 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils, Aurelien Jarno

[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]

On Mon, 5 Dec 2011 10:24:12 -0500
Mike Frysinger <vapier@gentoo.org> wrote:

> On Monday 05 December 2011 03:46:55 Martin Schwidefsky wrote:
> > On Mon, 5 Dec 2011 02:02:10 -0500 Mike Frysinger wrote:
> > > i've run into this issue on Gentoo systems and binutils-2.22.  but now
> > > with all the pic code being unified with gcc, we need to do:
> > > 
> > > --- a/config/picflag.m4
> > > +++ b/config/picflag.m4
> > > @@ -51,6 +51,9 @@ case "${$2}" in
> > >      m68k-*-*)
> > >  	$1=-fpic
> > >  	;;
> > > +    s390x*-*-*)
> > > +	$1=-fPIC
> > > +	;;
> > >      s390*-*-*)
> > >  	$1=-fpic
> > >  	;;
> > 
> > Whenever you see a R_390_GOT12 relocation truncated to fit, the correct
> > solution is to switch from -fpic to -fPIC. I assume that the picflag.m4
> > replace the old configure.ac solution, no?
> 
> yeah, seems all the picflag logic has been consolidated in picflag.m4 in the gcc 
> project.  i can send a patch there if you want.

Please do so.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-05 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-25  1:18 [PATCH] Using -fPIC for libiberty on s390x Aurelien Jarno
2011-12-05  6:03 ` Mike Frysinger
2011-12-05  8:47   ` Martin Schwidefsky
2011-12-05 15:24     ` Mike Frysinger
2011-12-05 15:36       ` Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).