depends: Make it possible to build Boost dependency using a clang toolset (./b2 toolset=clang) #18308

pull practicalswift wants to merge 2 commits into bitcoin:master from practicalswift:b2-toolset-clang changing 1 files +7 −3
  1. practicalswift commented at 3:30 pm on March 10, 2020: contributor

    Make it possible to build Boost dependency using a clang toolset (./b2 toolset=clang).

    Submitted as a separate pull as required by MarcoFalke in #18288 (review).

    Fixes #15914.

  2. depends: Make it possible to build Boost dependency using a toolset other than gcc (./b2 toolset=gcc) 43b1bb5087
  3. DrahtBot added the label Build system on Mar 10, 2020
  4. hebasto commented at 7:08 pm on March 10, 2020: member

    Tested 43b1bb5087d1bd35f622e9e545b459e727822cad on Linux Mint 19.3:

     0$ g++ --version | grep g++
     1g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
     2$ clang++ --version | grep clang
     3clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
     4$ rm -rf depends/built/x86_64-pc-linux-gnu/boost
     5$ make -C depends NO_QT=1 NO_UPNP=1 NO_WALLET=1 NO_QR=1 NO_ZMQ=1 > ~/default-log
     6$ rm -rf depends/built/x86_64-pc-linux-gnu/boost
     7$ make -C depends NO_QT=1 NO_UPNP=1 NO_WALLET=1 NO_QR=1 NO_ZMQ=1 CC=clang CXX=clang++ > ~/clang-log
     8$ diff -u ~/default-log ~/clang-log 
     9--- /home/hebasto/default-log	2020-03-10 20:54:11.728978765 +0200
    10+++ /home/hebasto/clang-log	2020-03-10 20:51:48.789642887 +0200
    11@@ -87,49 +87,45 @@
    12 
    13         mkdir -p "bin.v2/libs/filesystem/build"
    14     
    15-common.mkdir bin.v2/libs/system
    16-
    17-        mkdir -p "bin.v2/libs/system"
    18-    
    19 common.mkdir bin.v2/libs/filesystem/build/gcc-7.5.0
    20 
    21         mkdir -p "bin.v2/libs/filesystem/build/gcc-7.5.0"
    22     
    23-common.mkdir bin.v2/libs/system/build
    24+common.mkdir bin.v2/libs/system
    25 
    26-        mkdir -p "bin.v2/libs/system/build"
    27+        mkdir -p "bin.v2/libs/system"
    28     
    29 common.mkdir bin.v2/libs/filesystem/build/gcc-7.5.0/release
    30 
    31         mkdir -p "bin.v2/libs/filesystem/build/gcc-7.5.0/release"
    32     
    33-common.mkdir bin.v2/libs/system/build/gcc-7.5.0
    34+common.mkdir bin.v2/libs/system/build
    35 
    36-        mkdir -p "bin.v2/libs/system/build/gcc-7.5.0"
    37+        mkdir -p "bin.v2/libs/system/build"
    38     
    39 common.mkdir bin.v2/libs/filesystem/build/gcc-7.5.0/release/link-static
    40 
    41         mkdir -p "bin.v2/libs/filesystem/build/gcc-7.5.0/release/link-static"
    42     
    43-common.mkdir bin.v2/libs/system/build/gcc-7.5.0/release
    44+common.mkdir bin.v2/libs/system/build/gcc-7.5.0
    45 
    46-        mkdir -p "bin.v2/libs/system/build/gcc-7.5.0/release"
    47+        mkdir -p "bin.v2/libs/system/build/gcc-7.5.0"
    48     
    49 common.mkdir bin.v2/libs/filesystem/build/gcc-7.5.0/release/link-static/threading-multi
    50 
    51         mkdir -p "bin.v2/libs/filesystem/build/gcc-7.5.0/release/link-static/threading-multi"
    52     
    53-common.mkdir bin.v2/libs/system/build/gcc-7.5.0/release/link-static
    54+common.mkdir bin.v2/libs/system/build/gcc-7.5.0/release
    55 
    56-        mkdir -p "bin.v2/libs/system/build/gcc-7.5.0/release/link-static"
    57+        mkdir -p "bin.v2/libs/system/build/gcc-7.5.0/release"
    58     
    59 common.mkdir bin.v2/libs/filesystem/build/gcc-7.5.0/release/link-static/threading-multi/visibility-hidden
    60 
    61         mkdir -p "bin.v2/libs/filesystem/build/gcc-7.5.0/release/link-static/threading-multi/visibility-hidden"
    62     
    63-common.mkdir bin.v2/libs/system/build/gcc-7.5.0/release/link-static/threading-multi
    64+common.mkdir bin.v2/libs/system/build/gcc-7.5.0/release/link-static
    65 
    66-        mkdir -p "bin.v2/libs/system/build/gcc-7.5.0/release/link-static/threading-multi"
    67+        mkdir -p "bin.v2/libs/system/build/gcc-7.5.0/release/link-static"
    68     
    69 gcc.compile.c++ bin.v2/libs/filesystem/build/gcc-7.5.0/release/link-static/threading-multi/visibility-hidden/codecvt_error_category.o
    70 
    71@@ -159,6 +155,10 @@
    72 
    73     "g++" "-m64"   -fvisibility-inlines-hidden -std=c++11 -fvisibility=hidden   -fPIC   -I/home/hebasto/GitHub/bitcoin/depends/x86_64-pc-linux-gnu/include     -m64 -pthread -O3 -finline-functions -Wno-inline -Wall -fvisibility=hidden  -DBOOST_ALL_NO_LIB=1 -DBOOST_FILESYSTEM_STATIC_LINK=1 -DNDEBUG  -I"." -c -o "bin.v2/libs/filesystem/build/gcc-7.5.0/release/link-static/threading-multi/visibility-hidden/windows_file_codecvt.o" "libs/filesystem/src/windows_file_codecvt.cpp"
    74 
    75+common.mkdir bin.v2/libs/system/build/gcc-7.5.0/release/link-static/threading-multi
    76+
    77+        mkdir -p "bin.v2/libs/system/build/gcc-7.5.0/release/link-static/threading-multi"
    78+    
    79 common.mkdir bin.v2/libs/system/build/gcc-7.5.0/release/link-static/threading-multi/visibility-hidden
    80 
    81         mkdir -p "bin.v2/libs/system/build/gcc-7.5.0/release/link-static/threading-multi/visibility-hidden"
    

    It seems clang++, even CXX=clang++ is passed, is not used.

  5. practicalswift commented at 7:46 pm on March 10, 2020: contributor
    @hebasto Try passing in boost_toolset_linux='clang' boost_cxx='clang++' :) See usage example in #18288.
  6. hebasto commented at 8:40 pm on March 10, 2020: member

    @practicalswift

    Try passing in boost_toolset_linux='clang' boost_cxx='clang++' :) See usage example in #18288.

    Thank you. Now it works.

    But, from my understanding, this PR couldn’t claim to be a fix of #15914 as the case was with usage of CC and CXX variables.

  7. hebasto approved
  8. hebasto commented at 8:44 pm on March 10, 2020: member
    ACK 43b1bb5087d1bd35f622e9e545b459e727822cad, tested on Linux Mint 19.3: depends compiled with boost_toolset_linux='clang' boost_cxx='clang++' command line options, then make && make check.
  9. practicalswift commented at 10:52 am on March 11, 2020: contributor

    But, from my understanding, this PR couldn’t claim to be a fix of #15914 as the case was with usage of CC and CXX variables.

    I see your point. I opened #15914 and my issue is fixed as long as I have a way to build Boost using Clang by setting environment variables :) I’ve now updated #15914 to clarify that.

    I don’t know enough about how the depends build system is supposed to work so I’ll let someone else tackle the interaction between boost_toolset_linux <> CC and boost_cxx <> CXX. Note that one complication is that boost_toolset_linux must be gcc or clang also when the compiler is say gcc-8 or clang-10.

  10. MarcoFalke commented at 11:45 am on March 11, 2020: member
  11. laanwj commented at 2:04 pm on March 11, 2020: member

    Concept ACK.

    I understand that this solves your immediate problem, but also think that heeding CXX/CC instead of needing boost-specific environment magic (please document this!) would be more consistent.

  12. MarcoFalke commented at 2:07 pm on March 11, 2020: member

    This seems reasonable to do if it doesn’t break anything like our gitian or guix builds, which is why I pinged fanquake and dongcarl.

    For the next release, 0.21, there won’t be any boost hopefully.

  13. build: Build boost with "./b2 toolset=clang" if CXX contains clang 0f111aaa8d
  14. practicalswift commented at 4:14 pm on March 11, 2020: contributor

    @hebasto @laanwj Pushed another commit. The following should now work:

    0$ make -C depends/ clean
    1$ make -C depends/ NO_QT=1 NO_UPNP=1 NO_WALLET=1 NO_QR=1 NO_ZMQ=1 V=1 CXX=clang++-8
    

    Please note that clang is special-cased due to b2 wanting toolset=clang (and not toolset=clang-8, toolset=clang++-8, etc.). Leaving the gcc handling as-is.

  15. practicalswift renamed this:
    depends: Make it possible to build Boost dependency using a toolset other than gcc (./b2 toolset=gcc)
    depends: Make it possible to build Boost dependency using a clang toolset (./b2 toolset=clang)
    on Mar 11, 2020
  16. Sjors commented at 2:41 pm on March 12, 2020: member

    On macOS 10.15.3 I don’t see any difference with 0f111aaa8d8dd6cf9714518d59f64eb06de16971, which I assume is good news, because it always uses clang. src/bitcoind also still compiles.

     0cd depends
     1make
     2....
     3/Users/sjors/dev/bitcoin-depends/depends/work/download/boost-1_70_0/boost_1_70_0.tar.bz2.temp: OK
     4Extracting boost...
     5/Users/sjors/dev/bitcoin-depends/depends/sources/boost_1_70_0.tar.bz2: OK
     6Preprocessing boost...
     7Configuring boost...
     8Building Boost.Build engine with toolset darwin... tools/build/src/engine/bin.macosxx86_64/b2
     9Unicode/ICU support for Boost.Regex?... disabled.
    10Generating Boost.Build configuration in project-config.jam for darwin...
    11
    12Bootstrapping is done. To build, run:
    13
    14    ./b2
    15...
    16clang-darwin.compile.c++ bin.v2/libs/filesystem/build/clang-darwin-11.0/release/link-static/threading-multi/visibility-hidden/codecvt_error_category.o
    17...
    
  17. dongcarl commented at 5:02 pm on March 12, 2020: member
    Going to look into fixing this at a more fundamental level… The depends/hosts files need some tuneup.
  18. practicalswift commented at 5:05 pm on March 12, 2020: contributor
    @dongcarl Excellent news! I’d be glad to close this PR as soon as we have a better alternative. Don’t hesitate to ping me for review :)
  19. practicalswift closed this on Mar 18, 2020

  20. fanquake referenced this in commit 98ebe7896d on May 30, 2020
  21. sidhujag referenced this in commit 6a357d4f47 on May 31, 2020
  22. practicalswift deleted the branch on Apr 10, 2021
  23. DrahtBot locked this on Aug 18, 2022

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: 2024-11-17 09:12 UTC

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