Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
3a6b7594
Commit
3a6b7594
authored
Dec 11, 2009
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce macro DTRACE_INSTRUMENT_STATIC_LIBS,to hide
the ugly Solaris dtrace workarounds
parent
55ccb35b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
35 deletions
+38
-35
cmake/dtrace.cmake
cmake/dtrace.cmake
+33
-2
sql/CMakeLists.txt
sql/CMakeLists.txt
+5
-33
No files found.
cmake/dtrace.cmake
View file @
3a6b7594
...
...
@@ -103,10 +103,41 @@ MACRO (DTRACE_INSTRUMENT target)
COMMAND
${
CMAKE_RANLIB
}
${
target_location
}
)
# Remember the object directory (it is used to workaround lack of static
# library support when linking mysqld)
# Used in DTRACE_INSTRUMENT_WITH_STATIC_LIBS
SET
(
TARGET_OBJECT_DIRECTORY_
${
target
}
${
objdir
}
CACHE INTERNAL
""
)
ENDIF
()
ENDIF
()
ENDIF
()
ENDMACRO
()
# Ugly workaround for Solaris' DTrace inability to use probes
# from static libraries, discussed e.g in this thread
# (http://opensolaris.org/jive/thread.jspa?messageID=432454)
# We have to collect all object files that may be instrumented
# and go into the mysqld (also those that come from in static libs)
# run them again through dtrace -G to generate an ELF file that links
# to mysqld.
MACRO
(
DTRACE_INSTRUMENT_STATIC_LIBS target libs
)
IF
(
CMAKE_SYSTEM_NAME MATCHES
"SunOS"
AND ENABLE_DTRACE
)
FOREACH
(
lib
${
libs
}
)
SET
(
dirs
${
dirs
}
${
TARGET_OBJECT_DIRECTORY_
${
lib
}}
)
ENDFOREACH
()
SET
(
obj
${
CMAKE_BINARY_DIR
}
/
${
target
}
_dtrace_all.o
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
obj
}
DEPENDS
${
libs
}
COMMAND
${
CMAKE_COMMAND
}
-DDTRACE=
${
DTRACE
}
-DOUTFILE=
${
obj
}
-DDFILE=
${
CMAKE_BINARY_DIR
}
/include/probes_mysql.d
-DDTRACE_FLAGS=
${
DTRACE_FLAGS
}
"-DDIRS=
${
dirs
}
"
-P
${
CMAKE_SOURCE_DIR
}
/cmake/dtrace_prelink.cmake
VERBATIM
)
ADD_CUSTOM_TARGET
(
${
target
}
_dtrace_all DEPENDS
${
obj
}
)
ADD_DEPENDENCIES
(
${
target
}
${
target
}
_dtrace_all
)
TARGET_LINK_LIBRARIES
(
${
target
}
${
obj
}
)
ENDIF
()
ENDMACRO
()
sql/CMakeLists.txt
View file @
3a6b7594
...
...
@@ -91,39 +91,7 @@ TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
${
LIBWRAP
}
${
LIBCRYPT
}
${
LIBDL
}
${
SSL_LIBRARIES
}
)
# Ugly workaround for Solaris' DTrace inability to use probes
# from static libraries currently, discussed e.g in this thread
# (http://opensolaris.org/jive/thread.jspa?messageID=432454)
# We have to collect all object files that may be instrumented
# and go into the mysqld (also those that come from in static libs)
# run them again through dtrace -G to generate an ELF file that links
# to mysqld.
IF
(
CMAKE_SYSTEM_NAME MATCHES
"SunOS"
AND ENABLE_DTRACE
)
SET
(
DTRACE_PROBES_ALL
${
CMAKE_CURRENT_BINARY_DIR
}
/dtrace_probes_all.o
)
SET
(
DTRACED_LIBS sql
${
MYSQLD_STATIC_PLUGIN_LIBS
}
mysys
)
FOREACH
(
lib
${
DTRACED_LIBS
}
)
SET
(
DTRACE_DIRS
${
DTRACE_DIRS
}
${
TARGET_OBJECT_DIRECTORY_
${
lib
}}
)
ENDFOREACH
()
MESSAGE
(
"DTRACE_DIRS=
${
DTRACE_DIRS
}
"
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
DTRACE_PROBES_ALL
}
DEPENDS
${
DTRACED_LIBS
}
COMMAND
${
CMAKE_COMMAND
}
-DDTRACE=
${
DTRACE
}
-DOUTFILE=
${
DTRACE_PROBES_ALL
}
-DDFILE=
${
CMAKE_BINARY_DIR
}
/include/probes_mysql.d
-DDTRACE_FLAGS=
${
DTRACE_FLAGS
}
"-DDIRS=
${
DTRACE_DIRS
}
"
-P
${
CMAKE_SOURCE_DIR
}
/cmake/dtrace_prelink.cmake
VERBATIM
)
ELSE
()
SET
(
DTRACE_PROBES_ALL
)
ENDIF
()
IF
(
WIN32
)
SET
(
MYSQLD_SOURCE main.cc nt_servc.cc nt_servc.h
)
...
...
@@ -132,7 +100,6 @@ ELSE()
ENDIF
()
ADD_EXECUTABLE
(
mysqld
${
MYSQLD_SOURCE
}
)
IF
(
NOT WITHOUT_DYNAMIC_PLUGINS
)
SET_TARGET_PROPERTIES
(
mysqld PROPERTIES ENABLE_EXPORTS TRUE
)
...
...
@@ -168,6 +135,11 @@ IF(INTERFACE_LIBS)
"
${
INTERFACE_LIBS
}
"
)
ENDIF
()
# On Solaris, some extra effort is required in order to get dtrace probes
# from static libraries
DTRACE_INSTRUMENT_STATIC_LIBS
(
mysqld
"sql;mysys;
${
MYSQLD_STATIC_PLUGIN_LIBS
}
"
)
INSTALL
(
TARGETS mysqld DESTINATION bin
)
INSTALL_DEBUG_SYMBOLS
(
mysqld
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment