Description:
Debian has started to use the GCC-4.0 compiler suite per default. This caused MySQL to no longer build. The patch seems to be fairly simple but I would like to get your approval.
The problem affects at least MySQL 4.1.2 and 5.0.7beta with "gcc (GCC) 4.0.1 20050701".
bye,
-christian- (Debian maintainer for MySQL)
How to repeat:
Just build and stumble upon:
if g++ -DDEFAULT_BASEDIR=\"/usr\" -DDATADIR="\"/var/lib/mysql\"" -DDEFAULT_CHARSET_HOME="\"/usr\"" -DSHAREDIR="\"/usr/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I. -O3 -DDBUG_OFF -DBIG_JOINS=1 -felide-constructors -fno-rtti -O3 -fno-implicit-templates -fno-exceptions -fno-rtti -MT my_new.o -MD -MP -MF ".deps/my_new.Tpo" -c -o my_new.o my_new.cc; \
then mv -f ".deps/my_new.Tpo" ".deps/my_new.Po"; else rm -f ".deps/my_new.Tpo"; exit 1; fi
/usr/include/asm/system.h:247: error: expected ',' or '...' before 'new'
/usr/include/asm/system.h: In function 'long unsigned int __cmpxchg(volatile void*, long unsigned int, long unsigned int)':
/usr/include/asm/system.h:250: error: 'size' was not declared in this scope
/usr/include/asm/system.h:254: error: expected type-specifier before ')' token
/usr/include/asm/system.h:260: error: expected type-specifier before ')' token
/usr/include/asm/system.h:266: error: expected type-specifier before ')' token
make[3]: *** [my_new.o] Fehler 1
make[3]: Leaving directory `/home/ch/debian/mysql/SID-4.1/mysql-dfsg-4.1-4.1.12/mysys'
make[2]: *** [all-recursive] Fehler 1
make[2]: Leaving directory `/home/ch/debian/mysql/SID-4.1/mysql-dfsg-4.1-4.1.12'
make[1]: *** [all] Fehler 2
make[1]: Leaving directory `/home/ch/debian/mysql/SID-4.1/mysql-dfsg-4.1-4.1.12'
make: *** [build-stamp] Fehler 2
("Fehler" is German for "error")
Suggested fix:
--- old/include/my_global.h.orig 2005-07-10 16:56:58.000000000 +0200
+++ new/include/my_global.h 2005-07-10 16:55:53.000000000 +0200
@@ -301,10 +301,10 @@
#include <alloca.h>
#endif
#ifdef HAVE_ATOMIC_ADD
-#if defined(__ia64__)
+/* #if defined(__ia64__) */
#define new my_arg_new
#define need_to_restore_new 1
-#endif
+/* #endif */
C_MODE_START
#include <asm/atomic.h>
C_MODE_END
Description: Debian has started to use the GCC-4.0 compiler suite per default. This caused MySQL to no longer build. The patch seems to be fairly simple but I would like to get your approval. The problem affects at least MySQL 4.1.2 and 5.0.7beta with "gcc (GCC) 4.0.1 20050701". bye, -christian- (Debian maintainer for MySQL) How to repeat: Just build and stumble upon: if g++ -DDEFAULT_BASEDIR=\"/usr\" -DDATADIR="\"/var/lib/mysql\"" -DDEFAULT_CHARSET_HOME="\"/usr\"" -DSHAREDIR="\"/usr/share/mysql\"" -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I. -O3 -DDBUG_OFF -DBIG_JOINS=1 -felide-constructors -fno-rtti -O3 -fno-implicit-templates -fno-exceptions -fno-rtti -MT my_new.o -MD -MP -MF ".deps/my_new.Tpo" -c -o my_new.o my_new.cc; \ then mv -f ".deps/my_new.Tpo" ".deps/my_new.Po"; else rm -f ".deps/my_new.Tpo"; exit 1; fi /usr/include/asm/system.h:247: error: expected ',' or '...' before 'new' /usr/include/asm/system.h: In function 'long unsigned int __cmpxchg(volatile void*, long unsigned int, long unsigned int)': /usr/include/asm/system.h:250: error: 'size' was not declared in this scope /usr/include/asm/system.h:254: error: expected type-specifier before ')' token /usr/include/asm/system.h:260: error: expected type-specifier before ')' token /usr/include/asm/system.h:266: error: expected type-specifier before ')' token make[3]: *** [my_new.o] Fehler 1 make[3]: Leaving directory `/home/ch/debian/mysql/SID-4.1/mysql-dfsg-4.1-4.1.12/mysys' make[2]: *** [all-recursive] Fehler 1 make[2]: Leaving directory `/home/ch/debian/mysql/SID-4.1/mysql-dfsg-4.1-4.1.12' make[1]: *** [all] Fehler 2 make[1]: Leaving directory `/home/ch/debian/mysql/SID-4.1/mysql-dfsg-4.1-4.1.12' make: *** [build-stamp] Fehler 2 ("Fehler" is German for "error") Suggested fix: --- old/include/my_global.h.orig 2005-07-10 16:56:58.000000000 +0200 +++ new/include/my_global.h 2005-07-10 16:55:53.000000000 +0200 @@ -301,10 +301,10 @@ #include <alloca.h> #endif #ifdef HAVE_ATOMIC_ADD -#if defined(__ia64__) +/* #if defined(__ia64__) */ #define new my_arg_new #define need_to_restore_new 1 -#endif +/* #endif */ C_MODE_START #include <asm/atomic.h> C_MODE_END