openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] 64 bit libHalf - R_X86_64_32S _eLut and -fPIC questi


From: Paul Miller
Subject: Re: [Openexr-devel] 64 bit libHalf - R_X86_64_32S _eLut and -fPIC question
Date: Thu, 13 Mar 2008 19:17:26 -0500
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)

Ken McGaugh wrote:
On 14/03/2008, at 9:08 AM, Paul Miller wrote:
Bob Friesenhahn wrote:
On Thu, 13 Mar 2008, Paul Miller wrote:

Since fPIC is apparently *required* on x64 Linux, I was wondering why the configure script didn't automatically enable it for me. Is that a bug or a feature?
Normally PIC is used in shared libraries, and not in archive (.a) files. The only exception that I have heard of is AIX, which seems to use .a files as shared libraries. Perhaps you need to use --enable-shared to build shared libraries and use the shared libraries?

I didn't want to use shared libs because then I'd have a dependency problem and have to deal with -rpath and such. With all of my (non-system) dependencies built statically, I can basically plop my app (and its plugins) anywhere and it'll work without setting env vars, which is much nicer (I think).


You can still achieve that kind of portability while using shared libraries if you distribute the shared libraries with your app. All you have to do is tell the linker that the shared libraries are relative to the executable by using a combination of the "-z origin" linker option and using $ORIGIN in your rpath.

...

and pass "-z origin" to the linker to activate it. I've even distributed libstdc++ and libgcc_s with an app that way to reduce compiler version dependencies.

Hmm - I wasn't aware of the -z option. Cool, thanks!



--
Paul Miller | address@hidden | www.fxtech.com | Got Tivo?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]