summaryrefslogtreecommitdiff
path: root/sql/CMakeLists.txt
diff options
context:
space:
mode:
authorYuchen Pei <yuchen.pei@mariadb.com>2023-01-12 13:41:49 +1100
committerYuchen Pei <yuchen.pei@mariadb.com>2023-01-20 13:51:25 +1100
commita68b9dd9932aeaf4021675c760bf753d803a326b (patch)
treefef4fec7689e59edca2255c6e845ae256aaae335 /sql/CMakeLists.txt
parent284ac6f2b73650f138064c97a96c8e1d8846550b (diff)
downloadmariadb-git-a68b9dd9932aeaf4021675c760bf753d803a326b.tar.gz
MDEV-26541 Make UBSAN builds work with spider again.
When built with ubsan and trying to load the spider plugin, the hidden visibility of mysqld compiling flag causes ha_spider.so to be missing the symbol ha_partition. This commit fixes that, as well as some memcpy null pointer issues when built with ubsan. Signed-off-by: Yuchen Pei <yuchen.pei@mariadb.com>
Diffstat (limited to 'sql/CMakeLists.txt')
-rw-r--r--sql/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index e7c87698451..968cab85e52 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -197,6 +197,15 @@ FOREACH(se aria partition perfschema sql_sequence wsrep)
ENDIF()
ENDFOREACH()
+IF(VISIBILITY_HIDDEN_FLAG AND TARGET partition AND WITH_UBSAN)
+ # the spider plugin needs some partition symbols from inside mysqld
+ # when built with ubsan, in which case we need to remove
+ # -fvisibility=hidden from partition
+ GET_TARGET_PROPERTY(f partition COMPILE_FLAGS)
+ STRING(REPLACE "${VISIBILITY_HIDDEN_FLAG}" "" f ${f})
+ SET_TARGET_PROPERTIES(partition PROPERTIES COMPILE_FLAGS "${f}")
+ENDIF()
+
IF(WIN32)
SET(MYSQLD_SOURCE main.cc nt_servc.cc message.rc)
TARGET_LINK_LIBRARIES(sql psapi)