Phoenixcoin icon indicating copy to clipboard operation
Phoenixcoin copied to clipboard

Compiling issues with openssl 1.1

Open sats0k opened this issue 6 years ago • 8 comments

Installing a new linux with openssl 1.1 in one of my pc's, i have some errors to compile the wallet.

First thing who i did was to downgrade to openssl 1.0 and the compilation started but faced with another error.

src/bitcoinrpc.cpp:2911:102: error: wrong number of template arguments (2, should be 1) t::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor, ^ In file included from /usr/include/boost/asio.hpp:30:0, from src/bitcoinrpc.cpp:19: /usr/include/boost/asio/basic_socket_acceptor.hpp:73:7: note: provided for ‘template<class Protocol> class boost::asio::basic_socket_acceptor’ class basic_socket_acceptor ^~~~~~~~~~~~~~~~~~~~~ Is there a way to compile without to downgrade openssl?

I tried to change the BN_init to BN_new in the bignum.h file but without any success.

sats0k avatar Jul 15 '18 10:07 sats0k

After some search i found this commit 14c5880 replacing the code in bitcoinrpc.cpp everything builded fine.

sats0k avatar Jul 15 '18 11:07 sats0k

OpenSSL v1.1.x is untested with PXC currently, though v1.0.x should work fine.

It isn't the first time Boost breaks things, though v1.65.1 seems to work fine without the patch.

ghostlander avatar Jul 17 '18 11:07 ghostlander

I finally managed to build the wallet with OpenSSL v1.1 everything seems to work fine but more tests needed I made a fork and changes are on this commit 486112c some of the changes are for gcc 8 Builded on openSUSE Tumbleweed

but remained a warning:

-Ibuild -I/usr/lib64/qt5/mkspecs/linux-g++ -o build/protocol.o src/protocol.cpp src/ ::CMessageHeader(const char*, unsigned int, bool)’: src/protocol.cpp:35:12: warning: ‘char* strncpy(char*, const char*, size_t)’ specified bound 12 equals destination size [-Wstringop-truncation] strncpy(pchCommand, pszCommand, COMMAND_SIZE); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g++ -c -pipe -O2 -D_REENTRANT -fdiagnostics-show-option -Wall -Wextra -Wformat

Replacing strncpy with memcpy the warning disapear but end up with an unworked wallet.

edit: resolved the warning

sats0k avatar Feb 09 '19 06:02 sats0k

The warning of gcc8 [-Wstringop-truncation] resolved on this commit bc1eaa2 everything seems fine now

sats0k avatar Feb 12 '19 11:02 sats0k

Would you make a pull request?

ghostlander avatar Feb 12 '19 15:02 ghostlander

I am new to all of this and to avoid any kind of mistake please check the code and if you find it ok i will do a pull request.

sats0k avatar Feb 12 '19 15:02 sats0k

bignum.h:61 BIGNUM *self = nullptr; seems to break C++03 compatibility. Replaced nullptr with NULL. The rest seems fine.

ghostlander avatar Feb 13 '19 07:02 ghostlander

I have sync my fork with the base.

sats0k avatar Feb 13 '19 11:02 sats0k