Issue 1104249: configure doesn't set up CFLAGS properly (original) (raw)

Created on 2005-01-17 22:54 by bos, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg60636 - (view) Author: Bryan O'Sullivan (bos) Date: 2005-01-17 22:54
I'm trying to build a 32-bit python on an x86_64 Linux box running Fedora Core 3. Here's my configure command line: CFLAGS=-m32 LDFLAGS=-m32 ../../../python/configure --prefix=/opt/python --enable-shared --enable-ipv6 --enable-profiling --enable-unicode=ucs4 When I try to do a make afterwards, the build immediately fails: gcc -pthread -c -pg -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I../../../python/Include -fPIC -DPy_BUILD_CORE -o Modules/python.o ../../../python/Modules/python.c In file included from ../../../python/Include/Python.h:55, from ../../../python/Modules/python.c:3: ../../../python/Include/pyport.h:612:2: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." make: *** [Modules/python.o] Error 1 Notice the lack of "-m32" on the gcc command line. Sure enough, look in the Makefile and LDFLAGS is set correctly, with -m32, but CFLAGS makes no mention of it, nor does BASECFLAGS. If I modify BASECFLAGS by hand, python itself builds OK, but then the shared libraries fail to link because LDSHARED is not having LDFLAGS passed in.
msg60637 - (view) Author: Bryan O'Sullivan (bos) Date: 2005-01-17 22:55
Logged In: YES user_id=28380 The "correct" (i.e. works for me) way to work around this is to run configure with CC="gcc -32" CXX="g++ -m32" instead of setting CFLAGS and LDFLAGS.
msg60638 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2005-01-17 23:18
Logged In: YES user_id=38388 Try using LDSHARED instead. This works for compiling extensions on x86_64 (using C shell): setenv CCSHARED "-m32 -fPIC" setenv LDSHARED "gcc -m32 -shared"
msg93985 - (view) Author: M Joonas Pihlaja (joonas) Date: 2009-10-14 13:41
Here's a test case: $ CFLAGS="--haflkhlaiuhfnafkghnaf" ./configure; make [... configure does its thing... ] [... make does its thing and completes successfully ...] Expected result: The build fails due to an unknown flag in CFLAGS. Witnessed result: CFLAGS is completely ignored.
msg114083 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-08-16 22:52
Closing as a duplicate of issue 9189.
History
Date User Action Args
2022-04-11 14:56:09 admin set github: 41457
2010-08-16 22:52:45 skrah set status: open -> closedsuperseder: Improve CFLAGS handlingnosy: + skrahmessages: + resolution: duplicatestage: test needed -> resolved
2009-10-14 13:41:07 joonas set nosy: + joonasmessages: +
2009-02-14 19:09:40 ajaksu2 set stage: test neededtype: behaviorversions: + Python 2.6, - Python 2.4
2005-01-17 22:54:18 bos create