[Mesa-dev] switching off -O2 with debugging build

Matt Turner mattst88 at gmail.com
Fri Dec 7 14:26:07 PST 2012


On Fri, Dec 7, 2012 at 2:11 PM, Brian Paul <brianp at vmware.com> wrote:
> On 12/07/2012 10:40 AM, Chad Versace wrote:
>>
>> On 12/07/2012 01:29 PM, Dmitry at freedesktop.org wrote:
>>>
>>> ./configure --enable-debug seems to leave -O2 omptimization flag
>>> turned on.
>>>
>>> Is there a quick method to switch it off?
>>
>>
>> During the ./configure&&  make&&  make install process, I set
>>
>> export CFLAGS="-O0 -g3"
>> export CXXFLAGS="-O0 -g3"
>>
>> The last thing that the configure script prints is a summary,
>> which contains the value of CFLAGS and CXXFLAGS among much else. To verify
>> that this works for you, examine the summary.
>
>
> I've mentioned this before, but it would be nice if specifying
> --enabled-debug also turned off -O2.
>
> -Brian

We could do something like what I did for GLU:

http://cgit.freedesktop.org/mesa/glu/commit/?id=f98fdc4d8a77497d1921e3dc26cab0e28abb92fc

i.e., just appending -g -O0 to CFLAGS and overriding previous -O* flags.


More information about the mesa-dev mailing list