This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] _GCC_PICFLAG: use -fPIC for s390x targets
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: gcc-patches at gcc dot gnu dot org, s390 at gentoo dot org, Aurelien Jarno <aurelien at aurel32 dot net>, Martin Schwidefsky <schwidefsky at de dot ibm dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, Andreas Krebbel <Andreas dot Krebbel at de dot ibm dot com>
- Date: Wed, 07 Dec 2011 10:33:54 +0100
- Subject: Re: [PATCH] _GCC_PICFLAG: use -fPIC for s390x targets
- References: <1323228983-27811-1-git-send-email-vapier@gentoo.org>
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.
>
> 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.
> ---
> config/picflag.m4 | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/config/picflag.m4 b/config/picflag.m4
> index f6f1b44..db2ce0f 100644
> --- a/config/picflag.m4
> +++ b/config/picflag.m4
> @@ -51,6 +51,9 @@ case "${$2}" in
> m68k-*-*)
> $1=-fpic
> ;;
> + s390x*-*-*)
> + $1=-fpic
> + ;;
This doesn't match the ChangeLog/description, and certainly needs an
explanation.
> s390*-*-*)
> $1=-fpic
> ;;
Perhaps it's better to remove both s390* cases and use the -fPIC default
everywhere, as does libtool. picflag.m4 is supposed to be usable
everywhere.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University