Details
-
Type:
Task
-
Status: Closed
-
Priority:
Minor
-
Resolution: Not a Bug
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
I configured MariaDB with --with-debug=full, but I still get it building with "-O2", for example:
gcc -DHAVE_CONFIG_H -I. -I../include -I../include -I../include -g -g -O2 -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL -MT strxmov.o -MD -MP -MF .deps/strxmov.Tpo -c -o strxmov.o strxmov.c
It looks like AC_PROG_LIBTOOL sets:
CFLAGS = -g -O2
CXXFLAGS = -g -O2
This is the same with autoconf 2.63 on Mac and autoconf 2.59 on Linux.
MySQL 5.1.46 configure has the same problem.
Here is a quick patch which fixes the problem:
=== modified file 'configure.in'
— configure.in 2010-04-29 07:29:04 +0000
+++ configure.in 2010-05-06 15:41:15 +0000
@@ -15,6 +15,12 @@
- first part and a 100 character second part.
AM_INIT_AUTOMAKE([1.9 tar-ustar])
AC_PROG_LIBTOOL
+if test "$CFLAGS" = "-g -O2" ; then
+ CFLAGS=""
+fi
+if test "$CXXFLAGS" = "-g -O2" ; then
+ CXXFLAGS=""
+fi
AM_CONFIG_HEADER([include/config.h])
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
[Bug 576468] [NEW] Problem building --with-debug
Hi!
>>>>> "Paul" == Paul McCullagh <paul.mccullagh@primebase.org> writes:
Paul> Public bug reported:
Paul> I configured MariaDB with --with-debug=full, but I still get it building
Paul> with "-O2", for example:
Paul> gcc -DHAVE_CONFIG_H -I. -I../include -I../include -I../include -g -g
Paul> -O2 -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE
Paul> -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT
Paul> -DDONT_DECLARE_CXA_PURE_VIRTUAL -MT strxmov.o -MD -MP -MF
Paul> .deps/strxmov.Tpo -c -o strxmov.o strxmov.c
Paul> It looks like AC_PROG_LIBTOOL sets:
Paul> CFLAGS = -g -O2
Paul> CXXFLAGS = -g -O2
Paul> This is the same with autoconf 2.63 on Mac and autoconf 2.59 on Linux.
Paul> MySQL 5.1.46 configure has the same problem.
Paul> Here is a quick patch which fixes the problem:
I usually don't mind the -O2 (except sometimes in the debugger) as
this makes the code act in more similar ways as it will for the
final user. (Some strange bugs are more likely to appear in optimized
code).
What I do when I don't want the -O2 is :
CFLAGS="" CXXFLAGS="" ./configure --with-debug=full
I tested this and with this I didn't get -O2 in my Makefiles
Regards,
Monty