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

libtorrent 1.2.6 + python310 + boost > 1.70 build error gcc 4.9.x #6928

Closed
th0ma7 opened this issue Jun 18, 2022 · 5 comments
Closed

libtorrent 1.2.6 + python310 + boost > 1.70 build error gcc 4.9.x #6928

th0ma7 opened this issue Jun 18, 2022 · 5 comments

Comments

@th0ma7
Copy link
Contributor

th0ma7 commented Jun 18, 2022

Please provide the following information

libtorrent version (or branch): 1.2.6

platform/architecture: any (currently testing on x64, but also fails on arm5-7-8/i686/ppc)

compiler and compiler version: gcc-4.9.3

Linux version: Synology toolchain for DSM-6 Linux uses gcc-4.9.x.

It is possible to have a successful build with boost 1.70 using gcc-4.9. libtorrent fails to build with any version of boost after that using that gcc version. Note that this is only seen with gcc-4.9 as it does build properly using gcc-7.5 on the newer Synology DSM-7.

See attached log.

boost-1.76_build-x64-6.1.log

@th0ma7 th0ma7 changed the title libtorrent 1.2.6 + python310 + boost > 1.70 built error gcc 4.9.x libtorrent 1.2.6 + python310 + boost > 1.70 build error gcc 4.9.x Jun 18, 2022
@arvidn
Copy link
Owner

arvidn commented Jun 18, 2022

The problem is that the entry class uses a C++14 feature in its std::map (transparent comparators). Since 1.2.x doesn't require C++11, use of this feature is detected based on whether the compiler supports it or not.

If the library is built with a compiler that supports C++14, the resulting library may not be able to be used by a client building in C++11 mode.

@th0ma7
Copy link
Contributor Author

th0ma7 commented Jun 18, 2022

Trying to make mileage on that, could that be because boost ended-up detecting c++1y compatibility of gcc-4.9.x and used it, leading to inhability for libtorrent to build properly afterwards even if I pass it --b2-args=cxxstd=1y.

The solution could then be to enforce c++11 when building boost so it works out properly with libtorrent afterwards using --b2-args=cxxstd=11?

@arvidn
Copy link
Owner

arvidn commented Jun 19, 2022

it's possible my conclusion above is incorrect. I don't think the version of boost would affect this.

You're saying that the exact same setup, but with a different boost version will built?

@userdocs
Copy link

userdocs commented Jun 19, 2022

i saw this if it helps.

/home/spksrc/deluge-strangelovian-4/spksrc/spk/include/boost/multiprec/deluge/work-x64-6.1/install//var/packages/deluge/targetision/detail/number_base.hpp:36:2: error: #error "This library now requires a C++11 or later compiler - this message was generated as a result of BOOST_NO_CXX11_HDR_TYPE_TRAITS being set"
#error "This library now requires a C++11 or later compiler - this message was generated as a result of BOOST_NO_CXX11_HDR_TYPE_TRAITS being set"

I'll add the whole bit

gcc.compile.c++ ../../bin/gcc-4.9.3/release/address-model-64/crypto-openssl/cxxstd-1y-iso/libtorrent-python-pic-on/link-static/lt-visibility-hidden/threading-multi/src/peer_connection.o
In file included from /home/spksrc/deluge-strangelovian-4/spksrc/spk/deluge/work-x64-6.1/install//var/packages/deluge/target/include/boost/multiprecision/traits/is_variable_precision.hpp:9:0,
			   from /home/spksrc/deluge-strangelovian-4/spksrc/spk/deluge/work-x64-6.1/install//var/packages/deluge/target/include/boost/multiprecision/detail/precision.hpp:9,
			   from /home/spksrc/deluge-strangelovian-4/spksrc/spk/deluge/work-x64-6.1/install//var/packages/deluge/target/include/boost/multiprecision/number.hpp:13,
			   from /home/spksrc/deluge-strangelovian-4/spksrc/spk/deluge/work-x64-6.1/install//var/packages/deluge/target/include/boost/multiprecision/cpp_int.hpp:12,
			   from ../../include/libtorrent/pe_crypto.hpp:41,
			   from ../../include/libtorrent/bt_peer_connection.hpp:55,
			   from ../../src/peer_connection.cpp:53:
/home/spksrc/deluge-strangelovian-4/spksrc/spk/deluge/work-x64-6.1/install//var/packages/deluge/target/include/boost/multiprecision/detail/number_base.hpp:36:2: error: #error "This library now requires a C++11 or later compiler - this message was generated as a result of BOOST_NO_CXX11_HDR_TYPE_TRAITS being set"
#error "This library now requires a C++11 or later compiler - this message was generated as a result of BOOST_NO_CXX11_HDR_TYPE_TRAITS being set"

@th0ma7
Copy link
Contributor Author

th0ma7 commented Aug 28, 2022

I was able to solve this issue. My PR related to deluge package can be found here: SynoCommunity/spksrc#5398

Basically what I ended-up doing is:

  1. Use boost_1.78 with a patch https://github.com/SynoCommunity/spksrc/pull/5398/files#diff-df540bb06007666bf7ab3b5b7647ce5de3938ce9e7ece35a7fc0fb890cfdd9fe
  2. Enforce using -std=c++11 when building boost
  3. Enforce using -std=c++11 when building libtorrent (e.g. ensure both uses exactly the same options, period) through --b2-args=cxxstd=11 option
  4. Used --b2-args=address-model=32 --no-autoconf=address-model build option for 32-bit archs
  5. Always use --b2-args=libtorrent-python-pic=on

Thnx for you help.

@th0ma7 th0ma7 closed this as completed Aug 28, 2022
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

3 participants