[colug-432] linker is being PICky

Rick Troth rmt at casita.net
Mon Jun 29 11:44:36 EDT 2015

Thanks for the reply and for the tip.

On 06/29/2015 09:51 AM, Jeff Frontz wrote:
> I can't remember the x86 addressing modes (or their implementations), 
> but relative-mode addressing can add overhead in some architectures. 
>  Take a peek at
> http://stackoverflow.com/questions/813980/why-isnt-all-code-compiled-position-independent

I was surprised that one build w/o -fPIC appeared to be bigger in size
then the same build with -fPIC. Would expect PIC support to increase the
size, not shrink it. (Or maybe I was cross-eyed.) Did not compare
performance of the two.

The above link, and a wikipedia page it led to, give me some good clues.

> As to knowing if -fPIC is needed -- that's not known 
>  until you try to build the dependent, right?

Sure, but autoconf/automake discovers things like that by trying a
number of small compiles. Kind of ASSumed this would be covered too.

I stick with the standard recipe as closely as possible. Over the years,
I have collected over 150 packages that I can quickly re-build from the
latest sources. I actively maintain probably half of these, as needed.
Usually the './configure' step figures everything out, so it's easily
automated. Exporting CFLAGS="-fPIC" before that step is my current
work-around. Not elegant.

I have a lot to learn.

-- R; <><

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.colug.net/pipermail/colug-432/attachments/20150629/ea7fe671/attachment.html 

More information about the colug-432 mailing list