Subject: CVS commit: pkgsrc/security/openssl
To: None <pkgsrc-changes@NetBSD.org>
From: Stoned Elipot <seb@netbsd.org>
List: pkgsrc-changes
Date: 03/29/2004 13:49:42
Module Name:	pkgsrc
Committed By:	seb
Date:		Mon Mar 29 13:49:42 UTC 2004

Modified Files:
	pkgsrc/security/openssl: distinfo
Added Files:
	pkgsrc/security/openssl/patches: patch-ak

Log Message:
Fix build on NetBSD sparc64 with perl 5.8.

usage of perl's int() causes trouble with perl 5.8.3 (5.8*?) on at least
NetBSD sparc64/1.6.2.

The perl script openssl-0.9.6m/crypto/bn/bn_prime.pl uses the perl
function int() to truncate the return of sqrt() function.
On the above mentioned platform this leads to execution error:
...
/usr/pkg/bin/perl bn_prime.pl >bn_prime.h
Illegal modulus zero at bn_prime.pl line 16.

Tracing the problem I've found that this int() usage may be the key
of the problem. Please note the following:

$ uname -srm; perl -v | grep 'This is perl'; perl -e 'print int(sqrt(3)),"\n"'
NetBSD 1.6.2 sparc64
This is perl, v5.8.3 built for sparc64-netbsd
2
And...

$ uname -srm; perl -v | grep 'This is perl'; perl -e 'print int(sqrt(3)),"\n"'
NetBSD 1.6.2 sparc64
This is perl, v5.6.1 built for sparc64-netbsd
1

Also note that perlfunc(3) warns about int() used for rounding and
recommends to use sprintf, printf, POSIX::floor or POSIX::ceil when
applicable.

My workaround is to use POSIX::floor() instead of int().


To generate a diff of this commit:
cvs rdiff -r1.28 -r1.29 pkgsrc/security/openssl/distinfo
cvs rdiff -r0 -r1.5 pkgsrc/security/openssl/patches/patch-ak

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.