cmac has asked for the wisdom of the Perl Monks concerning the following question:

I'm building Perl 5.8.9 from source, and am confused by the words about 64-bit integers in the INSTALL file and man page. Specifically:

'If your platform does not run natively at 64 bits, but can simulate them with compiler flags and/or "long long" or "int64_t", you can build a perl that uses 64 bits' and 'Natively 64-bit systems need neither -Duse64bitint nor -Duse64bitall'

The server I'm building for is a Xeon L5320, and it has native 64-bit instructions, so no "simulation" should be needed. However, my internet hosting provider (IHP) set up the basic site, and they are conservative in how they set things up. They may have told the FreeBSD 6.3 kernel and the gcc toolchain that they're on a plain i386.

How do I decide whether I should include -Duse64bitint in my Configure command? I know from a previous build that if I do, the build sequence takes it seriously, in that it changes the name of the "architectural directories" correspondingly.

Most of my Perl usage is under mod_perl2, under an Apache server that I'm trying to move to a threaded MPM. My goals are to run as fast and efficiently as possible and minimize the total httpd footprint.

How do I find out how the gcc toolchain is configured? Is reconfiguring it an alternative to using -Duse64bitint? Can I endanger the interface to the kernel by such reconfiguration? At the moment I do not feel up to building a custom FreeBSD 6.3...

The advice of the wise monks (actually any monks in case the wise ones are on holiday :-) will be appreciated.

Thanks,
cmac
www.animalhead.com

Replies are listed 'Best First'.
Re: use64bitint in building Perl
by ikegami (Patriarch) on Dec 29, 2008 at 21:16 UTC

    so no "simulation" should be needed

    From what's I've heard, use64bitint allows 64-bit ints in a 32-bit Perl. And as far as I know, 32-bit binaries don't support 64-bit ints without "simulation".

    So you are either building a 64-bit binary (where you don't need use64bitint) or a 32-bit binary (where you need "simulation" and thus use64bitint for 64-bit ints, even on a 64-bit system).

Re: use64bitint in building Perl
by zwon (Abbot) on Dec 29, 2008 at 22:13 UTC
    If you running 32bit FreeBSD, you have to build 32bit perl. AFAIK by default perl on 32bit FreeBSD built with -Duse64bitint.
      uname -a is answered 'FreeBSD ... 6.3-RELEASE FreeBSD 6.3-RELEASE #2 ... root@fc:/usr/src/sys/i386/compile/VKERN i386'. This looks like a 32-bit kernel, right?

      When I build without -Duse64bitint, Configure makes dependent directories named 'i386-freebsd'. With the switch, Configure says it's going to make directories named "i386-freebsd-64int". This seems like 64 bit ints are not the default. Or did I mistake your meaning?

        Yes, it's 32bit system.

        When I mentioned FreeBSD defaults, I mean that perl already installed on the system is built with -Duse64bitint. You can check this using

        perl -V | grep 64bitint

        If you build Perl yourself you should specify this option explicitly. If you build it from ports use PERL_64BITINT makefile option.