Bug 168373 - perl is compiled without 64bit int on i386
Summary: perl is compiled without 64bit int on i386
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: perl
Version: rawhide
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jason Vas Dias
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-09-15 14:42 UTC by Ola Thoresen
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-11-02 00:25:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ola Thoresen 2005-09-15 14:42:15 UTC
Description of problem:
perl is compiled without 64bit int on i386

Version-Release number of selected component (if applicable):
perl-5.8.7-0.3.fc5

How reproducible:
Always

Steps to Reproduce:
1. Install perl
2. perl -e 'printf ("%x", 99999999999999)'

Actual results:
ffffffff

Expected results:
5af3107a3fff

Additional info:
From the INSTALL manual:
"The use64bitint option does only as much as is required to get 64-bit integers
into Perl (this may mean, for example, using "long longs") while your memory may
still be limited to 2 gigabytes (because your pointers could still be 32-bit).
Note that the name 64bitint does not imply that your C compiler will be using
64-bit ints (it might, but it doesn't have to). The use64bitint simply means
that you will be able to have 64 bit-wide scalar values."

http://search.cpan.org/~nwclark/perl-5.8.6/INSTALL#Run_Configure

At least I need 64bit ints for some internal applications that needs to run on
both x86_64 and i386.

Comment 1 Warren Togami 2005-10-18 02:55:00 UTC
Hey Chip (or anyone else), what is your recommendation for this to go into
rawhide?  I don't know anything about the ramifications of what this would cause.

Comment 2 Jason Vas Dias 2005-11-02 00:25:47 UTC
When you are running perl on a 64-bit machine, and have installed the 64-bit
architecture version, ie. on x86_64, perl-*.x86_64.rpm, not perl-*i386.rpm, 
then you do get 64-bit integers by default:
e.g. on an x86_64, with perl*.x86_64
$ rpm -q perl --qf '%{ARCH}\n'
x86_64
$ perl -e 'print ( 1 <<32, "\n" );'
4294967296

The 64bitint feature is meant to provide support for 64bit integers on 32 bit
platforms, and has been associated with severe problems in the past.

Using 64-bit integer emulation on 32-bit platforms would incur a heavy 
performance penalty for ALL applications, even those that make no use
of 33+bit integers. 

It is also made redundant by use of the 'use bigint' pragma, which you can
specify on the command line with -Mbigint, or in the environment of for your
perl scripts on 32-bit platforms with the environment variable setting
 PERL5OPT=-Mbigint 
e.g, on an i386 machine:
$ rpm -q perl --qf '%{ARCH}\n'
i386
$ perl -e 'print ( 1<<32, "\n");'
1
$ PERL5OPT=-Mbigint perl -e 'print ( 1<<32, "\n");'
4294967296

Since there are many workarounds, and we don't want to incur a performance
penalty for all perl scripts, and there have been problems with -D64bitint,
I don't think we should enable this feature unless absolutely required - sorry.


Note You need to log in before you can comment on or make changes to this bug.