Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Over 94,000 errors: 'ld: fatal: relocations remain against allocatable but non-writable '

5 views
Skip to first unread message

Dave

unread,
Jun 29, 2009, 11:15:55 AM6/29/09
to
I'm trying to compile some code with gcc 4,4,0 which uses the Sun linker
and assembler.

One bit is generating more than 94,000 error messages - see below. I've
seen reference to this sort of error before with the usual advice
'change to the GNU linker'. But I don't believe that is the best solution.

See code below - minus a few of the 94,000 + errors.

Anyone got any ideas what might cause his? (PAIR is a maths package for
number theory).

Building and install PARI
make[2]: Entering directory
`/tmp/tmp/sage-4.1.alpha2/spkg/build/pari-2.3.3.p0/src'
Making gp in Osolaris-none
make[3]: Entering directory
`/tmp/tmp/sage-4.1.alpha2/spkg/build/pari-2.3.3.p0/src/Osolaris-none'
../config/genkernel ../src/kernel/none/asm0.h > parilvl0.h
cat ../src/kernel/gmp/tune.h ../src/kernel/gmp/int.h
../src/kernel/none/level1.h > parilvl1.h
cat parilvl0.h parilvl1.h > pariinl.h
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -I../src/language
-I/tmp/tmp/sage-4.1.alpha2/local/include -o gp.o ../src/gp/gp.c
cd ../src/desc && /usr/bin/perl merge_822 ../functions/*/* >
def-solaris-none-20099.tmp
mv ../src/desc/def-solaris-none-20099.tmp ../src/desc/pari.desc
cd ../src/desc && /usr/bin/perl gen_proto gp pari.desc >
gp_init-solaris-none-20099.tmp
mv ../src/desc/gp_init-solaris-none-20099.tmp ../src/gp/gp_init.h
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -I../src/graph -o gp_init.o ../src/gp/gp_init.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -I../src/language
-I/tmp/tmp/sage-4.1.alpha2/local/include -o gp_rl.o ../src/gp/gp_rl.c
cd ../src/desc && /usr/bin/perl gen_proto highlevel pari.desc >
highlvl-solaris-none-20099.tmp
mv ../src/desc/highlvl-solaris-none-20099.tmp ../src/gp/highlvl.h
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -DDL_DFLT_NAME=NULL -o highlvl.o ../src/gp/highlvl.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o whatnow.o ../src/gp/whatnow.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -I../src/graph -o plotport.o ../src/graph/plotport.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o plotnull.o ../src/graph/plotnull.c
cat ../src/kernel/gmp/mp.c ../src/kernel/none/cmp.c
../src/kernel/none/gcdll.c ../src/kernel/none/ratlift.c
../src/kernel/none/invmod.c ../src/kernel/gmp/gcd.c
../src/kernel/none/mp_indep.c ../src/kernel/none/add.c > mp.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -I/tmp/tmp/sage-4.1.alpha2/local/include -o mp.o mp.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o mpinl.o ../src/kernel/none/mpinl.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o Flx.o ../src/basemath/Flx.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o Qfb.o ../src/basemath/Qfb.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o RgX.o ../src/basemath/RgX.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o alglin1.o ../src/basemath/alglin1.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o alglin2.o ../src/basemath/alglin2.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o arith1.o ../src/basemath/arith1.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o arith2.o ../src/basemath/arith2.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o base1.o ../src/basemath/base1.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o base2.o ../src/basemath/base2.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o base3.o ../src/basemath/base3.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o base4.o ../src/basemath/base4.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o base5.o ../src/basemath/base5.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o bibli1.o ../src/basemath/bibli1.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o bibli2.o ../src/basemath/bibli2.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o buch1.o ../src/basemath/buch1.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o buch2.o ../src/basemath/buch2.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o buch3.o ../src/basemath/buch3.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o buch4.o ../src/basemath/buch4.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o galconj.o ../src/basemath/galconj.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o gen1.o ../src/basemath/gen1.cgcc -c -O3 -Wall
-fno-strict-aliasing -fomit-frame-pointer -I. -I../src/headers -o
gen2.o ../src/basemath/gen2.cgcc -c -O3 -Wall -fno-strict-aliasing
-fomit-frame-pointer -I. -I../src/headers -o gen3.o
../src/basemath/gen3.cgcc -c -O3 -Wall -fno-strict-aliasing
-fomit-frame-pointer -I. -I../src/headers -o ifactor1.o
../src/basemath/ifactor1.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o perm.o ../src/basemath/perm.cgcc -c -O3 -Wall
-fno-strict-aliasing -fomit-frame-pointer -I. -I../src/headers -o
polarit1.o ../src/basemath/polarit1.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o polarit2.o ../src/basemath/polarit2.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o polarit3.o ../src/basemath/polarit3.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o rootpol.o ../src/basemath/rootpol.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o subcyclo.o ../src/basemath/subcyclo.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o subgroup.o ../src/basemath/subgroup.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o trans1.o ../src/basemath/trans1.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o trans2.o ../src/basemath/trans2.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o trans3.o ../src/basemath/trans3.c
cd ../src/desc && /usr/bin/perl gen_member pari.desc >
members-solaris-none-20099.tmp
mv ../src/desc/members-solaris-none-20099.tmp ../src/language/members.h
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o anal.o ../src/language/anal.cgcc -c -O3 -Wall
-fno-strict-aliasing -fomit-frame-pointer -I. -I../src/headers -o
compat.o ../src/language/compat.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o default.o ../src/language/default.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o errmsg.o ../src/language/errmsg.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o es.o ../src/language/es.c
cd ../src/desc && /usr/bin/perl gen_proto basic pari.desc >
init-solaris-none-20099.tmp
mv ../src/desc/init-solaris-none-20099.tmp ../src/language/init.h
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o init.o ../src/language/init.cgcc -c -O3 -Wall
-fno-strict-aliasing -fomit-frame-pointer -I. -I../src/headers -o
intnum.o ../src/language/intnum.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o members.o ../src/language/members.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o sumiter.o ../src/language/sumiter.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o aprcl.o ../src/modules/aprcl.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o elldata.o ../src/modules/elldata.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o elliptic.o ../src/modules/elliptic.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o galois.o ../src/modules/galois.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o groupid.o ../src/modules/groupid.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o kummer.o ../src/modules/kummer.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o mpqs.o ../src/modules/mpqs.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o nffactor.o ../src/modules/nffactor.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o part.o ../src/modules/part.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o stark.o ../src/modules/stark.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o subfield.o ../src/modules/subfield.c
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
-I../src/headers -o thue.o ../src/modules/thue.c
rm -f libpari-gmp.so.2.3.3
gcc -o libpari-gmp.so.2.3.3 -shared -O3 -Wall -fno-strict-aliasing
-fomit-frame-pointer -Wl,-G,-h,libpari-gmp.so.2 mp.o mpinl.o Flx.o
Qfb.o RgX.o alglin1.o alglin2.o arith1.o arith2.o base1.o base2.o
base3.o base4.o base5.o bibli1.o bibli2.o buch1.o buch2.o buch3.o
buch4.o galconj.o gen1.o gen2.o gen3.o ifactor1.o perm.o polarit1.o
polarit2.o polarit3.o rootpol.o subcyclo.o subgroup.o trans1.o trans2.o
trans3.o anal.o compat.o default.o errmsg.o es.o init.o intnum.o
members.o sumiter.o aprcl.o elldata.o elliptic.o galois.o groupid.o
kummer.o mpqs.o nffactor.o part.o stark.o subfield.o thue.o -lc -lm
-L/tmp/tmp/sage-4.1.alpha2/local/lib -lgmp
Text relocation remains referenced
against symbol offset in file
<unknown> 0x76c alglin2.o
<unknown> 0x770 alglin2.o
<unknown> 0x774 alglin2.o

<SNIP out over 94,000 errors>

__gmpn_mul_1 0xdea0 mp.o
__gmpn_mul_1 0xdf24 mp.o
__gmpn_mul_1 0xdfa8 mp.o
__gmpn_mul_1 0xe02c mp.o
__gmpn_mul_1 0xfa84 mp.o
__gmpn_mul_1 0xfb14 mp.o
__gmpn_mul_1 0xfd28 mp.o
__gmpn_mul_1 0xfdac mp.o
__gmpn_mul_1 0xfe2c mp.o
__gmpn_mul_1 0xfea8 mp.o
__gmpn_mul_1 0xff20 mp.o
__gmpn_mul_1 0xff98 mp.o
__gmpn_rshift 0x48f4 mp.o
__gmpn_rshift 0xe710 mp.o
__gmpn_rshift 0xec7c mp.o
__gmpn_gcd 0x9b2c mp.o
__gmpn_gcdext 0xbd90 mp.o
__gmpn_gcdext 0xcef4 mp.o
__gmpn_add_n 0xb888 mp.o
__gmpn_sub_n 0xb3d8 mp.o
__gmpn_mod_1 0x21dc mp.o
__gmpn_mod_1 0x9640 mp.o
__gmpn_mod_1 0xe220 mp.o
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
make[3]: *** [libpari-gmp.so.2.3.3] Error 1
make[3]: Leaving directory
`/tmp/tmp/sage-4.1.alpha2/spkg/build/pari-2.3.3.p0/src/Osolaris-none'
make[2]: *** [gp] Error 2
make[2]: Leaving directory
`/tmp/tmp/sage-4.1.alpha2/spkg/build/pari-2.3.3.p0/src'
Error building GP


--
I respectfully request that this message is not archived by companies as
unscrupulous as 'Experts Exchange' . In case you are unaware,
'Experts Exchange' take questions posted on the web and try to find
idiots stupid enough to pay for the answers, which were posted freely
by others. They are leeches.

Marc

unread,
Jun 29, 2009, 8:52:31 PM6/29/09
to
Dave wrote:

> gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
> -I../src/headers -o thue.o ../src/modules/thue.c

no -fPIC

> gcc -o libpari-gmp.so.2.3.3 -shared -O3 -Wall -fno-strict-aliasing
> -fomit-frame-pointer -Wl,-G,-h,libpari-gmp.so.2 mp.o mpinl.o Flx.o
> Qfb.o RgX.o alglin1.o alglin2.o arith1.o arith2.o base1.o base2.o
> base3.o base4.o base5.o bibli1.o bibli2.o buch1.o buch2.o buch3.o
> buch4.o galconj.o gen1.o gen2.o gen3.o ifactor1.o perm.o polarit1.o
> polarit2.o polarit3.o rootpol.o subcyclo.o subgroup.o trans1.o trans2.o
> trans3.o anal.o compat.o default.o errmsg.o es.o init.o intnum.o
> members.o sumiter.o aprcl.o elldata.o elliptic.o galois.o groupid.o
> kummer.o mpqs.o nffactor.o part.o stark.o subfield.o thue.o -lc -lm
> -L/tmp/tmp/sage-4.1.alpha2/local/lib -lgmp

shared library

> Text relocation remains referenced
> against symbol offset in file

consequence

GNU ld would have helped in that its error message actually says: "please
recompile with -fPIC".

Dave

unread,
Jun 29, 2009, 9:52:38 PM6/29/09
to
Marc wrote:
> Dave wrote:
>
>> gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
>> -I../src/headers -o thue.o ../src/modules/thue.c
>
> no -fPIC

Thank you. Should that be included in all platforms, or just Solaris?

The odd thing is, this built fine on my Blade 2000, without any errors.
It also builds on linux and OS X.

On a Sun T5240 (16 cores) it fails. I'm surprised it builds on any
platform if its missing a flag, but I'll certainly try adding it.

>> gcc -o libpari-gmp.so.2.3.3 -shared -O3 -Wall -fno-strict-aliasing
>> -fomit-frame-pointer -Wl,-G,-h,libpari-gmp.so.2 mp.o mpinl.o Flx.o
>> Qfb.o RgX.o alglin1.o alglin2.o arith1.o arith2.o base1.o base2.o
>> base3.o base4.o base5.o bibli1.o bibli2.o buch1.o buch2.o buch3.o
>> buch4.o galconj.o gen1.o gen2.o gen3.o ifactor1.o perm.o polarit1.o
>> polarit2.o polarit3.o rootpol.o subcyclo.o subgroup.o trans1.o trans2.o
>> trans3.o anal.o compat.o default.o errmsg.o es.o init.o intnum.o
>> members.o sumiter.o aprcl.o elldata.o elliptic.o galois.o groupid.o
>> kummer.o mpqs.o nffactor.o part.o stark.o subfield.o thue.o -lc -lm
>> -L/tmp/tmp/sage-4.1.alpha2/local/lib -lgmp
>
> shared library
>
>> Text relocation remains referenced
>> against symbol offset in file
>
> consequence
>
> GNU ld would have helped in that its error message actually says: "please
> recompile with -fPIC".

--

Marc

unread,
Jun 30, 2009, 12:58:19 AM6/30/09
to
Dave wrote:

> Marc wrote:
>> Dave wrote:
>>
>>> gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
>>> -I../src/headers -o thue.o ../src/modules/thue.c
>>
>> no -fPIC
>
> Thank you. Should that be included in all platforms, or just Solaris?

All platforms where you want a shared library I guess (note: -fpic may be
faster on sparc, unless it prints a message saying that it doesn't work
and you should retry with -fPIC). The option has a different name on
other compilers though (-KPIC for instance).

> The odd thing is, this built fine on my Blade 2000, without any errors.
> It also builds on linux and OS X.

Maybe the configure script behaves differently for those and adds -fPIC
or doesn't build a shared library. On some architectures things may
sometimes work without -fPIC.

Dave

unread,
Jun 30, 2009, 7:29:17 AM6/30/09
to
Marc wrote:
> Dave wrote:
>
>> Marc wrote:
>>> Dave wrote:
>>>
>>>> gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -I.
>>>> -I../src/headers -o thue.o ../src/modules/thue.c
>>> no -fPIC
>> Thank you. Should that be included in all platforms, or just Solaris?
>
> All platforms where you want a shared library I guess (note: -fpic may be
> faster on sparc, unless it prints a message saying that it doesn't work
> and you should retry with -fPIC). The option has a different name on
> other compilers though (-KPIC for instance).

Thank you for your help Marc. You solved my problem of more than 94,000
error messages.

I've been told by someone else "Note that if you pass -fPIC on OSX, then
you'll get a big ugly warning every time gcc compiles a file, since on
OSX *all* code is PIC."

>> The odd thing is, this built fine on my Blade 2000, without any errors.
>> It also builds on linux and OS X.
>
> Maybe the configure script behaves differently for those and adds -fPIC
> or doesn't build a shared library. On some architectures things may
> sometimes work without -fPIC.

As I say, OS X I can understand. Linux is odd, since it is not added on
there. Someone *attempted* to add it on Solaris, but failed, as a bit of
a script says

# PARI doesn't set PIC correctly on Solaris, so we do this.
if [ `uname` = "SunOS" ]; then
CFLAGS=$CFLAGS" -fPIC"
export CFLAGS
fi

But I don't think CFLAGS is set in the Makefile, and ignores what might
have been set elsewhere.

Anyway, thank you very much for your help.

Dave

unread,
Jun 30, 2009, 10:39:32 AM6/30/09
to


BTW, your contribution has been acknowledged in the Sage project

http://sagetrac.org/sage_trac/ticket/6445

0 new messages