発生するエラー:
/usr/bin/ld:
/home/yoshito/src/satellite-4.2.3/modules/ncs/lib/common/libncsc.a(scf.o):
relocation R_X86_64_32 against `a local symbol' can not
be used when making a shared object; recompile with -fPIC
/home/yoshito/src/satellite-4.2.3/modules/ncs/lib/common/libncsc.a:
could not read symbols: Bad value
collect2: ld returned 1 exit status
確認した環境:
Ubuntu Linux 6.06(LTS) AMD64
gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
automake (GNU automake) 1.4-p6
GNU Make 3.81beta4
libc6 2.3.6-0ubuntu20
shared libraryを作成する際に必要な-fPIC オプションが落
ちていることが原因かもしれません。
行った作業:
./configure
make
発生する場所:
libs/mod_ncs.so
のコンパイル中。最後は
g++ -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/crtbeginS.o
.libs/setup.o .libs/nmake.o .libs/nlink.o .libs/npp.o
.libs/ne.o .libs/nstim-pmatch.o .libs/nstim-input.o
.libs/nstim-numget.o .libs/nstim.o .libs/screen.o
.libs/nlist.o .libs/nsclst.o .libs/ncal.o .libs/nout.o
.libs/nasgn.o .libs/ndelay.o .libs/nerase.o
.libs/ngetp.o .libs/ninteg.o .libs/npara.o
.libs/ntime.o .libs/nchgbuff.o -Wl,--rpath
-Wl,/home/yoshito/src/satellite-4.2.3/lib/common/.libs
-Wl,--rpath -Wl,/usr/local/satellite4/lib -pthread
-L/home/yoshito/src/satellite-4.2.3/modules/ncs/lib/common
-lncsc ../../../lib/common/.libs/libsatellite.so
-lpthread -ldl -L/usr/lib/gcc/x86_64-linux-gnu/4.0.3
-L/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../lib64
-L/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../..
-L/lib/../lib64 -L/usr/lib/../lib64 -lstdc++ -lm -lc
-lgcc_s /usr/lib/gcc/x86_64-linux-gnu/4.0.3/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/4.0.3/../../../../lib64/crtn.o
-pthread -pthread -pthread -Wl,-soname -Wl,mod_ncs.so
-o .libs/mod_ncs.so
です。
発生するエラー:
/usr/bin/ld:
/home/yoshito/src/satellite-4.2.3/modules/ncs/lib/common/libncsc.a(scf.o):
relocation R_X86_64_32 against `a local symbol' can not
be used when making a shared object; recompile with -fPIC
/home/yoshito/src/satellite-4.2.3/modules/ncs/lib/common/libncsc.a:
could not read symbols: Bad value
collect2: ld returned 1 exit status
確認した環境:
Ubuntu Linux 6.06(LTS) AMD64
gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
automake (GNU automake) 1.4-p6
GNU Make 3.81beta4
libc6 2.3.6-0ubuntu20