mysql-patch icon indicating copy to clipboard operation
mysql-patch copied to clipboard

Cannot build MySQL after patching

Open uetcis opened this issue 7 years ago • 5 comments
trafficstars

I downloaded MySQL Source Code and ran sudo patch -p1 < wolfssl-mysql-8.0.0.patch -t

Then I copied wolfSSL to mysql-8.0.0/extra/yassl by running this command: sudo cp ~/wolfssl-3.15.3/* extra/yassl/ -r

However when I try to run Make, I got this:

.......

-- WITH_PROTOBUF=bundled
-- PROTOBUF_VERSION_NUMBER is #define GOOGLE_PROTOBUF_VERSION 2006001
-- Using cmake version 3.10.2
-- Not building NDB
-- Using Boost headers from /home/ubuntu/boost/boost_1_60_0
-- MYSQLX - Text log of protobuf messages enabled
-- Library mysqlclient depends on OSLIBS -lpthread;m;rt;atomic;wolfssl;wolfcrypt;dl
CMake Warning at cmake/bison.cmake:20 (MESSAGE):
  Bison executable not found in PATH
Call Stack (most recent call first):
  sql/CMakeLists.txt:707 (INCLUDE)


CMake Warning at cmake/bison.cmake:20 (MESSAGE):
  Bison executable not found in PATH
Call Stack (most recent call first):
  libmysqld/CMakeLists.txt:203 (INCLUDE)


-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;atomic;wolfssl;wolfcrypt;crypt;dl;aio
CMake Deprecation Warning at scripts/CMakeLists.txt:348 (CMAKE_POLICY):
  The OLD behavior for policy CMP0007 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- INSTALL mysqlclient.pc lib/pkgconfig
-- Skipping deb packaging on unsupported platform bionic.
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: _GNU_SOURCE;_FILE_OFFSET_BITS=64;HAVE_CONFIG_H;RAPIDJSON_NO_SIZETYPEDEFINE;HAVE_LIBEVENT1
-- CMAKE_C_FLAGS:  -fPIC -Wall -Wextra -Wformat-security -Wvla -Wmissing-format-attribute -Wundef -Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS:  -fPIC -Wall -Wextra -Wformat-security -Wvla -Wmissing-format-attribute -Wundef -Woverloaded-virtual -Wno-unused-parameter -Wlogical-op
-- CMAKE_C_LINK_FLAGS:  -fuse-ld=gold
-- CMAKE_CXX_LINK_FLAGS:  -fuse-ld=gold
-- CMAKE_C_FLAGS_RELWITHDEBINFO: -O3 -g -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -O3 -g -fno-omit-frame-pointer -fno-strict-aliasing -std=c++11 -DDBUG_OFF
-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/mysql-8.0.0-dmr/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/mysql-8.0.0-dmr/CMakeFiles/CMakeError.log".

Could you please help me build MySQL with WolfSSL?

uetcis avatar Sep 22 '18 03:09 uetcis

Hi,

For the process of building MySQL with wolfSSL these would be the steps:

  1. download MySQL version 8.0.0 and apply patch (looks like you are good there)
  2. cp wolfssl-3.15.3 extra/wolfssl (creates a directory in MySQL/extra called wolfssl and does not reuse extra/yassl)
  3. cd extra/wolfssl/IDE/MYSQL && ./do.sh
  4. remove any yaSSL files left rm -rf extra/yassl
  5. build using cmake with -DWITH_SSL=bundled

Regards, Jacob

JacobBarthelmeh avatar Sep 24 '18 15:09 JacobBarthelmeh

Hi CaptainYukinoshitaHachiman,

I updated the README.md to try to make the steps more clearer in this PR (https://github.com/wolfSSL/mysql-patch/pull/2). Let me know if there is any build difficulties after the updated steps.

Regards, Jacob

JacobBarthelmeh avatar Sep 25 '18 22:09 JacobBarthelmeh

Now it works for me, thanks a lot!

uetcis avatar Oct 03 '18 08:10 uetcis

Well, though now CMake succeeds, unfortunately it seems there's something wrong when building with make.

[ 13%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/buf/buf0buf.cc.o
In file included from /home/ubuntu/mysql-8.0.0-dmr/storage/innobase/buf/buf0buf.cc:64:0:
/home/ubuntu/mysql-8.0.0-dmr/storage/innobase/include/os0thread-create.h: In member function ‘void Runnable::operator()(F&&, Args&& ...)’:
/home/ubuntu/mysql-8.0.0-dmr/storage/innobase/include/os0thread-create.h:97:20: error: ‘bind’ is not a member of ‘std’
   auto task = std::bind(
                    ^~~~
/home/ubuntu/mysql-8.0.0-dmr/storage/innobase/include/os0thread-create.h:97:20: note: suggested alternative: ‘find’
   auto task = std::bind(
                    ^~~~
                    find
storage/innobase/CMakeFiles/innobase.dir/build.make:254: recipe for target 'storage/innobase/CMakeFiles/innobase.dir/buf/buf0buf.cc.o' failed
make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/buf/buf0buf.cc.o] Error 1
CMakeFiles/Makefile2:1328: recipe for target 'storage/innobase/CMakeFiles/innobase.dir/all' failed
make[1]: *** [storage/innobase/CMakeFiles/innobase.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2

uetcis avatar Oct 03 '18 08:10 uetcis

What version of gcc and g++ is being used? If it's newer versions such as 7.0 +, there may be a case where an older version needs to be used. If I remember correctly, some of the MySQL 8.0.0 code outside of wolfSSL changes, does not do well with newer compilers.

When running cmake use -DCMAKE_CXX_COMPILER and -DCMAKE_CC_COMPILER to set the compilers. An example being

cmake . -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_CC_COMPILER=gcc-4.8 -DWITH_SSL=bundled

JacobBarthelmeh avatar Oct 03 '18 16:10 JacobBarthelmeh