Subject: pkg/32691: security/p5-Crypt-DES Sun Solaris redeclaration: des_crypt
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <jakerosoft@gmail.com>
List: pkgsrc-bugs
Date: 02/01/2006 19:45:01
>Number:         32691
>Category:       pkg
>Synopsis:       security/p5-Crypt-DES Sun Solaris redeclaration: des_crypt
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 01 19:45:00 +0000 2006
>Originator:     Jake Kupersmith
>Release:        pkgsrc
>Organization:
>Environment:
SunOS 5.10 Generic_118822-25 sun4u sparc SUNW,Sun-Blade-100
>Description:
p5-Crypt-DES fails to compile under Sun Solaris 10 using the Sun Studio 11 compiler.  The problem is p5-Crypt-DES/des.h defines the function des_crypt while this function is already declared in /usr/include/crypt.h and included by perl in /lib/perl5/5.8.0/sparc-solaris-thread-multi/CORE/reentr.h.
>How-To-Repeat:
# cd /usr/pkgsrc/security/p5-Crypt-DES
# bmake
===> Building for p5-Crypt-DES-2.03nb2
cp DES.pm blib/lib/Crypt/DES.pm
/usr/local/bin/perl /usr/local/lib/perl5/5.8.0/ExtUtils/xsubpp  -typemap /usr/local/lib/perl5/5.8.0/ExtUtils/typemap -typemap typemap  DES.xs > DES.xsc && mv DES.xsc DES.c
cc -c    -D_REENTRANT -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -xtarget=ultra -xarch=v8plus -D__FUNCTION__=__func__ -I/usr/local/include   -I/usr/local/include    -DVERSION=\"2.03\"  -DXS_VERSION=\"2.03\" -KPIC "-I/usr/local/lib/perl5/5.8.0/sparc-solaris-thread-multi/CORE"   DES.c
"des.h", line 5: identifier redeclared: des_crypt
        current : function(pointer to unsigned char, pointer to unsigned char, pointer to unsigned long, int) returning void
        previous: function(pointer to const char, pointer to const char) returning pointer to char : "/usr/include/crypt.h", line 36
"DES.xs", line 39: warning: implicit function declaration: perl_des_expand_key
"DES.xs", line 70: warning: implicit function declaration: perl_des_crypt
cc: acomp failed for //.ccache/DES.tmp.schlitz.15195.i
*** Error code 2

Stop.
bmake: stopped in /var/db/work/security/p5-Crypt-DES/work/Crypt-DES-2.03
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/security/p5-Crypt-DES
===> 
===> There was an error during the ``build'' phase.
===> Please investigate the following for more information:
===>      * log of the build
===>      * /var/db/work/security/p5-Crypt-DES/work/.work.log
===> 
*** Error code 1

>Fix:
I temporarily patched /lib/perl5/5.8.0/sparc-solaris-thread-multi/CORE/reentr.h so it would not include crypt.h during the build...

root@schlitz /usr/local/lib/perl5/5.8.0/sparc-solaris-thread-multi/CORE
> diff -ub reentr.h.orig reentr.h
--- reentr.h.orig       Wed Feb  1 14:35:24 2006
+++ reentr.h    Wed Feb  1 14:35:50 2006
@@ -79,11 +79,13 @@
 #ifdef I_STDLIB
 #   include <stdlib.h> /* drand48_data */
 #endif
+/*
 #ifdef I_CRYPT
 #   ifdef I_CRYPT
 #       include <crypt.h>
 #   endif
 #endif
+*/
 #ifdef HAS_GETSPNAM_R
 #   ifdef I_SHADOW
 #       include <shadow.h>