diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-02-25 17:31:31 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2010-02-25 17:31:31 +0100 |
commit | 46800354ab9659b46e227278926317e25fde7a7c (patch) | |
tree | b99d21ac7e541a5a3c57f88f6eb871a2c10248a3 /cmake | |
parent | 527ff458aad9368453f306a6bfc6fe0715623ff9 (diff) | |
download | mariadb-git-46800354ab9659b46e227278926317e25fde7a7c.tar.gz |
Workaround crash with dtraced shared libraries under GCC 3.4.6 on 32 bit Solaris.
Crash happens in dlopen() code when trying to load the library. Crash does not happen when library is
not DTrace instrumented . Additionally, crash does not happen with default Solaris 10 GCC 3.4.3 and
it does not happen if main executable is instrumented.
So , just check for this specific situation (32 bit, GCC3.4.6 , Solaris) and disable Dtrace in shared libraries.
We have only single plugin so far that is instrumented (ha_example)
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/dtrace.cmake | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/cmake/dtrace.cmake b/cmake/dtrace.cmake index f110e2ab32c..d5566d03913 100644 --- a/cmake/dtrace.cmake +++ b/cmake/dtrace.cmake @@ -72,8 +72,29 @@ IF(ENABLE_DTRACE) ) ENDIF() +IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_COMPILER_IS_GNUCXX + AND CMAKE_SIZEOF_VOID_P EQUAL 4) + IF(NOT DEFINED BUGGY_GCC_NO_DTRACE_MODULES) + EXECUTE_PROCESS( + COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version + OUTPUT_VARIABLE out) + IF(out MATCHES "3.4.6") + # This gcc causes crashes in dlopen() for dtraced shared libs, + # while standard shipped with Solaris10 3.4.3 is ok + SET(BUGGY_GCC_NO_DTRACE_MODULES 1 CACHE INTERNAL "") + ELSE() + SET(BUGGY_GCC_NO_DTRACE_MODULES 0 CACHE INTERNAL "") + ENDIF() + ENDIF() +ENDIF() -MACRO(DTRACE_INSTRUMENT target) +FUNCTION(DTRACE_INSTRUMENT target) + IF(BUGGY_GCC_NO_DTRACE_MODULES) + GET_TARGET_PROPERTY(target_type ${target} TYPE) + IF(target_type MATCHES "MODULE_LIBRARY") + RETURN() + ENDIF() + ENDIF() IF(ENABLE_DTRACE) ADD_DEPENDENCIES(${target} gen_dtrace_header) @@ -119,7 +140,7 @@ MACRO(DTRACE_INSTRUMENT target) ENDIF() ENDIF() ENDIF() -ENDMACRO() +ENDFUNCTION() # Ugly workaround for Solaris' DTrace inability to use probes |