1
votes

I am trying to compile python 32 bit on OSX. In order to do so, I want to specify -m32, so I dutifully specified

CFLAGS='-m32' LDFLAGS='-m32' ./configure

The configure executes correctly, but when I invoke make, the gcc execution has no trace of the -m32 flag. In order to have it, I had to do a more aggressive approach:

CFLAGS='-m32' LDFLAGS='-m32' CC='gcc -m32' ./configure

I don't really understand why the CFLAGS I specify are not passed (the LDFLAGS are. I find LDFLAG=-m32 in the Makefile). Is it an error of the configure script, or am I doing this wrong ?

I'm using python 2.6.0 (don't ask)

1
I'm using "Python 3.2.1 bzipped source tarball" on Linux and it works for me (tm).Patrick B.
Which version of Python is this? Your first example works fine for me with 2.7.2, 2.6.7 & 3.1.4. What shell are you using?Michał Górny
Thanks, I updated the answer then as well. It seems that this a bug in this version, which was fixed later.Michał Górny

1 Answers

2
votes

Ok, I can reproduce that with Python-2.6. That seems to be a bug in that version, and is fixed in a newer one.

Still, I can tell you that it is common for various packages to override or filter CFLAGS of values considered unsafe and so on. This often covers -m32 as well.

Moreover, many packages simply ignore LDFLAGS (which is an error indeed). Thus, for the particular case of building 32-bit package versions, it is common to override CC like you did and leave CFLAGS and LDFLAGS alone.