From 8bd70f6d4428602dbb0931fa13683ac84a2d9dae Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Mon, 30 May 2016 01:21:44 +0300 Subject: qbittorrent, libtorrent: Boost.Asio is header only Fix link errors in qbittorrent after libtorrent-rasterbar 1.1.0. Disable BOOST_ASIO_SEPARATE_COMPILATION See http://www.boost.org/doc/libs/1_45_0/doc/html/boost_asio/using.html --- plugins/apps/qbittorrent-1-fixes.patch | 38 ++++++++++++++++++++++++++++++++++ src/libtorrent-rasterbar-1-fixes.patch | 33 +++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 src/libtorrent-rasterbar-1-fixes.patch diff --git a/plugins/apps/qbittorrent-1-fixes.patch b/plugins/apps/qbittorrent-1-fixes.patch index e5e19c6..457f35b 100644 --- a/plugins/apps/qbittorrent-1-fixes.patch +++ b/plugins/apps/qbittorrent-1-fixes.patch @@ -54,3 +54,41 @@ index 1111111..2222222 100755 if test -r "$QT_QMAKE/qmake-qt4"; then eval "$as_ac_File=yes" else + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Boris Nagaev +Date: Mon, 30 May 2016 00:09:20 +0200 +Subject: [PATCH] disable BOOST_ASIO_SEPARATE_COMPILATION + +After upgrading libtorrent-rasterbar to 1.1.0, qbittorrent fails to link +main executable with undefined symbols in boost_asio: + + ./release/application.o:application.cpp:(.text.startup+0x83): + undefined reference to `boost::asio::detail::winsock_init_base::startup + (boost::asio::detail::winsock_init_base::data&, unsigned char, + unsigned char)' + +diff --git a/cmake/Modules/winconf.cmake b/cmake/Modules/winconf.cmake +index 1111111..2222222 100644 +--- a/cmake/Modules/winconf.cmake ++++ b/cmake/Modules/winconf.cmake +@@ -5,7 +5,6 @@ + set(LibtorrentRasterbar_USE_STATIC_LIBS True) + set(LibtorrentRasterbar_CUSTOM_DEFINITIONS + -DBOOST_ALL_NO_LIB -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 +- -DBOOST_ASIO_SEPARATE_COMPILATION + -DBOOST_EXCEPTION_DISABLE + -DBOOST_SYSTEM_STATIC_LINK=1 + -DTORRENT_USE_OPENSSL +diff --git a/winconf.pri b/winconf.pri +index 1111111..2222222 100644 +--- a/winconf.pri ++++ b/winconf.pri +@@ -21,7 +21,6 @@ LIBS += $$quote(-LC:/qBittorrent/openssl/lib) + # LIBTORRENT DEFINES + DEFINES += BOOST_ALL_NO_LIB + DEFINES += BOOST_ASIO_HASH_MAP_BUCKETS=1021 +-DEFINES += BOOST_ASIO_SEPARATE_COMPILATION + # After 1.55 some Windows users reported regular UI freezes. + # This makes ASIO use the pre-1.56 way of doing things. See issue #2003 + DEFINES += BOOST_ASIO_DISABLE_CONNECTEX diff --git a/src/libtorrent-rasterbar-1-fixes.patch b/src/libtorrent-rasterbar-1-fixes.patch new file mode 100644 index 0000000..0e43d23 --- /dev/null +++ b/src/libtorrent-rasterbar-1-fixes.patch @@ -0,0 +1,33 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Boris Nagaev +Date: Mon, 30 May 2016 00:10:30 +0200 +Subject: [PATCH] disable BOOST_ASIO_SEPARATE_COMPILATION + +After upgrading libtorrent-rasterbar to 1.1.0, qbittorrent fails to link +main executable with undefined symbols in boost_asio: + + ./release/application.o:application.cpp:(.text.startup+0x83): + undefined reference to `boost::asio::detail::winsock_init_base::startup + (boost::asio::detail::winsock_init_base::data&, unsigned char, + unsigned char)' + +diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp +index 1111111..2222222 100644 +--- a/include/libtorrent/config.hpp ++++ b/include/libtorrent/config.hpp +@@ -64,10 +64,6 @@ POSSIBILITY OF SUCH DAMAGE. + #error TORRENT_DEBUG_BUFFERS only works if you also disable pool allocators with TORRENT_DISABLE_POOL_ALLOCATOR + #endif + +-#if !defined BOOST_ASIO_SEPARATE_COMPILATION && !defined BOOST_ASIO_DYN_LINK +-#define BOOST_ASIO_SEPARATE_COMPILATION +-#endif +- + #ifndef _MSC_VER + #ifndef __STDC_FORMAT_MACROS + #define __STDC_FORMAT_MACROS 1 -- cgit v0.12