[mariadb/f19] Use older cmake script for stay abi compatible
Honza Horak
hhorak at fedoraproject.org
Thu Mar 6 21:46:26 UTC 2014
commit 19ddc9e93f9a11cff47a90280342663452216701
Author: Honza Horak <hhorak at redhat.com>
Date: Thu Mar 6 22:42:13 2014 +0100
Use older cmake script for stay abi compatible
mariadb-versioning.patch | 227 ++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 220 insertions(+), 7 deletions(-)
---
diff --git a/mariadb-versioning.patch b/mariadb-versioning.patch
index 51ff1d7..3e6aacb 100644
--- a/mariadb-versioning.patch
+++ b/mariadb-versioning.patch
@@ -1,15 +1,228 @@
The symbol versioning solution for libmysqlclient in mysql 5.1 was pretty
awful (export everything) and as of 5.5.8 the cmake build scripts have
-forgotten the issue entirely. So we now maintain our own list of exported
+forgotten the issue entirely. So we have maintained our own list of exported
symbols and jam it into the build with this hack.
+Since Fedora 21 we'll use new layout comming from Fedora/MariaDB/Oracle
+collaboration and which resulted into exporting all symbols under
+libmysqlclient_18 version, while some of them also have alternative
+name versioned as libmysqlclient_16.
-diff -up mariadb-5.5.29/libmysql/CMakeLists.txt.p5 mariadb-5.5.29/libmysql/CMakeLists.txt
---- mariadb-5.5.29/libmysql/CMakeLists.txt.p5 2013-01-29 15:12:46.000000000 +0100
-+++ mariadb-5.5.29/libmysql/CMakeLists.txt 2013-02-01 10:44:28.449544405 +0100
-@@ -363,7 +363,7 @@ IF(NOT DISABLE_SHARED)
- SET(libmysql_link_flags)
- ENDIF()
+Upstream bug: https://mariadb.atlassian.net/browse/MDEV-5529
+
+However, to stay binary compatible in F20 and lower, we need to use the
+former way.
+
+diff -up mariadb-5.5.36/libmysql/CMakeLists.txt.versioning mariadb-5.5.36/libmysql/CMakeLists.txt
+--- mariadb-5.5.36/libmysql/CMakeLists.txt.versioning 2014-03-06 21:55:33.338842373 +0100
++++ mariadb-5.5.36/libmysql/CMakeLists.txt 2014-03-06 21:55:36.778834151 +0100
+@@ -1,5 +1,4 @@
+-# Copyright (c) 2006, 2013, Oracle and/or its affiliates.
+-# Copyright (c) 2009, 2013, SkySQL Ab.
++# Copyright (c) 2006, 2012, Oracle and/or its affiliates.
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+@@ -26,6 +25,8 @@ ADD_DEFINITIONS(${SSL_DEFINES})
+
+ SET(CLIENT_API_FUNCTIONS_5_1
+ get_tty_password
++handle_options
++load_defaults
+ mysql_thread_end
+ mysql_thread_init
+ myodbc_remove_escape
+@@ -129,12 +130,6 @@ mysql_server_init
+ mysql_server_end
+ mysql_set_character_set
+ mysql_get_character_set_info
+-# These are documented in Paul DuBois' MySQL book,
+-# so we treat them as part of the de-facto API.
+-handle_options
+-load_defaults
+-free_defaults
+-my_print_help
+ )
+
+ SET(CLIENT_API_FUNCTIONS_5_5
+@@ -157,8 +152,6 @@ mysql_close_cont
+ mysql_close_start
+ mysql_commit_cont
+ mysql_commit_start
+-mysql_dump_debug_info_cont
+-mysql_dump_debug_info_start
+ mysql_fetch_row_cont
+ mysql_fetch_row_start
+ mysql_free_result_cont
+@@ -245,76 +238,73 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ # for compatibility with distribution packages, so client shared library can
+ # painlessly replace the one supplied by the distribution.
+
+- # Also list of exported symbols in distributions may differ from what is
+- # considered official API. Define CLIENT_API_5_1_EXTRA for the set of
+- # symbols, that required to be exported on different platforms.
++ # Also list of exported symbols in distributions may differ from what is considered
++ # official API. Define CLIENT_API_EXTRA for the set of symbols, that required to
++ # be exported on different platforms.
+
+- # Fedora & Co declared following functions as part of API
+- SET(CLIENT_API_5_1_EXTRA
+- # why does Fedora export these?
+- _fini
+- _init
+- my_init
+-
+- # mysql-connector-odbc requires these
+- mysql_default_charset_info
+- mysql_get_charset
+- mysql_get_charset_by_csname
+- mysql_net_realloc
+-
+- # PHP's mysqli.so requires this (via the ER() macro)
+- mysql_client_errors
+-
+- # Also export the non-renamed variants
+- # (in case someone wants to rebuild mysqli-php or something similar)
+- # See MDEV-4127
+- default_charset_info
+- get_charset
+- get_charset_by_csname
+- net_realloc
+- client_errors
+-
+- # pure-ftpd requires this
+- my_make_scrambled_password
+-
+- # hydra requires this
+- scramble
+-
+- # ODB requires this: https://bugzilla.redhat.com/show_bug.cgi?id=846602
+- THR_KEY_mysys
+-
+- # DBD::mysql requires this
+- is_prefix
+- )
+-
+- # Linker script to version symbols in Fedora- and Debian- compatible way, MDEV-5529
+- SET(VERSION_SCRIPT_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/libmysql_versions.ld.in)
+-
+- # Generate version script.
+- # Create semicolon separated lists of functions to export from
+- # Since RPM packages use separate versioning for 5.1 API
+- # and 5.5 API (libmysqlclient_16 vs libmysqlclient_18),
+- # we need 2 lists.
+- SET (CLIENT_API_5_1_LIST)
+- SET (CLIENT_API_5_1_ALIASES)
+- FOREACH (f ${CLIENT_API_FUNCTIONS_5_1} ${CLIENT_API_5_1_EXTRA})
+- SET(CLIENT_API_5_1_LIST "${CLIENT_API_5_1_LIST}\t${f};\n")
+- SET(CLIENT_API_5_1_ALIASES "${CLIENT_API_5_1_ALIASES}\"${f}@libmysqlclient_16\" = ${f};\n")
+- ENDFOREACH()
+-
+- SET (CLIENT_API_5_5_LIST)
+- FOREACH (f ${CLIENT_API_FUNCTIONS_5_5})
+- SET(CLIENT_API_5_5_LIST "${CLIENT_API_5_5_LIST}\t${f};\n")
+- ENDFOREACH()
+-
+- CONFIGURE_FILE(
+- ${VERSION_SCRIPT_TEMPLATE}
+- ${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld
+- @ONLY@
+- )
+- SET(VERSION_SCRIPT_LINK_FLAGS
+- "-Wl,${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld")
++ IF(RPM)
++ # Fedora & Co declared following functions as part of API
++ SET(CLIENT_API_EXTRA
++ mysql_default_charset_info
++ mysql_get_charset
++ mysql_get_charset_by_csname
++ mysql_net_realloc
++ mysql_client_errors
++
++ # Also export the non-renamed variants
++ # (in case someone wants to rebuild mysqli-php or something similar)
++ # See MDEV-4127
++ default_charset_info
++ get_charset
++ get_charset_by_csname
++ net_realloc
++ client_errors
++ THR_KEY_mysys
++ )
++
++ # Add special script to fix symbols renames by Fedora
++ SET(CLIENT_SOURCES_EXTRA rpm_support.cc)
++ SET(VERSION_SCRIPT_TEMPLATE
++ ${CMAKE_CURRENT_SOURCE_DIR}/libmysql_rpm_version.in)
++ ELSEIF(DEB)
++ # libmyodbc on Ubuntu is using functions below
++ # If we don't export them, linker would just remove
++ # them (they are not used inside libmysqlclient)
++ SET(CLIENT_API_EXTRA
++ strfill
++ init_dynamic_string
++ )
++ # MySQL supplied with Ubuntu does not have versioning, bug Debian does.
++ IF(DEB MATCHES "debian")
++ SET(VERSION_SCRIPT_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/libmysql.ver.in)
++ ENDIF()
++ ENDIF()
+
++ IF(VERSION_SCRIPT_TEMPLATE)
++ # Generate version script.
++ # Create semicolon separated lists of functions to export from
++ # Since RPM packages use separate versioning for 5.1 API
++ # and 5.5 API (libmysqlclient_16 vs libmysqlclient_18),
++ # we need 2 lists.
++ SET (CLIENT_API_5_1_LIST)
++ FOREACH (f ${CLIENT_API_FUNCTIONS_5_1})
++ SET(CLIENT_API_5_1_LIST "${CLIENT_API_5_1_LIST}\n${f};")
++ ENDFOREACH()
++
++ SET (CLIENT_API_5_5_LIST)
++ FOREACH (f ${CLIENT_API_FUNCTIONS_5_5})
++ SET(CLIENT_API_5_5_LIST "${CLIENT_API_5_5_LIST}\n${f};")
++ ENDFOREACH()
++
++ CONFIGURE_FILE(
++ ${VERSION_SCRIPT_TEMPLATE}
++ ${CMAKE_CURRENT_BINARY_DIR}/libmysql.version
++ @ONLY@
++ )
++ SET(VERSION_SCRIPT_LINK_FLAGS
++ "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/libmysql.version")
++ ENDIF()
++
+ ENDIF()
+
+
+@@ -342,10 +332,8 @@ SET(LIBS clientlib dbug strings vio mysy
+ MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development)
+
+ # Visual Studio users need debug static library for debug projects
+-INSTALL_DEBUG_SYMBOLS(clientlib)
+ IF(MSVC)
+ INSTALL_DEBUG_TARGET(mysqlclient DESTINATION ${INSTALL_LIBDIR}/debug)
+- INSTALL_DEBUG_TARGET(clientlib DESTINATION ${INSTALL_LIBDIR}/debug)
+ ENDIF()
+
+ IF(UNIX)
+@@ -364,7 +352,7 @@ IF(UNIX)
+ ENDIF()
+
+ IF(NOT DISABLE_SHARED)
+- MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_5_1_EXTRA} COMPONENT SharedLibraries)
++ MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} ${CLIENT_API_EXTRA} COMPONENT SharedLibraries)
+ IF(UNIX)
+ # libtool compatability
+ IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE)
+@@ -381,8 +369,11 @@ IF(NOT DISABLE_SHARED)
+ SOVERSION "${SHARED_LIB_MAJOR_VERSION}")
+ IF(LINK_FLAG_NO_UNDEFINED OR VERSION_SCRIPT_LINK_FLAGS)
+ GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS)
++ IF(NOT libmysql_link_flag)
++ SET(libmysql_link_flags)
++ ENDIF()
SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS
- "${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED} ${VERSION_SCRIPT_LINK_FLAGS}")
+ "${libmysql_link_flags} -Wl,--version-script=libmysql.version ${LINK_FLAG_NO_UNDEFINED}")
More information about the scm-commits
mailing list