How to compile without optimizations
Kuroishi Mitsuo
kuroishi at iij.ad.jp
Thu Apr 5 04:59:50 UTC 2012
Message-id: <CABhwJwsTYQ2hG5ueGmBXCqpQrvU_2BY6Ooki8kg2AeCUpu9bFg at mail.gmail.com>
From: David Rubel <davidrubels at gmail.com>
Subject: How to compile without optimizations
Date: Wed, 4 Apr 2012 23:49:48 -0430
> Hello.
>
> Is there a way to compile the ISC DHCP without code optimization?. I tried
> editing the Makefile created by ./configure, changing in the "CFLAGS" line
> the "-O2" option to "-O0" or even removing it completely, but then when I
> Make the output leads me to think that the code it's still being optimized.
>
> For example: the last gcc output is "gcc -g -O2 -Wall -Werror
> -fno-strict-aliasing -I../bind/include -o dhcpd dhcpd-dhcpd.o......".
>
> Also, running the dhclient through GDB shows that the values of some
> variables/pointers used in a function I created are being optimized ("value
> optimized out"). I'm getting a Segmentation fault during a malloc to a
> pointer (only initialized, pointing to NULL) which value is being optimized
> before the malloc and I'd like to try if compiling without optimizations
> would fix that problem.
>
> Any help will be greatly appreciated.
> Thanks.
Hi.
I did ./configure CFLAGS="-g3 -O0" and it seems to be OK.
Regards,
--
Kuroishi Mitsuo
More information about the dhcp-workers
mailing list