Bug #41270 Configure fails when including Falcon on Mac OS X
Submitted: 5 Dec 2008 20:45 Modified: 13 Dec 2008 11:00
Reporter: Olav Sandstaa
Status: Closed
Category:Server: Falcon Severity:S3 (Non-critical)
Version:6.0.8-alpha OS:Mac OS X
Assigned to: Target Version:
Tags: F_PLATFORM, pushbuild
Triage: Needs Triage: D3 (Medium)

[5 Dec 2008 20:45] Olav Sandstaa
Description:
When trying to run configure on Mac OS X and including support for Falcon it fails with
the following written:

checking compiler flag to enable implicit templates... -fimplicit-templates
checking compiler flag to enable exceptions... -fexceptions -lstdc++
checking linker flag to enable STL... -lstdc++
checking compiler flag to silence offsetof warnings... -Wno-invalid-offsetof
checking if compiler and compiler options support C++ exceptions for Falcon... no
Falcon must be compiled with support for C++ exceptions enabled.
Please adjust your compiler flags or disable support for Falcon
(--without-plugin-falcon).

How to repeat:
Run configure with support for Falcon, e.g.:

  configure --with-falcon

Suggested fix:
Configure should not fail given correct options to the C++ compiler to include support for
C++ exceptions.
[5 Dec 2008 20:50] Olav Sandstaa
C++ code for test compiled and linked by configure

Attachment: conftest.cc (text/x-c++src), 7.76 KiB.

[5 Dec 2008 20:52] Olav Sandstaa
I have attached the C++ file that configure is trying to compile and link. This is named
conftest.cc.

Configure uses the following command to compile and link this file:

ccache gcc -o conftest -Wno-invalid-offsetof -fimplicit-templates -fexceptions -lstdc++
-D_DEBUG   conftest.cc -lm

According to the config.log file, this fails with the following error:

ld: Undefined symbols:
typeinfo for int
___cxa_allocate_exception
___cxa_begin_catch
___cxa_end_catch
___cxa_throw
___gxx_personality_v0
[5 Dec 2008 20:56] Olav Sandstaa
There is a report of a linking problem for Falcon on MAC OS X, see bug #40680.

The reason for submitting this report is that they are not identical, particularly not in
what is suggested as a solution for bug #40680. In bug #40680 the solution/workaround is
suggested to be to add:

  -fexceptions 

when linking mysqld with Falcon. In the failing command in this bug -fexceptions is
included.
[5 Dec 2008 21:01] Olav Sandstaa
This problem started to occur after a patch for bug #39419 was checked into the source
code. This code extends configure to do an explicit check for that the compiler with the
given compiler settings and options are able to compile, link and run successfully a
program that includes C++ exceptions.

So this patch should catch a situation like this where linking with C++ exceptions fails.
[5 Dec 2008 22:44] Olav Sandstaa
Workaround:

Changing from setting CXX=gcc to setting CXX=g++ makes the command run by configure to
compile and link successfully.
[9 Dec 2008 19:39] Timothy Smith
Building 6.0 is not supported with CXX=gcc.  Falcon, in particular, requires full C++
support (including exceptions).

I'm closing this as Not a Bug.

Regards,

Timothy
[11 Dec 2008 17:14] Hakan Kuecuekyilmaz
Setting
    CXX=g++

fixes this problem. Setting to "Documenting".
[13 Dec 2008 11:00] MC Brown
A note has been added to the 6.0.8 changelog: 

Compiling using --with-falcon on Mac OS X fails if you use CXX=gcc. You must specify that
the g++ compiler should be used for C++ using CXX=g++.