Mark Dickinson wrote: > On Mon, Jun 28, 2010 at 4:28 PM, M.-A. Lemburg <m...@egenix.com> wrote: >> Mark Dickinson wrote: >>> On Mon, Jun 28, 2010 at 3:04 PM, M.-A. Lemburg <m...@egenix.com> wrote: >>>> Why do you think that the default -O2 is unwanted >>> >>> Because it can cause debug builds of Python to be built with >>> optimization enabled, as we've already seen at least twice. >> >> Then let me put it this way: >> >> How many Python users will compile Python in debug mode ? >> >> The point is that the default build of Python should use >> the correct production settings for the C compiler out of >> the box and that's what AC_PROG_CC is all about. >> >> I'm pretty sure that Python developers who want to use a >> debug build have enough code foo to get the -O2 turned into a -O0 >> either by adjust OPT and/or by providing their own CFLAGS env var. > > Shrug. Clearly someone at some point in the past thought it was a > good idea to have --with-pydebug builds use -O0. If there's going to > be a deliberate decision to drop that now, then that's fine with me.
Ah right, the time machine again :-) OPT already uses -O0 if --with-pydebug is used and the compiler supports -g. Since OPT gets added after CFLAGS, the override already happens... >>> I don't. It could easily be tested for, though. Alternatively, >>> setting an empty CFLAGS to '-g' could be done just for gcc, since this >>> is the only compiler for which AC_PROG_CC adds -O2. >> >> ... and then end up with default Python builds which don't have >> debug symbols available to track down core dumps, etc. ? > > No, I don't see how that follows. I was suggesting that *for gcc > only*, an empty CFLAGS be set to '-g' before calling AC_PROG_CC. The > *only* effect this would have would be that for gcc, if the user > hasn't specified CFLAGS, then CFLAGS ends up being '-g' rather than > '-g -O2' after the AC_PROG_CC call. But I'm really not looking for an > argument here; I just wanted to understand why you thought AC_PROG_CC > setting CFLAGS was important, and you've explained that. Thanks. Sorry, that was a misunderstand on my part. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jun 28 2010) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2010-07-19: EuroPython 2010, Birmingham, UK 20 days to go ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com