develooper Front page | perl.dbi.users | Postings from June 2010

Re: Building 32-Bit ONLY Perl on Mac OSX

Thread Previous | Thread Next
Jonathan Leffler
June 17, 2010 21:23
Re: Building 32-Bit ONLY Perl on Mac OSX
Message ID:
On Tue, Jun 15, 2010 at 1:48 PM, <> wrote:

> my question isn't directly related to DBI, but i need to compile a 386/32
> Bit ONLY Perl Binary on Mac OSX 10.6 (SnowLeopard),
> not only but also because we only have a 32 Bit Oracle Instant Client...
> No Matter what Config-Params i tried, the only thing i get is the
> following:
> "...file was built for i386 which is not the architecture being linked
> (x86_64)"...
> Does anyone have an idea or a good link?

The way I've always built Perl with specific bittiness is by specifying that
the compiler is 'cc -m32' or 'cc -m64'.

Just to check that it still works, I've just built Perl 5.12.1 on MacOS X
10.6.4 (released earlier this week), direct from source.

It took me 3 or 4 goes to get the config right because I got return-happy
and missed the questions that need a non-standard answer.

/Users/jleffler/perl/v5.12.1-32bit/bin/perl: Mach-O executable i386
/Users/jleffler/perl/v5.12.1/bin/perl:       Mach-O 64-bit executable x86_64
/usr/bin/perl:                               Mach-O universal binary with 3
/usr/bin/perl (for architecture x86_64):    Mach-O 64-bit executable x86_64
/usr/bin/perl (for architecture i386):    Mach-O executable i386
/usr/bin/perl (for architecture ppc7400):    Mach-O executable ppc

The really tricky question was the one about building shared libraries - it

What command should be used to create dynamic libraries?

I had to add '-m32' to that by typing '$1 $2 $3 -m32'.

For the rest, I ensured that the software was installed where I wanted it
(/Users/jleffler/perl/v5.12.1-32bit) and almost everything else was left at
default - I decline to use vfork().

It took, oh, 20 minutes to build and test - probably less; I set it running
while I went swimming with the kids, and it was done long before I got back.

Jonathan Leffler <>  #include <disclaimer.h>
Guardian of DBD::Informix - v2008.0513 -
"Blessed are we who can laugh at ourselves, for we shall never cease to be

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About