Re: Patch for building Python libs under Linux x64 (fixed on Ubuntu 10)
Mike Ivanov <[email protected]>
| Newsgroups | gmane.comp.encryption.cryptlib |
|---|---|
| Organization | ActiveState |
| Message-ID | <[email protected]> |
On 10-08-05 12:55 AM, Peter Gutmann wrote: > Justin Hendren<[email protected]> writes: > > >> Hello all, just dropping this email to inform about a bug I found when >> building the Python libraries under Ubuntu (linux 2.6.32-24 x86_64) on a x64 >> system (Intel i5). After a little research, I found that this will more than >> likely also affect other linux distributions if not patched. >> >> --- ccopts.sh 2009-07-15 18:06:50.000000000 -0400 >> +++ ccopts.sh 2010-07-29 22:56:02.909399364 -0400 >> @@ -293,7 +293,7 @@ >> if [ "$GCC_VER" -ge 30 ] ; then >> case $ARCH in >> 'x86_64') >> - CCARGS="$CCARGS -march=opteron" ;; >> + CCARGS="$CCARGS -march=opteron -fPIC" ;; >> >> 'i686') >> CCARGS="$CCARGS -march=pentiumpro" ;; >> > Does anyone else have any thoughts on the effect that this could have in other > environments? This seems to be a special case for use of a static lib linked > into a surrounding shared lib... also -fPIC has an (unspecified) performance > overhead over -fpic and is supposedly only necessary for non-x86 systems due > to limits on the global offset table size on non-x86 CPUs. Does it also work > when you use -fpic? Is -fpic required for the 32-bit version as well or just > the 64-bit one? > > >> Hope this helps someone! Also, I hope this would be patched into the source >> release, unless there is a better solution to be had (the shared lib build >> might require the -fpic, but I'm not sure). >> > This is a change that'll affect all builds on x86 systems, so I'd like to make > sure it won't cause problems elsewhere if it's enabled before I put it in the > release AFAIK -fpic and -fPIC are identical on both i386 and x86_64 -- the most popular platforms. So, -fPIC won't hurt anyone there. On m86k and SPARC their behaviour is different. Given the size of the library I personally would rather always compile with -fPIC on these platforms. The conclusion is, -fPIC is the most reliable and safest option, though it adds some load-time overhead on certain platforms. Mike _______________________________________________ Cryptlib mailing list [email protected] via Mail: [email protected] Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/ http://news.gmane.org/gmane.comp.encryption.cryptlib Posts from non-subscribed addresses are blocked to prevent spam, please subscribe in order to post messages.