This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 'configure' script overrides users setting of CFLAGS
Type: behavior Stage:
Components: Installation Versions: Python 2.7
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, drkirkby, eric.araujo
Priority: normal Keywords:

Created on 2011-03-24 23:49 by drkirkby, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg132056 - (view) Author: David Kirkby (drkirkby) Date: 2011-03-24 23:49
I'm trying to build a version of Python *without* debugging information.

The reason for me wanting to do this is because there is a bug which is either in gcc or AIX , that prevents recently patched versions of AIX building code where there are static variables that are unitilized. 

So I have tried 

$ export CFLAGS="-g0"
$export CXXFLAGS="-g0"

The "-g0" should disable debugging information. But instead the option occurs before the automatically inserted options, so I see:

gcc -c -fno-strict-aliasing -g0 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Parser/pgen.o Parser/pgen.c

Because of this, the "-g" overrides the "-g0" and I get debugging information. 

Is there any way to not add -g when building Python?
msg132073 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-03-25 09:16
You should override the OPT variable as well. I tried:

$ CFLAGS="" OPT="-fwrapv -O3 -Wall" ./configure

Then "make" shows lines like:

gcc -pthread -c -fno-strict-aliasing  -DNDEBUG -fwrapv -O3 -Wall  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
msg132078 - (view) Author: David Kirkby (drkirkby) Date: 2011-03-25 10:38
Thank you. That solved it, so you can close this.
msg132125 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-25 17:51
Is this worth a README or doc update?
msg132431 - (view) Author: David Kirkby (drkirkby) Date: 2011-03-28 22:03
Yes, I think this could do with being documented, as it is not obvious. Generally one would expect CFLAGS to do this, and not OPT.
History
Date User Action Args
2022-04-11 14:57:15adminsetgithub: 55876
2011-03-28 22:03:47drkirkbysetmessages: + msg132431
2011-03-25 17:51:19eric.araujosetnosy: + eric.araujo
messages: + msg132125
2011-03-25 10:39:00amaury.forgeotdarcsetstatus: open -> closed
2011-03-25 10:38:35drkirkbysetstatus: pending -> open

messages: + msg132078
2011-03-25 09:16:45amaury.forgeotdarcsetstatus: open -> pending

nosy: + amaury.forgeotdarc
messages: + msg132073

resolution: works for me
2011-03-24 23:49:27drkirkbycreate