This patch drops the linking of odbc library to the driver as it's not needed.
Just linking against odbcinst is enough.
The reason is the same as the one explained here:
https://www.postgresql.org/message-id/1769926.65KUyECjFr@nb.usersys.redhat.com
This fixes a problem in isql under s390x architecture.
More information also here:
https://bugzilla.redhat.com/show_bug.cgi?id=1561400
diff -Naur mysql-connector-odbc-5.2.5-src-orig/cmake/FindODBC.cmake mysql-connector-odbc-5.2.5-src/cmake/FindODBC.cmake
--- mysql-connector-odbc-5.2.5-src-orig/cmake/FindODBC.cmake 2018-04-10 16:14:29.219980686 +0200
+++ mysql-connector-odbc-5.2.5-src/cmake/FindODBC.cmake 2018-04-11 15:59:13.064365508 +0200
@@ -106,6 +106,8 @@
IF(NOT ODBC_LIB_DIR)
_FIX_NOPREFIX(ODBC_LINK_FLAGS ${ODBC_CONFIG} "--libs")
+ _FIX_NOPREFIX(ODBC_LIB_PREFIX ${ODBC_CONFIG} "--lib-prefix")
+ SET(ODBCINST_LINK_FLAGS "-L${ODBC_LIB_PREFIX} -lodbcinst")
ENDIF(NOT ODBC_LIB_DIR)
ENDIF(NOT ODBC_CONFIG)
diff -Naur mysql-connector-odbc-5.2.5-src-orig/driver/CMakeLists.txt mysql-connector-odbc-5.2.5-src/driver/CMakeLists.txt
--- mysql-connector-odbc-5.2.5-src-orig/driver/CMakeLists.txt 2018-04-10 16:14:29.212980622 +0200
+++ mysql-connector-odbc-5.2.5-src/driver/CMakeLists.txt 2018-04-11 16:01:41.813735855 +0200
@@ -57,7 +57,7 @@
TARGET_LINK_LIBRARIES(${DRIVER_NAME} myodbc3u
${MYSQL_CLIENT_LIBS} ${ODBCINSTLIB} ${SECURE32_LIB})
ELSE(WIN32)
- SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ODBC_LINK_FLAGS}")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ODBCINST_LINK_FLAGS}")
TARGET_LINK_LIBRARIES(${DRIVER_NAME} ${MYSQL_CLIENT_LIBS} ${CMAKE_THREAD_LIBS_INIT} m)
TARGET_LINK_LIBRARIES(${DRIVER_NAME} myodbc3u)