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.

>> 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.

Mark
_______________________________________________
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

Reply via email to