| View previous topic :: View next topic |
| Author |
Message |
todd
Joined: 04 Nov 2004 Posts: 2
|
Posted: Thu Nov 04, 2004 3:07 pm Post subject: Linking a shared object with static libraries for RPM/64-bit |
|
|
Hello -
I'd like to provide a Linux RPM for the x86_64 (64-bit) architecture for the software I'm working on. The Portland compilers work great when compiling for source - but for the RPM I need to be able to create a shared object that is statically linked with Portland libraries (i.e. libpgc.a) so that users don't need libpgc.so on their system.
The current error I get when I try to link directly with libpgc.a is
/usr/bin/ld: /usr/local/pgi/linux86-64/5.2/lib/libpgc.a(va_arg.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
Is there a way to get the static pgcc libraries compiled with fPIC? Or any other advice on how I can link the static libraries with my shared object? I can't use the portability package since it is not yet available for 64-bit architectures.
Thanks in advance.
Todd |
|
| Back to top |
|
 |
slaton
Joined: 11 Oct 2004 Posts: 7
|
Posted: Thu Nov 04, 2004 6:19 pm Post subject: |
|
|
| I have this same problem. I am unable to build 64-bit shared libraries on x86_64 platform. In all (three) of the cases i've tried, it's been a GPL licensed package configured with libtool. Are you using GNU libtool, automake, etc? There seems to be a problem with libtool and x86_64. |
|
| Back to top |
|
 |
todd
Joined: 04 Nov 2004 Posts: 2
|
Posted: Fri Nov 05, 2004 10:07 am Post subject: |
|
|
| I am using libtool/automake. I was able to create a shared library when I used the pgcc shared objects (libpgc.so, etc), but not when linking with the static ones necessary for RPM. |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Fri Nov 05, 2004 12:06 pm Post subject: |
|
|
Hi Todd,
In the small memory model, this should work. However, the relocation error your getting is because your using the medium memory model (-mcmodel=medium). Currently you cannot statically link objects using the medium memory model. (See the PGI release notes http://www.pgroup.com/support/new_rel.htm for more information)
Unfortunately, you'll need to include libpgc.so. The good news however, is that there is only one version for all x86_64 systems (and why there isn't a portability package), so you can redistribute the version you have.
Hope this helped!
Mat |
|
| Back to top |
|
 |
|