gitian: Build OpenSSL and Boost dependencies for linux #3545

pull laanwj wants to merge 6 commits into bitcoin:master from laanwj:2014_01_linux_gitian_boost changing 6 files +94 −19
  1. laanwj commented at 8:53 PM on January 15, 2014: member

    After these changes, openssl and boost are built statically in the linux build and use the same versions as the win32 build.

    elfread -d now reports

    bitcoind:

    0x00000001 (NEEDED)                     Shared library: [librt.so.1]
    0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
    0x00000001 (NEEDED)                     Shared library: [libm.so.6]
    0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
    0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
    0x00000001 (NEEDED)                     Shared library: [libc.so.6]
    

    bitcoin-qt:

    0x00000001 (NEEDED)                     Shared library: [librt.so.1]
    0x00000001 (NEEDED)                     Shared library: [libQtGui.so.4]
    0x00000001 (NEEDED)                     Shared library: [libQtNetwork.so.4]
    0x00000001 (NEEDED)                     Shared library: [libQtCore.so.4]
    0x00000001 (NEEDED)                     Shared library: [libQtDBus.so.4]
    0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
    0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
    0x00000001 (NEEDED)                     Shared library: [libm.so.6]
    0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
    0x00000001 (NEEDED)                     Shared library: [libc.so.6]
    
  2. theuni commented at 10:36 PM on January 15, 2014: member

    Nack on the boost changes.

    The user does not control whether we link against shared libs or static, the linker does. The linker can be explicitly told what to do by passing something like "LDFLAGS=-static". Having an option for it does not make sense.

    Instead, we should test with -DBOOST_TEST_DYN_LINK, and store the pass/fail result as a way of knowing whether we're shared or static. Basically, if it links with the define, use the define.

    As for librt, that should not be hard-coded, because it's implementation-specific and may or may not be in librt. AC_SEARCH_LIBS should be used instead.

  3. laanwj commented at 10:40 PM on January 15, 2014: member

    I'm not happy with the --with-static-boost either, but for me it was the only way to get it to work. Feel free to improve on it later.

  4. theuni commented at 10:43 PM on January 15, 2014: member

    If you're trying to reduce build-time for boost, you should specify on the modules you want, that avoids building/installing the ones we don't use. Something like:

    --with-system --with-filesystem --with-program_options --with-thread --with-chrono
    
  5. theuni commented at 10:45 PM on January 15, 2014: member

    I just explained how to make it work. Is there a rush here?

  6. laanwj commented at 10:54 PM on January 15, 2014: member

    Indeed, specifying the modules is a possibility to make the boost build even faster. I may do that later. We don't use the trigonometry and geometry and such modules and we likely never will for bitcoin :)

    No rush but I'm happy to see this working at all. I've been working for two days on gitian building stuff and I'm sick and tired of it.

    I suck at autotools and if there was a way to do the -DBOOST_TEST_DYN_LINK/-lrt stuff without touching configure.ac I'd have preferred that, but I didn't find a way. What you propose sounds like the better solution, no argument there...

  7. wtogami commented at 6:09 AM on January 16, 2014: contributor

    c665d663e0bae284a23076160e4ffa77450480489199955c0c8b561de577a464 bitcoin-deps-linux32-gitian-r2.tar.gz 91f8c787aeb263f88ac812f61d5585480451121b8b755cb46214735693205299 bitcoin-deps-linux64-gitian-r2.tar.gz

    Do your builds match?

  8. wtogami commented at 6:27 AM on January 16, 2014: contributor

    1a0100fe7ad0fb77ed51b46dc8c82f25528023e8c2953fbab9b9ff6de54164f7 boost-linux32-1.55.0-gitian-r1.tar.gz e9490de332efe04e4c6b65c5a1d4b6cc4bbfef22ec9351e5bcafdabd3c669d9c boost-linux64-1.55.0-gitian-r1.tar.gz

  9. theuni commented at 7:03 AM on January 16, 2014: member

    99% chance tarballs won't match without: #3546 (comment)

  10. laanwj commented at 8:04 AM on January 16, 2014: member

    @wtogami I haven't focused on determinism of the intermediate outputs yet at all. Let's first make sure that the build works and produces correct executables.

  11. wtogami commented at 8:07 AM on January 16, 2014: contributor

    @laanwj Executables produced seem to work as expected on Fedora 20.

  12. laanwj commented at 8:19 AM on January 16, 2014: member

    Thanks for testing!

  13. laanwj commented at 9:15 AM on January 16, 2014: member

    Going to rebase and use a .zip for the built boost dependency as well. @theuni I've thought about the static boost link bit:

    • The libboost_chrono on -lrt dependency should be handled outside our autoconf, as bitcoin should indeed not care about the dependencies of dependencies.
    • As for -DBOOST_TEST_DYN_LINK I'm going to follow your solution and add a test with/without.

    Edit: darn, .la files are simply ignored, libtool is not used for the autoconf tests.

  14. build: Auto-detect whether -DBOOST_TEST_DYN_LINK is needed
    Use AC_LINK_IFELSE to auto-detect whether boost test is linked
    dynamically, instead of assuming based on target.
    e4b991e56d
  15. build: Allow providing extra libs for Boost Chrono
    Pass BOOST_CHRONO_EXTRALIBS to give extra dependency
    libraries for Boost Chrono which are not auto-detected.
    0d40f5a6be
  16. build: Pass BOOST_CPPFLAGS to sleep implementation test
    Makes sure that `-pthread` and other flags required for boost
    compilation are passed.
    714cdecb03
  17. gitian: Reduce build time for boost windows dependency
    Build only the mt-s (multithreaded, static runtime link)
    variant of the library.
    
    This cuts the build time in half.
    
    Also prevent unpacked boost from ending up in output directory,
    checking and hashing all the source files as output files this
    takes a lot of time and is pointless.
    7eb99a844f
  18. gitian: Build boost dependency for linux
    Instead of using the boost provided by Ubuntu 12.04, build our own
    dependency like we do for Windows.
    
    This allows using a much newer version (1.55 versus 1.46) as well as
    building with `-fPIC` so that `-pie` can be used in the x86-64 build.
    64be7f7892
  19. gitian: Add openssl to linux deps
    Build OpenSSL instead of using distribution-provided
    library.
    1cbbeb6a27
  20. laanwj commented at 11:45 AM on January 16, 2014: member

    Ok I added a check for -DBOOST_TEST_DYN_LINK. It's not being assumed based on the platform anymore.

    I've also removed the option --with-static-boost. There is now an undocumented environment variable BOOST_CHRONO_EXTRALIBS to specify extra libraries for Boost Chrono. This is not perfect either, but at least doesn't have as much impact on the configure.ac script. It would be great if other ways to specify implied dependencies between libraries (such as .la) worked.

  21. BitcoinPullTester commented at 1:39 PM on January 16, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/7f51b918109263501de1592e647ebf136e1cd5be for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  22. wtogami commented at 10:01 AM on January 18, 2014: contributor

    2ee4dfb8c7351a95859b6b19f2568841326f1ae7f4b2c74ef7477bd0496261e9 bitcoin-deps-linux32-gitian-r2.zip 82e27e988049a6a9384e377c10cd0997a580dfb44eabdab068f3af1fada22c2c bitcoin-deps-linux64-gitian-r2.zip

    0f44759738bff1eaa1284e7f53e51b0679658c0161d9e085b4d5ea4fa70fdab8 boost-linux32-1.55.0-gitian-r1.zip 03c959bbda6d085146b84f75c2973fda66072145eebf2269a099c5030be912f6 boost-linux64-1.55.0-gitian-r1.zip

    ACK

  23. laanwj referenced this in commit 490d6a3046 on Jan 18, 2014
  24. laanwj merged this on Jan 18, 2014
  25. laanwj closed this on Jan 18, 2014

  26. theuni commented at 8:02 PM on January 18, 2014: member

    @laanwj Any time you link a static lib you have to worry about dependencies of dependencies. It comes with the territory. It's been "solved" many times via libtool, pkgconfig, etc. In this case, as boost doesn't ship a .pc and we're not using libtool, so it's our responsibility to solve it. It's a major strike against boost in my opinion, but one that many projects are forced to deal with.

    Either way, the lib containing clock_gettime isn't harmful for any OS, so I really suggest adding that as a general dependency. It's almost guaranteed that we'll need those symbols eventually.

  27. laanwj deleted the branch on Apr 9, 2014
  28. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me