[Bug 640734] Re: crtbeginT.o needs to be recompiled with -fPIC

Stanislav stanislav.r2 at gmail.com
Mon Aug 24 16:06:09 UTC 2015


I was compiling one custom library today and found that exactly this bug still exist in:
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
OS: Ubuntu 12.04.5 LTS x86_64
Codename:	precise

Is somebody going to fix it 5 years after discovery?

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-4.4 in Ubuntu.
https://bugs.launchpad.net/bugs/640734

Title:
  crtbeginT.o needs to be recompiled with -fPIC

Status in gcc-4.4 package in Ubuntu:
  Confirmed

Bug description:
  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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/640734/+subscriptions



More information about the foundations-bugs mailing list