Bug #64477 Can't build 5.5 on Ubuntu with systemtap-sdt-dev installed
Submitted: 27 Feb 2012 21:20 Modified: 28 Feb 2012 10:45
Reporter: Hartmut Holzgraefe Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5.23 OS:Linux (Ubuntu 11.10)
Assigned to: CPU Architecture:Any

[27 Feb 2012 21:20] Hartmut Holzgraefe
Description:
Compilation fails with

[ 43%] Building CXX object storage/blackhole/CMakeFiles/blackhole.dir/ha_blackhole.cc.o
In file included from /usr/include/sys/sdt.h:65:0,
                 from .../mysql-5.5.21/build/include/probes_mysql_dtrace.h:9,
                 from ../mysql-5.5.21/include/probes_mysql.h:24,
                 from .../mysql-5.5.21/storage/blackhole/ha_blackhole.cc:24:
/usr/include/c++/4.6/limits:309:11: error: macro "min" requires 2 arguments, but only 1 given
[...]

as sdt.h includes the C++ "limits" header file when being processed in C++ mode.
As my_globals.h as already been included at that point the min() and max() methods in the class templates in the limits header clash with the min() and max() macros defined in my_globals.h

How to repeat:
make sure that probes_mysql_dtrace.h is included *before* my_globals.h

Suggested fix:
make sure that probes_mysql_dtrace.h is included *before* my_globals.h

workarounds: uninstall "systemtap-sdt-dev" or set the cmake setting ENABLE_DTRACE to OFF
[28 Feb 2012 10:45] Valeriy Kravchuk
Thank you for the problem report. Verified by code review. my_globals.h is included in sql/unireg.h, and that one is included before probes_mysql.h in ha_blackhole.cc.