Bug 21804

Summary: The lack of -lcrypt in Perl's Config.pm breaks Perl extension building.
Product: Base System Reporter: Anton Berezin <tobez>
Component: confAssignee: Anton Berezin <tobez>
Status: Closed FIXED    
Severity: Affects Only Me CC: markm
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Anton Berezin 2000-10-07 02:30:00 UTC
Config.pm bundled with FreeBSD's Perl does not have a `-lcrypt' in its
linking-related variables.  Under certain conditions, this may break the
build of Perl extensions.

See the `How-To-Repeat' section for self-explanatory example, and the
`Fix' section for a patch and a workaround.

Fix: Apply the following patch and rebuild the system.  As a quick fix for
impatient, edit two files (they are identical):

/usr/libdata/perl/5.6.0/mach/Config.pm
/usr/libdata/perl/5.6.0/Config.pm

and add -lcrypt to lddlflags and to ldflags.

This patch is relative to /usr/src/gnu/usr.bin/perl/libperl, and is only
tested on i386, non-threaded perl.
How-To-Repeat: 
$ mkdir perlbug ; cd perlbug
$ cat >Makefile.PL
use ExtUtils::MakeMaker;
WriteMakefile( NAME => 'Bla', PREREQ_PM => {},
               EXE_FILES => ["./bin/foo"]);
^D
$ mkdir bin ; cat >bin/foo.c
int main(){}
^D
$ perl Makefile.PL
Writing Makefile for Bla
$ make
mkdir blib
mkdir blib/lib
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/Bla
mkdir blib/lib/auto/Bla
mkdir blib/man1
cc -O -pipe -Wl,-E -lperl -lm ./bin/foo.c  -o ./bin/foo
/usr/lib/libperl.so: undefined reference to `crypt'
*** Error code 1

Stop in /usr/home/tobez/tmp/perlbug.
Comment 1 Johan Karlsson freebsd_committer freebsd_triage 2000-10-07 16:40:55 UTC
Responsible Changed
From-To: freebsd-bugs->markm

Over to perl maintainer.
Comment 2 Mark Murray freebsd_committer freebsd_triage 2001-06-13 21:20:11 UTC
Responsible Changed
From-To: markm->tobez

Originator of the PR, and is now the committer who is going to fix it.
Comment 3 Anton Berezin freebsd_committer freebsd_triage 2001-06-13 21:38:46 UTC
State Changed
From-To: open->closed

The fix in the PR, slightly modified due to the removal of threaded perl 
in -current, committed.