Bug #69645 compiler flags in mysql_config break apple-gcc42 after mysql-5.6.10
Submitted: 2 Jul 2013 8:49 Modified: 13 Jan 2014 14:03
Reporter: Ruurd Pels Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.6.11, 5.6.12 OS:MacOS
Assigned to: CPU Architecture:Any

[2 Jul 2013 8:49] Ruurd Pels
Description:
Building mysql2 native extension wrongly reports mysql.h and/or mysql/mysql.h missing. mkmf.log shows that -Wno-null-conversion is an unknown flag. 

How to repeat:
Install brew
Install latest mysql-5.6.12
Install rvm
Install ruby-1.9.3 latest patch level
Run gem install mysql2

EXP: succesfull installation
ACT: message about mysql.h and mysql/mysql.h not found

Wrong error about mysql.h or mysql/mysq.h not found, the file and the directory are in the Cellar and symlinked in /usr/local/include. The compiler breaks on cflags and cxxflags introduced in mysql_config in version 5.6.11

Suggested fix:
Remove -Wno-null-conversion -Wno-unused-private-field or include them conditionally if not gcc42
[24 Jul 2013 7:42] Philip Cunningham
+1
[5 Nov 2013 17:50] MySQL Verification Team
Installed 5.6.14 and running on Mavericks I got:

[15:40:57][Pochita:]~ miguel$ sudo gem install mysql2
Fetching: mysql2-0.3.13.gem (100%)
Building native extensions.  This could take a while...
/Users/miguel/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/ext/builder.rb:54: warning: Insecure world writable dir /usr/local in PATH, mode 040777
Successfully installed mysql2-0.3.13
Parsing documentation for mysql2-0.3.13
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/mysql2/mysql2.bundle, skipping
Installing ri documentation for mysql2-0.3.13
1 gem installed
[15:41:20][Pochita:]~ miguel$
[5 Nov 2013 18:48] Ruurd Pels
Yes. Try using ruby-1.9.3 because that uses gcc instead of clang. ruby-2.+ uses clang and that compiler has different flags. So everyone using ruby-1.9.3 still experiences this.

If you are using more recent brews of mysql you probably will not experience this bug because the recipe patches away the flag.
[5 Nov 2013 18:55] Ruurd Pels
Oh and you really should not install RVM system wide as root. Given the amount of gems and other software this is considered a security risk.
[27 Nov 2013 8:40] Erlend Dahl
We see a similiar thing in our internal testing. Setting to verified.
[13 Jan 2014 14:03] Erlend Dahl
[9 Jan 2014 10:29] Paul Dubois

Noted in 5.6.16, 5.7.4 changelogs.

mysql_config incorrectly included some flags to generate compiler
warning output.