gnucash maint: Add _FORTIFY_SOURCE directive only when compiling with optimization enabled

Mike Alexander mta at
Fri May 2 17:45:36 EDT 2014

--On May 2, 2014 7:37:52 PM +0200 Geert Janssens 
<janssens-geert at> wrote:

> From what I understand gnucash' configure script will strip out any
> -Ox if --enable-debug is set.  Since I have this set I don't have any
> -Ox in CFLAGS anymore.

Almost.  Near the top of the -O flag in CFLAGS is saved in 
USER_OPTIMIZATION, but CFLAGS is not changed..  Then later if 
--enable-debug is given all -O flags are removed from CFLAGS and any 
saved in USER_OPTIMIZATION are added back in.  The net result is that 
the -O flag set before configure is called is used instead of any that 
configure may have set prior to testing --enable-debug.  In my case I 
explicitly set -O0 if I'm doing a debug build.  That may not be 
necessary anymore, but it makes things explicit.


More information about the gnucash-devel mailing list