Bug #72090 MySQL uses clang even when it intends to use g++
Submitted: 21 Mar 2014 1:12 Modified: 20 May 2014 10:45
Reporter: Marcus Calhoun-Lopez Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.6 OS:MacOS (10.9)
Assigned to: Jon Olav Hauglid CPU Architecture:Any

[21 Mar 2014 1:12] Marcus Calhoun-Lopez
Description:
In the CMakeLists.txt file, MySQL explicitly requires g++ be used on 32-bit builds on Mac OS X:

# Possibly temporary fix: Clang on 32 bit causes non-debug server to crash
IF(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
  SET(CMAKE_CXX_COMPILER g++)
ENDIF()

This temporary fix was added in revision 4223.1.4 with the comment
"Revert CXX to g++ for builds on 32 bit OSX, since Clang causes crash
  Need to investigate further"
See http://bazaar.launchpad.net/~mysql/mysql-server/5.6/revision/4223.1.4

This is still on the 5.6.16 code as well ad the development branch
http://bazaar.launchpad.net/~mysql/mysql-server/5.7/view/head:/CMakeLists.txt

On Mavericks (OSX 10.9), however, g++ and clang are the same thing.
If the problem still exists, then it will crop up on OSX 10.9.

Does the crash problem affect all versions of clang?

How to repeat:
Compile MySQL on Mac OS X 10.9 (Mavericks)
[15 May 2014 20:02] MySQL Verification Team
What do you meant with compile on Mavericks? It won't compile?

[16:56:50][pochita:]mysql-5.6.17 miguel$ sql/Debug/mysqld --version
sql/Debug/mysqld  Ver 5.6.17-debug for osx10.9 on x86_64 (Source distribution)
[15 May 2014 23:38] Marcus Calhoun-Lopez
It DOES compile on Mavericks.
Sorry if that was not clear.
I will try to articulate the problem better.

*) I am trying to compile MySQL in 32-bit mode on Mavericks.
*) It compiles just fine.
*) In 32-bit mode, MySQL tries NOT to use clang because "Clang causes [a] crash" (according the code).
*) On Mavericks, there is no choice but to use clang (g++ is the same as clang).
*) Therefore, under some circumstances, I can expect a crash on Mavericks in 32-bit mode.
*) I can not reproduce the crash, but I have no idea the circumstances of the crash (the code does not say).

My questions are therefore:
-) Does this crash affect all versions of clang?
-) If so, which versions?
-) How does one reproduce the crash to see if it is still relevant?

The MySQL code indicates the "[n]eed to investigate further," but that was a year and a half ago.

Thanks for your help.
[19 May 2014 22:49] MySQL Verification Team
Thank you for the feedback.
[20 May 2014 10:45] Jon Olav Hauglid
Hi,

Thanks for the heads-up. We will soon release new 10.9 packages for 5.6 where
this issue will be resolved. It was a workaround for an old clang issue which
is no longer present.