On Wed, Apr 22, 2009 at 4:53 PM, Andrew Haley <aph@xxxxxxxxxx> wrote: >> I would reverse the sense of this: non PIC shared libraries does work on >> most processors (with some loss of efficiency), but not on x86_64 >> because it uses a small model by default. It might work if you use >> -mcmodel=large, but I haven't tried this. > > It might well, but I would question the point. Presumably the OP wants > non-PIC for performance's sake, but I wouldn't have thought he's going > to get it from the large model. Benchmarks would be interesting. I did get some of the performance improvement I was after, at least on my reference microbenchmark (which, I hope, is at least partly representative of my target application): -O3 -fpic: a=1.70445e+06 packets/s b=3.4965e+06 packets/s c=2.20897e+06 packets/s d=894214 packets/s -O3 -mcmodel=large: a=1.96967e+06 packets/s b=3.77216e+06 packets/s c=2.45881e+06 packets/s d=1.07423e+06 packets/s -O3 [static link in final executable]: a=2.12857e+06 packets/s b=4.26076e+06 packets/s c=2.77546e+06 packets/s d=1.27861e+06 packets/s So, a full static link is best, but -mcmodel=large is still better than -fpic. I wonder if I am not going to ditch -fpic builds altogether. Mathieu -- Mathieu Lacage <mathieu.lacage@xxxxxxxxx>