a minor build patch to facilitate debugging

Maxim Dounin mdounin at mdounin.ru
Mon Jul 30 22:16:57 UTC 2012


Hello!

On Mon, Jul 30, 2012 at 10:26:27PM +0400, Vladimir Shebordaev wrote:

> Hi,
> 
> I think it would be nice to disable optimitazions and enable full
> debugging options when NGX_DEBUG is set

These are quite orthogonal things.  The --with-debug option 
enables debug logging.  It's up to you to disable optimizations if 
you wan't to (--with-cc-opt="-O0") and/or enable additional 
debugging flags as understood by your compiler and debugger, but 
certainly not something should be done by default due to --with-debug.

> 
> diff -Naur rev4754/auto/cc/gcc ticket55/auto/cc/gcc
> --- rev4754/auto/cc/gcc 2012-07-16 23:15:16.733977245 +0400
> +++ ticket55/auto/cc/gcc        2012-07-23 08:50:14.420222679 +0400
> @@ -50,7 +50,12 @@
> 
>  #NGX_GCC_OPT="-O2"
>  #NGX_GCC_OPT="-Os"
> +if [ -n "$NGX_DEBUG" ]; then

This is a wrong test for sure, as NGX_DEBUG is never empty, it's 
either NO or YES.

> +NGX_GCC_OPT="-ggdb3"
> +else
>  NGX_GCC_OPT="-O"
> +fi
> +
> 
>  #CFLAGS="$CFLAGS -fomit-frame-pointer"

Maxim Dounin



More information about the nginx-devel mailing list