INN and Perl5.8

Phil Pennock pdp at
Wed Aug 11 11:37:03 PDT 2004


[ not subscribed to this list so please Cc any replies to me ]

In January, Ying-Chieh Liao posted about a problem with building INN;

I just experienced the same problem.  I spent a while scratching my head
before finding the solution; since Google didn't help first, I'm posting
this here in the hope that others might find it and be helped.

The basic problem is that on FreeBSD 4.x, with Perl 5.8 installed and
"use.perl port" run, news/inn-stable fails to build, with linker errors.

-----------------------------< cut here >-------------------------------
cc -rpath=/usr/lib:/usr/local/lib  -o nnrpd article.o cache.o group.o commands.o line.o list.o misc.o newnews.o nnrpd.o perl.o perm.o post.o python.o sasl_config.o tls.o track.o /usr/ports/news/inn-stable/work/inn-STABLE-20040707/history/libinnhist.a /usr/ports/news/inn-stable/work/inn-STABLE-20040707/storage/libstorage.a /usr/ports/news/inn-stable/work/inn-STABLE-20040707/lib/libinn.a    -L/usr/lib -lssl -lcrypto  /usr/ports/news/inn-stable/work/inn-STABLE-20040707/lib/perl.o -Wl,-R/usr/local/lib/perl5/5.8.5/mach/CORE -Wl,-E  -L/usr/local/lib /usr/local/lib/perl5/5.8.5/mach/auto/DynaLoader/DynaLoader.a -L/usr/local/lib/perl5/5.8.5/mach/CORE -lperl -lm -lcrypt -lutil
perl.o: In function `HandleHeaders':
perl.o(.text+0x4b): undefined reference to `Perl_get_hv'
perl.o(.text+0x16d): undefined reference to `Perl_get_sv'
[... many more, for both perl.o objects being linked in ...]
-----------------------------< cut here >-------------------------------

nm(1) shows that the relevant symbols _are_ in

But ... they're _not_ in /usr/lib/ which remains earlier in
the linker path.  Sheesh, I like FreeBSD 5's approach of letting you
choose which one to install, so there's no contamination like this left

If you're brave:

rm /usr/lib/libperl*
cd /usr/bin
rm a2p perl5 perl5.00503 sperl5 sperl5.00503 perlbug perlcc perldoc
[ perl is a symlink to the perl5.8.x binary, but I don't remember now if
  I did that and don't want to dig out the reinstall notes ]

And then wander your bin dirs looking for other programs that need to be
removed; if you're not so brave (or foolhardy) then just mv the files
somewhere out of the way.  I used:
 for f in *; do ldd $f 2>&1 | fgrep libperl && print $f; done
in each, on the basis that I could see linkage success or failure
followed by the program name.  (Well, actually I used *(.) to only match
files, but that's a zsh-ism).

Despite having installed Perl5.8 automatically at install time, it looks
like not removing all traces of the system perl really is a mistake,
since other ports can pick up the old library too; it looks like
net-snmp did, for instance (two binaries in /usr/local/sbin).

I hope this helps someone,
Phil Pennock,       Senior Systems Administrator,      Demon Netherlands
NL Sales: +31 20 422 20 00      Thus Plc      NL Support: 0800 33 6666 8

More information about the freebsd-ports mailing list