[build] Add risc-v support to gitian #13665

pull ken2812221 wants to merge 2 commits into bitcoin:master from ken2812221:gitian-risc-v changing 12 files +72 −16
  1. ken2812221 commented at 4:08 am on July 15, 2018: contributor
    Based on ~#13660~ #13710 , add gitian tarball for RISC-V
  2. fanquake added the label Build system on Jul 15, 2018
  3. fanquake requested review from laanwj on Jul 16, 2018
  4. DrahtBot added the label Needs rebase on Jul 16, 2018
  5. ken2812221 force-pushed on Jul 16, 2018
  6. laanwj commented at 2:26 pm on July 17, 2018: member
    ACK but only after we can compile with a compiler that doesn’t produce a broken test_bitcoin. If inlining is broken, who knows what other bugs are introduced. (see #13543 (comment) and following comments) Maybe Ubuntu will provide a newer version of gcc at some point.
  7. DrahtBot removed the label Needs rebase on Jul 17, 2018
  8. ken2812221 force-pushed on Jul 18, 2018
  9. ken2812221 commented at 8:16 pm on July 18, 2018: contributor
    @laanwj How about force it to use gcc-8?
  10. laanwj commented at 2:09 pm on July 19, 2018: member
    Yes, that was what I meant. But how?
  11. ken2812221 commented at 3:44 pm on July 19, 2018: contributor
    Just see what I do in the fourth commit.
  12. laanwj commented at 4:38 pm on July 19, 2018: member

    Didn’t know that a package for that was available! Can someone confirm that the resulting test_bitcoin runs without issues?

    Edit: interesting; I wonder if this is the only way to get the -8 variant to be used. If there’s no update-alternatives incantation to update the symlinks. This would be more convenient for the build guide.

    Edit no, apparently the risc-v compiler packages do not provide alternatives

  13. MarcoFalke added the label Needs gitian build on Jul 19, 2018
  14. laanwj commented at 4:55 pm on July 19, 2018: member
    Concept ACK
  15. laanwj requested review from theuni on Jul 19, 2018
  16. ken2812221 force-pushed on Jul 19, 2018
  17. in contrib/gitian-descriptors/gitian-linux.yml:23 in 0b2248cdcf outdated
    24+- "g++-riscv64-linux-gnu"
    25+- "g++-8-riscv64-linux-gnu"
    26+- "gcc-8-riscv64-linux-gnu"
    27+- "binutils-riscv64-linux-gnu"
    28+- "g++-8-multilib"
    29+- "gcc-8-multilib"
    


    theuni commented at 5:49 pm on July 19, 2018:
    I suspect that this will cause more glibc back-compat issues. That’s fine, of course, they just need to be accounted for.

    ken2812221 commented at 6:16 pm on July 19, 2018:
    I’ve tested this. make -C src check-symbol is happy about this in gitian build.
  18. in depends/packages/qt.mk:95 in 0b2248cdcf outdated
    91@@ -92,6 +92,8 @@ $(package)_config_opts_linux += -no-opengl
    92 $(package)_config_opts_arm_linux += -platform linux-g++ -xplatform bitcoin-linux-g++
    93 $(package)_config_opts_i686_linux  = -xplatform linux-g++-32
    94 $(package)_config_opts_x86_64_linux = -xplatform linux-g++-64
    95+$(package)_config_opts_aarch64_linux = -xplatform linux-aarch64-gnu-g++
    


    theuni commented at 5:51 pm on July 19, 2018:
    This shouldn’t be needed after #13696 (comment).

    ken2812221 commented at 6:17 pm on July 19, 2018:
    This is not my commit, just based on #13696
  19. in src/compat/glibc_compat.cpp:70 in 0b2248cdcf outdated
    66@@ -67,6 +67,8 @@ __asm(".symver log2f_old,log2f@GLIBC_2.2.5");
    67 __asm(".symver log2f_old,log2f@GLIBC_2.4");
    68 #elif defined(__aarch64__)
    69 __asm(".symver log2f_old,log2f@GLIBC_2.17");
    70+#elif defined(__riscv)
    


    theuni commented at 5:52 pm on July 19, 2018:
    Is this necessary? We don’t have to support much back-compat for riscv, as its glibc support is pretty new anyway.

    ken2812221 commented at 6:17 pm on July 19, 2018:
    This might not be necessary. But we should drop --enable-glibc-back-compat flag when building for RISC-V

    laanwj commented at 6:39 pm on July 19, 2018:
    I think he did this to appease the symbols check, the alternative would be to do a different symbols check per target platform.

    ken2812221 commented at 6:45 pm on July 19, 2018:
    I did this so the linker would know what log2f_old is.
  20. theuni commented at 5:55 pm on July 19, 2018: member

    Concept ACK, but I don’t think it’s wise for us to be producing supported binaries for a platform that’s still going through teething issues with compilers. Especially since so few people are able to test.

    I’m all for it for 0.18, but -1 from me for 0.17.

  21. laanwj added this to the milestone 0.18.0 on Jul 20, 2018
  22. laanwj commented at 10:05 am on July 20, 2018: member

    I’m all for it for 0.18, but -1 from me for 0.17.

    Added appropriate milestone

  23. DrahtBot removed the label Needs gitian build on Jul 21, 2018
  24. DrahtBot commented at 1:32 pm on July 22, 2018: member
    • #13724 ([contrib] Support ARM and RISC-V symbol check by ken2812221)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  25. ken2812221 renamed this:
    [build] Add risc-v support to gitian
    [WIP][build] Add risc-v support to gitian
    on Jul 22, 2018
  26. DrahtBot added the label Needs rebase on Jul 29, 2018
  27. ken2812221 force-pushed on Aug 6, 2018
  28. DrahtBot removed the label Needs rebase on Aug 6, 2018
  29. MarcoFalke deleted a comment on Aug 7, 2018
  30. MarcoFalke added the label Needs gitian build on Aug 7, 2018
  31. DrahtBot removed the label Needs gitian build on Aug 8, 2018
  32. MarcoFalke commented at 4:43 pm on August 8, 2018: member

    gitian linux failure:

     0ERROR: Feature 'system-zlib' was enabled, but the pre-condition 'libs.zlib' failed.
     1
     2ERROR: Feature 'openssl-linked' was enabled, but the pre-condition '!features.securetransport && libs.openssl' failed.
     3
     4ERROR: Feature 'xcb' was enabled, but the pre-condition 'libs.xcb' failed.
     5
     6ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed.
     7
     8ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig' failed.
     9funcs.mk:242: recipe for target '/home/ubuntu/build/bitcoin/depends/work/build/riscv64-linux-gnu/qt/5.9.6-c69c157d1d9/qtbase/.stamp_configured' failed
    10make: *** [/home/ubuntu/build/bitcoin/depends/work/build/riscv64-linux-gnu/qt/5.9.6-c69c157d1d9/qtbase/.stamp_configured] Error 3
    11make: Leaving directory '/home/ubuntu/build/bitcoin/depends'
    
  33. [depends] Add riscv qt depends support for cross compiling bitcoin-qt 96dda8b058
  34. Add risc-v 64-bit to gitian c4aecd1d80
  35. ken2812221 force-pushed on Aug 8, 2018
  36. ken2812221 commented at 7:36 pm on August 8, 2018: contributor
    @MarcoFalke Sry, missing one line during rebasing #13710
  37. MarcoFalke deleted a comment on Aug 8, 2018
  38. MarcoFalke added the label Needs gitian build on Aug 8, 2018
  39. DrahtBot removed the label Needs gitian build on Aug 9, 2018
  40. ken2812221 commented at 5:37 am on August 9, 2018: contributor
    @MarcoFalke @DrahtBot fetch the wrong commit.
  41. MarcoFalke deleted a comment on Aug 9, 2018
  42. MarcoFalke added the label Needs gitian build on Aug 9, 2018
  43. DrahtBot removed the label Needs gitian build on Aug 10, 2018
  44. laanwj commented at 4:20 pm on August 15, 2018: member
    What is the reason this is still WIP? would like to merge this early in the 0.18 cycle if possible. (going to test)
  45. ken2812221 commented at 4:31 pm on August 15, 2018: contributor
    @laanwj You can see @DrahtBot ’s binary, it exports so many unnecessary symbols
  46. laanwj commented at 8:50 am on August 16, 2018: member

    I’m not sure how worried we should be about exporting unnecessary symbols on RISC-V at this point, from what I gather everything is still extremely experimental, there aren’t even ready-to-use linux distribution images.

    The “don’t export unnecessary symbols” check was, at the time, added to avoid collisions between statically-linked and dynamically-linked OpenSSL, back in the day that Qt was still linked dynamically. This is no longer an actual issue. Now it’s only a “nice” sanity and hygiene check, to avoid the overhead of huge unnecessary symbol tables in an executable.

    So I don’t think that needs to hold back progress, seems like be something that is improved in a later PR, but I’ll leave it up to you.

  47. ken2812221 renamed this:
    [WIP][build] Add risc-v support to gitian
    [build] Add risc-v support to gitian
    on Aug 16, 2018
  48. ken2812221 commented at 10:52 am on August 16, 2018: contributor
    @laanwj Thanks for clarification. The export symbol things can be done in future PR. At least I can’t solve the problem for now, leave for someone who can work on improving this.
  49. MarcoFalke added the label Needs gitian build on Aug 16, 2018
  50. laanwj commented at 6:32 pm on August 16, 2018: member

    ACK c4aecd1d8 gitian build result tested on actual hardware (HiFive Unleashed=U540) w/ Fedora release 29 (Rawhide):

    0# ./test_bitcoin 
    1Running 303 test cases...
    2test/scheduler_tests.cpp(141): info: counter2++
    3test/scheduler_tests.cpp(141): info: counter2++
    4test/scheduler_tests.cpp(145): info:  == 
    5test/scheduler_tests.cpp(145): info: i          
    6*** No errors detected
    

    Also synced the beginning of the chain, I’ll keep this node running.

    Going to merge this because I want to keep building for RISC-V on the 0.18 branch. If any issues come up we can revert this before the 0.18.0 release.

  51. ken2812221 referenced this in commit 3c8d1ae153 on Aug 16, 2018
  52. laanwj merged this on Aug 16, 2018
  53. laanwj closed this on Aug 16, 2018

  54. ken2812221 deleted the branch on Aug 16, 2018
  55. MarcoFalke removed the label Needs gitian build on Aug 17, 2018
  56. laanwj commented at 5:36 am on August 23, 2018: member

    Also synced the beginning of the chain, I’ll keep this node running.

    This was successful! Synchronization of the full chain on the HiFive Unleashed board to a nbd partition took about 2-3 days. (had to restart at some point as there were problems with the SD card interface or driver, but there were zero issues with bitcoind)

  57. MarcoFalke deleted a comment on Aug 23, 2018
  58. MarcoFalke deleted a comment on Aug 23, 2018
  59. Munkybooty referenced this in commit ca1010210a on Sep 8, 2021
  60. MarcoFalke locked this on Sep 8, 2021


ken2812221 laanwj theuni DrahtBot MarcoFalke


laanwj

Labels
Build system

Milestone
0.18.0


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-07-05 22:12 UTC

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