4509 Tor Didriksen 2012-10-30
Bug#14547920 I_MAIN.BUG13115401 CAUSING VALGRIND REPORT FAILURE ON PB2
Fix various platform-specific problems.
@ configure.cmake
Always check how to do pthread_once.
Do it with '-Werror' if compiler supports it.
@ extra/yassl/src/buffer.cpp
Always include my_config.h first.
@ extra/yassl/src/yassl_int.cpp
Include <pthread.h> as early as possible (symbol conflicts on freebsd).
The callbacks should be C functions (warnings on solaris)
Re-setting yASSL::session_created is not portable (solaris)
@ unittest/gunit/yassl/CMakeLists.txt
The unit tests needs libsocket (solaris)
@ unittest/gunit/yassl/yassl-t.cc
Include <pthread.h> as early as possible
(symbol conflicts on freebsd, missing symbols on solaris).
modified:
configure.cmake
extra/yassl/src/buffer.cpp
extra/yassl/src/yassl_int.cpp
unittest/gunit/yassl/CMakeLists.txt
unittest/gunit/yassl/yassl-t.cc
4508 Anirudh Mangipudi 2012-10-30 [merge]
BUG#11754894: MYISAMCHK ERROR HAS INCORRECT REFERENCE
TO 'MYISAM_SORT_BUFFER_SIZE'
Merging from 5.5 to 5.6
modified:
storage/myisam/myisamchk.c
=== modified file 'configure.cmake'
--- a/configure.cmake 2012-05-15 09:39:47 +0000
+++ b/configure.cmake 2012-10-30 13:49:44 +0000
@@ -325,13 +325,14 @@ ENDIF()
# Figure out threading library
#
FIND_PACKAGE (Threads)
+# Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
+INCLUDE(FindThreads)
FUNCTION(MY_CHECK_PTHREAD_ONCE_INIT)
CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG)
- IF(NOT HAVE_WERROR_FLAG)
- RETURN()
+ IF(HAVE_WERROR_FLAG)
+ SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
ENDIF()
- SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
CHECK_C_SOURCE_COMPILES("
#include <pthread.h>
void foo(void) {}
=== modified file 'extra/yassl/src/buffer.cpp'
--- a/extra/yassl/src/buffer.cpp 2012-07-24 13:24:00 +0000
+++ b/extra/yassl/src/buffer.cpp 2012-10-30 13:49:44 +0000
@@ -23,6 +23,8 @@
*/
+// First include (the generated) my_config.h, to get correct platform defines.
+#include "my_config.h"
#include <string.h> // memcpy
#include "runtime.hpp"
#include "buffer.hpp"
=== modified file 'extra/yassl/src/yassl_int.cpp'
--- a/extra/yassl/src/yassl_int.cpp 2012-10-30 06:14:23 +0000
+++ b/extra/yassl/src/yassl_int.cpp 2012-10-30 13:49:44 +0000
@@ -17,18 +17,19 @@
* draft along with type conversion functions.
*/
+// First include (the generated) my_config.h, to get correct platform defines.
+#include "my_config.h"
+#ifdef __WIN__
+#include<Windows.h>
+#else
+#include <pthread.h>
+#endif
+
#include "runtime.hpp"
#include "yassl_int.hpp"
#include "handshake.hpp"
#include "timer.hpp"
-#ifdef _POSIX_THREADS
- #include "pthread.h"
-#endif
-
-#ifdef __WIN__
- #include<Windows.h>
-#endif
#ifdef HAVE_LIBZ
#include "zlib.h"
#endif
@@ -1627,10 +1628,15 @@ void Session_initialize()
sessionsInstance = NEW_YS Sessions;
}
+extern "C"
+{
+ static void c_session_initialize() { Session_initialize(); }
+}
+
Sessions& GetSessions()
{
- yassl_pthread_once(&session_created, Session_initialize);
+ yassl_pthread_once(&session_created, c_session_initialize);
return *sessionsInstance;
}
@@ -1886,6 +1892,8 @@ extern "C" char *yassl_mysql_strdup(cons
}
+extern "C"
+{
static int
default_password_callback(char * buffer, int size_arg, int rwflag,
void * /* unused: callback_data */)
@@ -1914,7 +1922,7 @@ default_password_callback(char * buffer,
free(passwd);
return passwd_len;
}
-
+}
SSL_CTX::SSL_CTX(SSL_METHOD* meth)
: method_(meth), certificate_(0), privateKey_(0),
@@ -2689,7 +2697,6 @@ extern "C" void yaSSL_CleanUp()
yaSSL::ysDelete(yaSSL::sslFactoryInstance);
yaSSL::ysDelete(yaSSL::sessionsInstance);
yaSSL::ysDelete(yaSSL::errorsInstance);
- yaSSL::session_created= YASSL_PTHREAD_ONCE_INIT;
// In case user calls more than once, prevent seg fault
yaSSL::sslFactoryInstance = 0;
=== modified file 'unittest/gunit/yassl/CMakeLists.txt'
--- a/unittest/gunit/yassl/CMakeLists.txt 2012-10-30 06:14:23 +0000
+++ b/unittest/gunit/yassl/CMakeLists.txt 2012-10-30 13:49:44 +0000
@@ -14,6 +14,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE_DIRECTORIES(
+ ${GTEST_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/unittest/gunit
${CMAKE_SOURCE_DIR}/extra/yassl/include
@@ -29,3 +30,4 @@ SET(CMAKE_CXX_FLAGS ${nowerr_flags})
ADD_EXECUTABLE(yassl-t yassl-t.cc)
TARGET_LINK_LIBRARIES(yassl-t gunit_small sqlgunitlib strings dbug regex)
+TARGET_LINK_LIBRARIES(yassl-t ${LIBSOCKET})
=== modified file 'unittest/gunit/yassl/yassl-t.cc'
--- a/unittest/gunit/yassl/yassl-t.cc 2012-10-30 06:14:23 +0000
+++ b/unittest/gunit/yassl/yassl-t.cc 2012-10-30 13:49:44 +0000
@@ -17,6 +17,12 @@
#include "my_config.h"
#include <gtest/gtest.h>
+#ifdef __WIN__
+#include<Windows.h>
+#else
+#include <pthread.h>
+#endif
+
#include "runtime.hpp"
#include "yassl_int.hpp"
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.6 branch (tor.didriksen:4508 to 4509) Bug#14547920 | Tor Didriksen | 16 Nov |