Subject: Re: Question about mail/cyrus-imap (Long Message)
To: Sean J. Schluntz <>
From: Johnny Lam <>
List: tech-pkg
Date: 04/05/2002 06:38:29
On Thu, Apr 04, 2002 at 12:31:29PM -0800, Sean J. Schluntz wrote:
> >This is possibly a problem with perl and not with cyrus.  Are you able to
> >dynamically load other perl modules?  Also, is it possible for you to provide
> >a log of a "make build" in mail/cyrus-imapd?  I'd like to check how certain
> >bits of Cyrus are compiled and built on your sparc.
> The information is below, but here is a strangeness I ran in to during
> the build.  It complained that Perl and the config package did not agree
> on the platform, but here is what the error reported:
> Your perl and your seem to have different ideas about the architecturethey are running on.
> Perl thinks: [sparc-netbsd]
> Config says: [sparc-netbsd]
> Those look the same to me, so I don't know what was causing the error.

You can safely ignore this.  This is caused by buildlink magic, and is
harmless since it does the right thing in the end.

> I build Mail-Sendmail-0.78 from CPAN and attempted to call it from a script
> on the same system, make test worked and sent mail w/o issues.  So it does
> appear that the Perl package can use modules. I don't have any other code I
> can use to test and see if Perl can load .so files though, and that could
> be a different matter.

This is good to know, as it doesn't sound like a perl problem.  I think the
problem is that it may be that libcyrus.a is built from object files that
aren't compiled with -fPIC and hence aren't shareable, but that it is linked
into the Cyrus/IMAP/ shared object.  Clearly, this would be wrong,
and hopefully, this will be borne out in your build log.

> Here is the output of a `make build` on my system, after a make clean.
> (long output)
> [...]
> cc -c -I.. -I/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/include/db3 -I/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/include  -I/usr/include/krb5 -I/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/include -I/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/include -I/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/include -DHAVE_CONFIG_H -I. -I. -I/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/include -O2  cyrusdb_flat.c
> rm -f libcyrus.a
> ar cr libcyrus.a acl.o assert.o bsearch.o charset.o glob.o retry.o util.o  mkgmtime.o prot.o parseaddr.o imclient.o imparse.o xmalloc.o  lsort.o stristr.o hash.o  chartable.o imapurl.o nonblock_fcntl.o lock_flock.o  gmtoff_tm.o map_nommap.o acl_afs.o auth_unix.o  cyrusdb_db3.o cyrusdb_flat.o
> ranlib libcyrus.a
> [...]
> /usr/pkg/bin/perl -I/usr/pkg/lib/perl5/5.6.1/sparc-netbsd -I/usr/pkg/lib/perl5/5.6.1 /usr/pkg/lib/perl5/5.6.1/ExtUtils/xsubpp  -typemap /usr/pkg/lib/perl5/5.6.1/ExtUtils/typemap -typemap typemap IMAP.xs > IMAP.xsc && mv IMAP.xsc IMAP.c
> cc -c -I../../lib -I/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/include -fno-strict-aliasing -I/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/include -I/usr/include/krb5 -O2    -DVERSION=\"1.00\"  -DXS_VERSION=\"1.00\" -DPIC -fPIC -I/usr/pkg/lib/perl5/5.6.1/sparc-netbsd/CORE -DPERL_POLLUTE IMAP.c
> Running Mkbootstrap for Cyrus::IMAP ()
> chmod 644
> rm -f blib/arch/auto/Cyrus/IMAP/
> LD_RUN_PATH="/usr/pkgsrc/mail/cyrus-imapd/work/cyrus-imapd-2.0.16/perl/imap/../../lib:/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/lib" cc  --whole-archive -shared  -Wl,-R/usr/pkg/lib -L/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/lib IMAP.o  -o blib/arch/auto/Cyrus/IMAP/   -L/usr/pkg/lib/perl5/5.6.1/sparc-netbsd/CORE -Wl,-R/usr/pkg/lib/perl5/5.6.1/sparc-netbsd/CORE -lperl -L/usr/pkgsrc/mail/cyrus-imapd/work/cyrus-imapd-2.0.16/perl/imap/../../lib -lcyrus -L/usr/pkgsrc/mail/cyrus-imapd/work/.buildlink/lib -lsasl -lssl -lcrypto  

Yup, the situation I described is happening here.  Can you try rebuilding
cyrus-imapd after adding CFLAGS+=-fPIC to cyrus-imapd/Makefile, and then
testing whether cyradm works?


	-- Johnny Lam <>