Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build MySQL after patching #1

Open
uetcis opened this issue Sep 22, 2018 · 5 comments
Open

Cannot build MySQL after patching #1

uetcis opened this issue Sep 22, 2018 · 5 comments
Assignees

Comments

@uetcis
Copy link

uetcis commented Sep 22, 2018

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?

@JacobBarthelmeh JacobBarthelmeh self-assigned this Sep 24, 2018
@JacobBarthelmeh
Copy link
Contributor

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
Copy link
Contributor

Hi CaptainYukinoshitaHachiman,

I updated the README.md to try to make the steps more clearer in this PR (#2). Let me know if there is any build difficulties after the updated steps.

Regards,
Jacob

@uetcis
Copy link
Author

uetcis commented Oct 3, 2018

Now it works for me, thanks a lot!

@uetcis uetcis closed this as completed Oct 3, 2018
@uetcis uetcis reopened this Oct 3, 2018
@uetcis
Copy link
Author

uetcis commented Oct 3, 2018

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

@JacobBarthelmeh
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants