Bug #1924 SMP: missing #include <linux/config.h>
Submitted: 23 Nov 2003 10:03 Modified: 13 Dec 2003 18:40
Reporter: Jens Elkner Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.0.16 OS:Linux (Linux)
Assigned to: Michael Widenius CPU Architecture:Any

[23 Nov 2003 10:03] Jens Elkner
Description:
in include/my_global.h your are checking for SMP_CONFIG defines before
the inclusion of linux/config.h - the place, were SMP_CONFIG is a priori
[un]defined (via linux/autoconf.h include).

So, when you include asm/atomic.h  (which includes linux/config.h)
you have already defined SMP_CONFIG und one gets a lot of warnings
on machines, where SMP_CONFIG is actually defined via linux/config.h

How to repeat:
Check on a SMP enabled machine.

Suggested fix:
--- mysql-4.0.16/include/my_global.h.orig	Fri Oct 17 07:29:15 2003
+++ mysql-4.0.16/include/my_global.h	Sun Nov 23 18:55:34 2003
@@ -267,6 +267,7 @@
 #endif
 #ifdef HAVE_ATOMIC_ADD
 #define __SMP__
+#include <linux/config.h>
 #ifndef CONFIG_SMP
 #define CONFIG_SMP
 #endif
[23 Nov 2003 15:24] Boyd Gerber
Please note that also on embedded server with cross compiling sometimes HAVE_ATOMIC_ADD is defined so just adding this can cause cross compile problems.

But with linux this config is needed.
[13 Dec 2003 18:40] Michael Widenius
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

The fix will be in MySQL 4.0.17