Compiling Cyrus IMAPD on AMD Opteron

Igor Brezac igor at ipass.net
Fri Jun 13 10:48:01 EDT 2003


On Fri, 13 Jun 2003, Henrique de Moraes Holschuh wrote:

> On Fri, 13 Jun 2003, curtis at oushi.org wrote:
> > Compiling with the -fPIC fixes the problem.  I had to do this for the
> > following: imclient.c imparse.c xmalloc.c imapurl.c iptostring.c assert.c
> > util.c libisieve.c prot.c
> >
> > Why does -fPIC fix this problem?
>
> Because of either:
>   1.  AMD64 is unforgiving of non-PIC code mixed with PIC code where it
>       shouldn't be (libraries)
>   2.  Compiler bugs.
>
> Anything that goes inside a lib should be -fPIC. Really. I have done this in
> the Debian build (which runs OK in S/390, IA64, Alpha, MIPS, MIPS-EL...)
> ages ago. I don't know if these changes are in CMU Cyrus.

This in true only for shared libs unless you are trying to link an
archive into a shared lib (which can be the case with perl modules).

Position independent code adds some overhead.  I think CMU folks like to
build things static as much as possible for performance reasons.

> I don't think the Cyrus build uses --shared, but I didn't check.
>
> > >>../../lib/libcyrus.a(imclient.o): relocation R_X86_64_32 can not be used
> > >>when making a shared object; recompile with -fPIC
>
> Yep. Arch dislikes mixing PIC and non-PIC code inside a relocatable object.

Correct.  On Solaris, I build lib/ and perl/sieve/lib with -fPIC just to
build cyrus-imap perl stuff.

-- 
Igor




More information about the Info-cyrus mailing list