23 Jul 2011 12:51
[PATCH] Using -fPIC for libiberty on s390x
Aurelien Jarno <aurelien <at> aurel32.net>
2011-07-23 10:51:53 GMT
2011-07-23 10:51:53 GMT
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 <at> <at> 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 <at> aurel32.net>
* configure.ac: Use -fPIC instead of -fpic on s390x.
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
<at> <at> -216,6 +216,7 <at> <at>
*-fpic* ) PICFLAG=-fpic ;;
* ) PICFLAG=-fPIC ;;
esac ;;
+ s390x*-*-*) PICFLAG=-fPIC ;;
s390*-*-*) PICFLAG=-fpic ;;
sh*-*-*) PICFLAG=-fPIC ;;
esac
--
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien <at> aurel32.net http://www.aurel32.net
RSS Feed