Bug #38556 Linking error when building Falcon as a shared library using Sun Studio compiler
Submitted: 5 Aug 2008 9:55 Modified: 8 Jan 11:29
Reporter: Olav Sandstaa
Status: Closed
Category:Server: Falcon Severity:S3 (Non-critical)
Version:6.0.6 OS:Sun Solaris
Assigned to: Olav Sandstaa Target Version:6.0.7
Tags: Sun Studio
Triage: D3 (Medium)

[5 Aug 2008 9:55] Olav Sandstaa
Description:
When compiling Falcon as a dynamically loadable library using Sun Studio 12 compiler the
linking of the shared library fails with the following error message:

ld: fatal: library -lstdc++: not found
ld: fatal: File processing errors. No output written to .libs/ha_falcon.so.0.0.0make[3]:
*** [ha_falcon.la] Error 1

Work-around: compile and link Falcon statically in mysqld.

How to repeat:
The following configure will compile Falcon as a dynamically loadable library:

./configure CC=/opt/studio12/SUNWspro/bin/cc  CXX=/opt/studio12/SUNWspro/bin/CC
CFLAGS="-Xa -m32 -mt" CXXFLAGS="-m32 -mt" --prefix=/home/os136802/install/mysql6 
--with-named-curses=-lcurses --with-mysql-ldflags=-static --with-client-ldflags=-static
--with-plugins=myisam,innobase --enable-dtrace

Suggested fix:
Do not include -lstdc++ when linking Falcon with the Sun Studio compiler. 

The -lstdc++ is the Gnu C++ standard library. Falcon should not link with this when
compiling with Sun Studio compiler.
[5 Aug 2008 10:04] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50908

2767 Olav Sandstaa	2008-08-05
      Fix for Bug#38556 Linking error when building Falcon as a shared library using Sun
Studio compiler
      
      Remove the use of the Gnu C++ standard library (stdc++) from the linking command
when linking Falcon
      as a dynamic loadable library.
[6 Aug 2008 9:47] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/50975

2767 Olav Sandstaa	2008-08-05
      Fix for Bug#38556 Linking error when building Falcon as a shared library using Sun
Studio compiler
      
      Remove the use of the Gnu C++ standard library (stdc++) from the linking command
when linking Falcon
      as a dynamic loadable library.
[23 Aug 2008 0:04] Kevin Lewis
This fix is in version 6.0.7
[28 Aug 2008 22:17] Bugs System
Pushed into 6.0.7-alpha  (revid:cbell@mysql.com-20080822132131-uveo6wiuecy6m2b8) (version
source revid:cbell@mysql.com-20080822132131-uveo6wiuecy6m2b8) (pib:3)
[13 Sep 2008 23:50] Bugs System
Pushed into 6.0.6-alpha  (revid:olav@sun.com-20080805080425-cn10z1w9gllsk9ga) (version
source revid:hakan@mysql.com-20080716105246-eg0utbybp122n2w9) (pib:3)
[8 Jan 11:29] MC Brown
A note has been added to the 6.0.6 changelog: 

When building FALCON using the Sun Studio 12 compiler, a requirement for the GNU Standard
C++ (libstdc++) library would be added to the build requirements, causing the build to
fail.