Bug #37584 MySQL does not link on Solaris 10 MU4 or newer due to missing DTrace symbols
Submitted: 23 Jun 2008 12:54 Modified: 12 Sep 2008 7:26
Reporter: Olav Sandstå Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:6.0.6 OS:Solaris (Solaris 10 MU4)
Assigned to: Daniel Fischer CPU Architecture:Any
Tags: DTrace

[23 Jun 2008 12:54] Olav Sandstå
Description:
When compiling MySQL 6.0 on Solaris 10 MU4 and newer I get the following error when linking mysqld:

Undefined                       first referenced
 symbol                             in file
__dtrace_mysql___external_lock      handler.o
__dtrace_mysql___update_start       sql_update.o
__dtrace_mysql___insert_row_start   handler.o
__dtrace_mysql___insert_row_end     handler.o
__dtrace_mysql___select_start       sql_select.o
__dtrace_mysql___insert_end         sql_insert.o
__dtrace_mysql___delete_end         sql_delete.o
__dtrace_mysql___filesort_end       filesort.o
__dtrace_mysql___filesort_start     filesort.o
__dtrace_mysql___update_end         sql_update.o
__dtrace_mysql___select_end         sql_select.o
ld: fatal: Symbol referencing errors. No output written to mysqld
collect2: ld returned 1 exit status
gmake[3]: *** [mysqld] Error 1

I get this linking error when compiling both with gcc and Sun Studio 12.

How to repeat:
On a machine running Solaris 10 MU4 or newer (I run MU5) do:

./configure --with-plugins=myisam,innobase

gmake 

Suggested fix:
MySQL should compile on Solaris 10 without producing DTrace linking errors.
[23 Jun 2008 12:55] Olav Sandstå
Work-around:

Include --enable-dtrace when running configure.
[23 Jun 2008 13:00] Olav Sandstå
The cause for this linking problem is that in Solaris 10 MU4 the following standard include file:

  /usr/include/sys/feature_tests.h

was updated and does no include the following:

  /*
 * The following macro indicates header support for DTrace. The value is an
 * integer that corresponds to the major version number for DTrace.
 */
#define _DTRACE_VERSION 1

This will trigger inclusion of calls to the DTrace probes in sql/probes.h even if MySQL is configured to not include DTrace support. This results in the linking error above.
[23 Jun 2008 13:03] Olav Sandstå
See also bug #36403 "Compiling Falcon on Solaris fails due to dtrace" which also includes an extra linking error for the two dtrace probes that are included in Falcon. This problem has temporarily been resolved by commenting out the two Falcon specific DTrace probes. This should be re-enabled when the server compiles correctly with dtrace and when there is support in configure/make for linking in dtrace probes included in storage engines.
[6 Aug 2008 8:37] Alexander Nozdrin
Patch is queued in 6.0-build.
[6 Aug 2008 8:49] Daniel Fischer
Assigning to myself, as I have had a fix for this for some time from working out a number of build failures on Solaris. Fix is about to be merged into 6.0 main.