mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
Added support of WITH_GPROF to cmake
This commit is contained in:
parent
65c43bcfe2
commit
76a9227001
2 changed files with 9 additions and 3 deletions
|
@ -315,10 +315,11 @@ gcov_configs="--with-gcov"
|
|||
|
||||
# gprof
|
||||
|
||||
gprof_compile_flags="-O2 -pg -g"
|
||||
gprof_compile_flags="-O2"
|
||||
|
||||
# Rest of the flags are set in CmakeFile.txt
|
||||
gprof_link_flags="--disable-shared $static_link"
|
||||
|
||||
disable_gprof_plugins="--with-zlib-dir=bundled --without-plugin-oqgraph --without-plugin-mroonga"
|
||||
disable_gprof_plugins="--with-zlib-dir=bundled --without-plugin-oqgraph --without-plugin-mroonga --with-gprof"
|
||||
|
||||
disable_asan_plugins="--without-plugin-rocksdb"
|
||||
|
|
|
@ -242,13 +242,18 @@ IF (WITH_MSAN)
|
|||
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE" DEBUG RELWITHDEBINFO)
|
||||
ENDIF()
|
||||
|
||||
OPTION(WITH_GPROF "Enable profilingg with gprof" OFF)
|
||||
IF (WITH_GPROF)
|
||||
MY_CHECK_AND_SET_COMPILER_FLAG("-pg -g -no-pie -fPIC")
|
||||
ENDIF()
|
||||
|
||||
# Be nice to profilers etc
|
||||
MY_CHECK_AND_SET_COMPILER_FLAG("-fno-omit-frame-pointer" RELWITHDEBINFO)
|
||||
|
||||
# enable security hardening features, like most distributions do
|
||||
# in our benchmarks that costs about ~1% of performance, depending on the load
|
||||
OPTION(SECURITY_HARDENED "Use security-enhancing compiler features (stack protector, relro, etc)" ON)
|
||||
IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN)
|
||||
IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN AND NOT WITH_GPROF)
|
||||
# security-enhancing flags
|
||||
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
|
||||
MY_CHECK_AND_SET_LINKER_FLAG("-Wl,-z,relro,-z,now")
|
||||
|
|
Loading…
Reference in a new issue