Skip Menu |

This queue is for tickets about the Crypt-DES CPAN distribution.

Report information
The Basics
Id: 1310
Status: resolved
Priority: 0/
Queue: Crypt-DES

People
Owner: DPARIS [...] cpan.org
Requestors: smcc [...] CSUA.Berkeley.EDU
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.03
Fixed in: (no value)



Subject: Solaris8 / perl5.8 build
Crypt::DES didn't compile out of the box for me on a Solaris 8 system with the new perl 5.8.0, since Perl's headers include the system crypt.h, which on Solaris defines its own des_crypt function with a different prototype that the one in des.h. The usual sort of CPP hack fixed it. [patch attached] An alterative possibility would be to rename the "des_crypt" function to something less common.
Download patch
application/octet-stream 426b

Message body not shown because it is not plain text.

while the principle of the patch makes sense, the execution doesn't since it would break non-solaris installations. also, you don't say what compiler you're using. that would help tremendously since I don't recall gcc having this problem on Solaris 2.51/2.6/7/8. -dsp
From: smcc [...] mit.edu
[DPARIS - Sat Jan 18 22:21:52 2003]: Show quoted text
> while the principle of the patch makes sense, the execution doesn't > since it would break non-solaris installations.
Really, how? It seems to work OK on Linux. Note that the scope of the #ifdef ... #undef is only Perl's headers (and any standard headers they include), so it only has any effect when the standard headers included by Perl define a "des_crypt" symbol. I agree that the patch I suggested is pretty ugly, though. I'd be happy with any way the problem got fixed. A perhaps better solution would be to rename your "des_crypt" to something else. Show quoted text
> also, you don't say what compiler you're using. that would help > tremendously since I don't recall gcc having this problem on Solaris > 2.51/2.6/7/8.
Hmm. I'm not sure what's different between our installations that causes me to have the problem. I'm seeing this with GCC 3.0.4, but I would think you get the same /usr/include/crypt.h no matter what compiler you're using. I've attached the output of "perl -V" for the version of Perl I had trouble with.
Download perl-V
application/octet-stream 3.7k

Message body not shown because it is not plain text.

As the other guest, I currently have this same issue with Solaris 8, perl5.8, gcc 2.95.2.
From: cory.omand [...] Sun.com
I had a similar problem with Perl 5.8.2 under Solaris 9 using the SunONE 8 compiler collection. The attached patch fixed it for me --
diff -Nru --minimal --speed-large-files Crypt-DES-2.03.orig/DES.xs Crypt-DES-2.03/DES.xs --- Crypt-DES-2.03.orig/DES.xs 2000-09-11 12:27:41.000000000 -0700 +++ Crypt-DES-2.03/DES.xs 2003-12-30 12:34:48.546964000 -0800 @@ -21,11 +21,11 @@ #define sv_undef PL_sv_undef #endif -MODULE = Crypt::DES PACKAGE = Crypt::DES PREFIX = des_ +MODULE = Crypt::DES PACKAGE = Crypt::DES PREFIX = _des_ PROTOTYPES: DISABLE char * -des_expand_key(key) +_des_expand_key(key) char * key = NO_INIT STRLEN key_len = NO_INIT CODE: @@ -42,7 +42,7 @@ } void -des_crypt(input, output, ks, enc_flag) +_des_crypt(input, output, ks, enc_flag) char * input = NO_INIT SV * output char * ks = NO_INIT diff -Nru --minimal --speed-large-files Crypt-DES-2.03.orig/des.h Crypt-DES-2.03/des.h --- Crypt-DES-2.03.orig/des.h 2000-09-11 12:27:41.000000000 -0700 +++ Crypt-DES-2.03/des.h 2003-12-30 12:35:00.771588000 -0800 @@ -2,6 +2,6 @@ typedef unsigned char des_cblock[8]; typedef unsigned long des_ks[32]; -void des_crypt( des_cblock in, des_cblock out, des_ks key, int encrypt ); -void des_expand_key( des_user_key userKey, des_ks key ); +void _des_crypt( des_cblock in, des_cblock out, des_ks key, int encrypt ); +void _des_expand_key( des_user_key userKey, des_ks key );
From: rudi [...] darx.com
Same problem with Soalris 7, the fix patch fixed things here (ifdefs in DES.xs). # uname -a SunOS host 5.7 Generic_106541-26 sun4u sparc SUNW,Ultra-Enterprise-10000 # perl -V Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration: Platform: osname=solaris, osvers=2.7, archname=sun4-solaris-thread-multi uname='sunos foobar 5.7 generic_106541-26 sun4u sparc sunw,ultra- enterprise-10000 ' config_args='-des -Dcc=gcc -Dversion=5.8.3 -Dmyhostname=localhost - Dmydomain=. -Dperladmin=root@localhost -Dprefix=/usr/local/perl583 - Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Di_shadow - Di_syslog -Dman3ext=3pm -Duseperlio -Uinstallusrbinperl - Ubincompat5005 -Uversiononly' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -fno-strict-aliasing - I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O', cppflags='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='3.2.2', gccosandvers='solaris2.7' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -lgdbm -ldl -lm -lpthread -lc perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' - R /usr/local/perl583/lib/5.8.3/sun4-solaris-thread-multi/CORE' cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under solaris Compiled at Feb 9 2004 12:45:28 @INC: /usr/local/perl583/lib/5.8.3/sun4-solaris-thread-multi /usr/local/perl583/lib/5.8.3 /usr/local/perl583/lib/site_perl/5.8.3/sun4-solaris-thread-multi /usr/local/perl583/lib/site_perl/5.8.3 /usr/local/perl583/lib/site_perl .
des.h has been renamed to _des.h (along with references in DES.xs and _des.c) with hopes that this will solve the Solaris problems. -dsp
Patches applied and tested against both Solaris and Mac OS X 10.4.3. Released into CPAN as version 2.05. -dsp