Hi, I am getting the same error while trying to compile JNI lib. I compiled very similar library before on Ubuntu 9.04 32bit without any problems.
gcc -o libparportaccessor.so -shared -Wl,-soname,libparportaccessor.so -I/home/lukas/jdk1.6.0_22/include -I/home/lukas/jdk1.6.0_22/include/linux net_zarubsys_parporttester_io_ParallelPortAccessor_linux.c -static -lc /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbeginT.o: relocation R_X86_64_32 against `__DTOR_END__' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbeginT.o: could not read symbols: Bad value collect2: ld returned 1 exit status Ubuntu 10.10 amd64 (Lenovo W510 - core i7) gcc -v output: Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) Thanks for any solution. Best Lukas Zaruba ** Attachment added: "Library source" https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/640734/+attachment/2103117/+files/net_zarubsys_parporttester_io_ParallelPortAccessor_linux.c -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/640734 Title: crtbeginT.o needs to be recompiled with -fPIC -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
