Public bug reported:

Binary package hint: gcc-4.4

I'm trying to compile a very simple C library to examine how JNI
functions. The code in question comes from
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html
. I will attach the file nativelib.c, taken from that site.

When running the command:

gcc -o libnativelib.so -shared -Wl,-soname,libnative.so
-I/usr/lib/jvm/java-6-openjdk/include
-I/usr/lib/jvm/java-6-openjdk/include/linux nativelib.c -static -lc

gcc says:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.3/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.3/crtbeginT.o: could not read symbols: Bad 
value
collect2: ld returned 1 exit status

It looks like crtbeginT.o needs to be recompiled with -fPIC.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: gcc-4.4-base 4.4.3-4ubuntu5
ProcVersionSignature: Ubuntu 2.6.32-24.41-server 2.6.32.15+drm33.5
Uname: Linux 2.6.32-24-server x86_64
Architecture: amd64
Date: Thu Sep 16 12:27:58 2010
Dependencies:
 
InstallationMedia: Ubuntu-Server 10.04 LTS "Lucid Lynx" - Release amd64 
(20100427)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: gcc-4.4

** Affects: gcc-4.4 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug lucid

-- 
crtbeginT.o needs to be recompiled with -fPIC
https://bugs.launchpad.net/bugs/640734
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to