This is a discussion on Re: Freebsd Port of SA 3.2.1 - SpamAssassin ; > > > I am using FBSD-6.2 amd64 and ran into this problem when running make: > > > .... bunch of other stuff all okay > > > stopped here: > > > Manifying blib/man3/Mail::SpamAssassin::Plugin::RelayCountry.3 > > > make ...
> > > I am using FBSD-6.2 amd64 and ran into this problem when running make:
> > > .... bunch of other stuff all okay
> > > stopped here:
> > > Manifying blib/man3/Mail::SpamAssassin::Plugin::RelayCountry.3
> > > make -f spamc/Makefile spamc/libspamc.so
> > > gcc -Wl,-R/usr/local/lib/perl5/5.8.8/mach/CORE spamc/libspamc.c
> > > spamc/utils.c -o spamc/libspamc.so -shared -L/usr/local/lib -lz
> > > /usr/bin/ld: /var/tmp//cchaPM1S.o: relocation R_X86_64_32 can not be
> > > used when making a shared object; recompile with -fPIC
> > > /var/tmp//cchaPM1S.o: could not read symbols: Bad value
> >
> > looks like a 64bit compile error.
>
> It is not a compile error. Somebody forgot to put a -fPIC option
> when compiling code for a shareable library.
> It happens to work on i386, but is wrong anyway.
>
> > +.if ${ARCH} == "i386"
> > +.endif
> Please don't do that!
Both of the following cc commands need option -fPIC in order
to be able to build a shareable library:
gcc -fPIC -Wl,-R/usr/local/lib/perl5/5.8.8/mach/CORE spamc/libspamc.c
spamc/utils.c -o spamc/libspamc.so -shared -L/usr/local/lib -lz
gcc -fPIC -DSPAMC_SSL -Wl,-R/usr/local/lib/perl5/5.8.8/mach/CORE
spamc/libspamc.c spamc/utils.c -o spamc/libsslspamc.so
-shared -L/usr/local/lib -lssl -lcrypto -lz
This way it will build on any architecture, not just on Intel in 32-bit mode.
This seem to be a SpamAssassin issue, and is not specific to FreeBSD ports.
Mark