gitian-linux: Build binaries for 64-bit POWER #14066

pull luke-jr wants to merge 7 commits into bitcoin:master from luke-jr:gitian_power64 changing 8 files +66 −31
  1. luke-jr commented at 1:38 AM on August 26, 2018: member

    A set of both big and little endian binaries, should be compatible with PowerPC 970 (Apple G5) and newer.

    Also splits libpng out of Qt (since Qt's bundled copy is broken on POWER) and disables JPEG (since we don't use it).

    Tested only the little endian variant, on Gentoo.

    (Based on #14065)

  2. fanquake added the label Build system on Aug 26, 2018
  3. DrahtBot commented at 4:26 AM on August 26, 2018: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #20451 (lint: run mypy over contrib/devtools by fanquake)
    • #20434 (contrib: Parse ELF directly for symbol and security checks by laanwj)
    • #18605 (build: Link time garbage collection by fanquake)

    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.

  4. DrahtBot cross-referenced this on Aug 26, 2018 from issue [contrib] Support ARM and RISC-V symbol check by ken2812221
  5. laanwj commented at 7:14 AM on August 27, 2018: member

    Concept ACK

    Not convinced, though, that we need a set of both big and little-endian binaries. What is the default on this platform? If you can only test little-endian, I think it's better to leave it at that. (looks like both Debian and Fedora support LE, or are moving to it)

    Also (not for this PR): what would be really interesting is running the gitian build (for all platforms) on the secure workstation. This would remove the single point of failure of dependency Intel/AMD platforms for the build.

  6. DrahtBot cross-referenced this on Aug 29, 2018 from issue Minor style enhancement in documentation by fedsten
  7. laanwj requested review from theuni on Aug 29, 2018
  8. luke-jr commented at 12:17 AM on August 30, 2018: member

    There is no default. Some older systems can only boot to big endian. Newer systems come in either BE and LE variant. Unfortunately, one cannot run even static BE binaries on LE or vice-versa (on Linux, anyway).

  9. awilfox commented at 9:13 PM on August 30, 2018: none

    At least RHEL, SuSE, and Adélie ship big-endian images.

    Big endian is simple to run in KVM paravirt on the little-endian systems with a performance hit of less than 1%. This should be very easy to test, especially with Gentoo, since Gentoo can make a cross-root somewhere and then you can just point KVM at that disk.

    Any POWER7 or older system, including most workstations before the Talos (including IBM's post-RS and Apple's 970), are exclusively big endian.

    Any system (of any generation) running openSuSE Tumbleweed or Adélie is exclusively big endian.

  10. MarcoFalke added the label Needs gitian build on Aug 30, 2018
  11. DrahtBot added the label Needs rebase on Aug 31, 2018
  12. DrahtBot removed the label Needs gitian build on Sep 1, 2018
  13. laanwj commented at 5:37 AM on September 8, 2018: member

    Any POWER7 or older system, including most workstations before the Talos (including IBM's post-RS and Apple's 970), are exclusively big endian.

    Those are outside the scope of this PR, though, OP mentions this is POWER8+.

  14. luke-jr force-pushed on Sep 18, 2018
  15. luke-jr commented at 2:20 PM on September 18, 2018: member

    Rebased

  16. DrahtBot removed the label Needs rebase on Sep 18, 2018
  17. in contrib/devtools/symbol-check.py:117 in 53b7504697 outdated
     118 | -            (sym, _, version) = line[7].partition('@')
     119 | -            is_import = line[6] == 'UND'
     120 | +        words = line.split()
     121 | +        if 'Machine:' in words:
     122 | +            arch = words[-1]
     123 | +        m = re.match(r'^\s*\d+:\s*[\da-f]+\s+\d+\s(?:(?:\S+\s+){3})(?:\[.*\]\s+)?(\S+)\s+(\S+).*$', line)
    


    theuni commented at 7:47 PM on September 26, 2018:

    I have no clue what this is suppose to do.

    Perhaps a different tool like objdump or nm has output that's more easily parsed?


    laanwj commented at 7:32 AM on October 18, 2018:

    ahhh even parsing the ELF directly would be easier here than this


    luke-jr commented at 11:17 AM on October 20, 2018:

    This is a fairly straightforward regex... Do we really need to ban regexs? :/

    Looking at alternatives:

    • Debian's linter uses almost the same regex (they tolerate multiple spaces in one place this didn't).
    • Perl's Parse::Readelf module does some fancy parsing of column headers and stuff, and doesn't really seem like it works (not to mention only supports printing its output, not actual code usage), and adds a lot of complexity we really don't need.
    • pyelftools doesn't seem to get symbol version information for some reason.

    laanwj commented at 12:21 PM on October 20, 2018:

    I don't think it's that complex now that you've explained what it does on IRC, and why the old parsing doesn't work for POWER (due to [<localentry>: 8])—please add a comment in that regard (and thanks for investigating that readelf is apparently still the right tool for the job)

  18. in configure.ac:775 in ebd0de5e2f outdated
     673 | @@ -674,6 +674,11 @@ if test x$use_glibc_compat != xno; then
     674 |    AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk])
     675 |    AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"])
     676 |    AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"])
     677 | +  case $host in
     678 | +    powerpc64* | ppc64*)
     679 | +      AX_CHECK_LINK_FLAG([[-Wl,--no-tls-get-addr-optimize]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--no-tls-get-addr-optimize"])
    


    theuni commented at 7:54 PM on September 26, 2018:

    If this were a gcc switch, we would test against --tls-get-addr-optimize, then add --no-tls-get-addr-optimize to COMPAT_LDFLAGS if it succeeded. That is because gcc issues warnings for --no-foo if unsupported, but errors for --foo.

    I'm thinking we should do the same here. I don't know how most linkers handle this, but I can't imagine that causing any problems. That would also mean that we could safely run this check for all platforms without constraining it to specific ppc's.


    luke-jr commented at 11:44 AM on October 20, 2018:

    It should work without the no- prefix, but upon further research, I'm not sure if this is the correct solution at all.

    According to the documentation, systems without the glibc-side part can still explicitly enable the option and produce binaries that work (with a performance hit) on older systems. I'm not sure how this is technically implemented.


    luke-jr commented at 3:06 AM on October 21, 2018:

    Managed to get an old glibc running and confirmed --no-tls-get-addr-optimize is in fact needed. No clue why the docs imply otherwise. :/


    luke-jr commented at 12:03 PM on October 22, 2018:

    As for the original comment:

    1. At least GNU ld errors if --no-foo is provided.
    2. Other platforms might not have compatibility issues using this flag.
  19. in depends/packages/libpng.mk:17 in b93e76c80d outdated
      12 | +define $(package)_config_cmds
      13 | +  $($(package)_autoconf)
      14 | +endef
      15 | +
      16 | +define $(package)_build_cmds
      17 | +  $(MAKE) $($(package)_build_opts) PNG_COPTS='-fPIC'
    


    theuni commented at 7:58 PM on September 26, 2018:

    Why this instead of doing it the usual way via configure?


    luke-jr commented at 8:04 AM on October 21, 2018:

    No idea why, but it doesn't seem to work the usual way via configure.

    /usr/lib/gcc-cross/riscv64-linux-gnu/8/../../../../riscv64-linux-gnu/bin/ld: /home/ubuntu/build/bitcoin/depends/riscv64-linux-gnu/lib/libpng16.a(png.o): relocation R_RISCV_HI20 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
    /usr/lib/gcc-cross/riscv64-linux-gnu/8/../../../../riscv64-linux-gnu/bin/ld: /home/ubuntu/build/bitcoin/depends/riscv64-linux-gnu/lib/libpng16.a(pngerror.o): relocation R_RISCV_HI20 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
    /usr/lib/gcc-cross/riscv64-linux-gnu/8/../../../../riscv64-linux-gnu/bin/ld: /home/ubuntu/build/bitcoin/depends/riscv64-linux-gnu/lib/libpng16.a(pngget.o): relocation R_RISCV_HI20 against `__stack_chk_guard@@GLIBC_2.27' can not be used when making a shared object; recompile with -fPIC
    ...
    
  20. in contrib/gitian-descriptors/gitian-linux.yml:88 in c921a197f3 outdated
      84 | @@ -79,7 +85,11 @@ script: |
      85 |              echo "REAL=\`which -a ${i}-${prog}-8 | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
      86 |              echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
      87 |              echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
      88 | -            echo "exec \"\$REAL\" \"\$@\"" >> $WRAP_DIR/${i}-${prog}
      89 | +            if [ "${i:0:9}" = "powerpc64" ]; then
      90 | +                echo "exec \"\$REAL\" -mcpu=power8 -mtune=power9 \"\$@\"" >> $WRAP_DIR/${i}-${prog}
    


    theuni commented at 8:00 PM on September 26, 2018:

    This looks like something that should be handled in depends/hosts/linux.mk


    luke-jr commented at 12:02 PM on October 20, 2018:

    What if someone else wants to build for POWER7 (outside of gitian)?


    awilfox commented at 5:41 AM on October 21, 2018:

    Is there a reason for specifying -mcpu=power8 here at all? VSX goes back to P7 and VMX goes back to P4…


    luke-jr commented at 7:59 AM on October 21, 2018:

    Maybe not. How far back can we safely go without a noticeable performance hit?

    Would also be good to confirm #13203 still works if compiled for pre-POWER8.


    awilfox commented at 10:31 PM on October 22, 2018:

    vec_vsx_ld is POWER7; but the SHA sigma instructions are exclusive to POWER8 and newer. However, it looks like the merged code does check the hardware cap before using it, so it depends on compiler support, not build hardware support. (That is, if my understanding is correct, one could build all the way down to -mcpu=generic and you'd still get speed on P8+.)

  21. in src/Makefile.am:576 in c921a197f3 outdated
     572 | @@ -573,7 +573,7 @@ clean-local:
     573 |  check-symbols: $(bin_PROGRAMS)
     574 |  if GLIBC_BACK_COMPAT
     575 |  	@echo "Checking glibc back compat..."
     576 | -	$(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py < $(bin_PROGRAMS)
     577 | +	$(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py $(BITCOIN_SYMBOL_CHECK_OPTIONS) < $(bin_PROGRAMS)
    


    theuni commented at 8:03 PM on September 26, 2018:

    What is BITCOIN_SYMBOL_CHECK_OPTIONS ? I don't see any references to it, is this just intended to be an optional env var for local testing?


    luke-jr commented at 11:23 AM on October 18, 2018:

    Should have been dropped in rebase; will remove next revision.

  22. theuni commented at 8:03 PM on September 26, 2018: member

    Concept ACK, a few questions though.

  23. DrahtBot cross-referenced this on Oct 21, 2018 from issue Enable flake8 rule E225 which checks for missing whitespace around op… by jbampton
  24. bitcoin deleted a comment on Oct 21, 2018
  25. MarcoFalke added the label Needs gitian build on Oct 21, 2018
  26. DrahtBot removed the label Needs gitian build on Oct 22, 2018
  27. luke-jr force-pushed on Oct 22, 2018
  28. luke-jr force-pushed on Oct 22, 2018
  29. MarcoFalke added the label Needs gitian build on Oct 24, 2018
  30. bitcoin deleted a comment on Oct 24, 2018
  31. DrahtBot removed the label Needs gitian build on Oct 25, 2018
  32. DrahtBot added the label Needs rebase on Dec 13, 2018
  33. luke-jr referenced this in commit 3b1ba09f14 on Dec 24, 2018
  34. luke-jr referenced this in commit 34faa781d6 on Dec 24, 2018
  35. luke-jr referenced this in commit 771043a418 on Dec 24, 2018
  36. luke-jr referenced this in commit 68a678577d on Dec 24, 2018
  37. luke-jr referenced this in commit e7ce6e2082 on Dec 24, 2018
  38. luke-jr referenced this in commit 79efe21e96 on Dec 24, 2018
  39. luke-jr referenced this in commit bbbdda3716 on Dec 24, 2018
  40. luke-jr referenced this in commit 51f311ab8e on Dec 29, 2018
  41. luke-jr force-pushed on Dec 30, 2018
  42. Rspigler cross-referenced this on Feb 1, 2019 from issue tests: Switch one of the Travis jobs to an unsigned char environment (-funsigned-char) by practicalswift
  43. luke-jr force-pushed on Feb 11, 2019
  44. DrahtBot removed the label Needs rebase on Feb 11, 2019
  45. practicalswift commented at 11:48 PM on February 16, 2019: contributor

    Concept ACK

  46. DrahtBot added the label Needs rebase on Feb 21, 2019
  47. practicalswift commented at 11:23 AM on February 22, 2019: contributor

    @luke-jr What setup would you suggest for reviewers who want to test those binaries?

  48. awilfox commented at 6:45 PM on February 22, 2019: none

    You could spin up an IntegriCloud VPS, but I don't know of any big endian distros that use glibc. All of them that I am aware of (Adelie, Void, etc) went to musl since it is easier to support BE on musl.

    So you'd need an older Debian or Fedora image to test the BE binary.

  49. luke-jr force-pushed on Mar 28, 2019
  50. luke-jr commented at 10:59 AM on March 28, 2019: member

    Rebased, and extended support back to the PowerPC 970 (Apple G5) since it didn't seem to have a notable performance hit on POWER9 (it actually performed better!).

  51. practicalswift commented at 11:01 AM on March 28, 2019: contributor

    @luke-jr What setup would you suggest for reviewers who want to test those binaries?

  52. luke-jr commented at 11:09 AM on March 28, 2019: member

    @awilfox answered that above. If you prefer to buy real hardware, I'm using https://www.raptorcs.com/content/base/products.html

  53. DrahtBot removed the label Needs rebase on Mar 28, 2019
  54. bitcoin deleted a comment on Mar 28, 2019
  55. MarcoFalke added the label Needs gitian build on Mar 28, 2019
  56. DrahtBot added the label Needs rebase on Mar 28, 2019
  57. DrahtBot removed the label Needs gitian build on Mar 29, 2019
  58. MarcoFalke commented at 2:06 PM on March 29, 2019: member

    Fails with:

    > make[1]: Leaving directory '/home/ubuntu/build/bitcoin/depends/work/build/powerpc64-linux-gnu/qt/5.9.7-72625d07ee6/qtbase/config.tests/xcb_xlib'
     => source accepted.
    test config.gui.libraries.xcb_xlib succeeded
    Checking for XKB config root... 
    test config.gui.tests.xkbconfigroot gave result /usr/share/X11/xkb
    Checking for xkbcommon... 
    Trying source 0 (type pkgConfig) of library xkbcommon ...
    + PKG_CONFIG_SYSROOT_DIR=/ PKG_CONFIG_LIBDIR=/home/ubuntu/build/bitcoin/depends/powerpc64-linux-gnu/lib/pkgconfig /usr/bin/pkg-config --exists --silence-errors xkbcommon
    pkg-config did not find package.
      => source produced no result.
    test config.gui.libraries.xkbcommon FAILED
    Done running configuration tests.
    
    Configure summary:
    
    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: bitcoin-linux-g++ (power64, CPU features: altivec)
    Configuration: cross_compile enable_new_dtags largefile precompile_header silent release c++11 dbus no-qml-debug reduce_exports release_tools static
    Build options:
      Mode ................................... release; optimized tools
      Optimize release build for size ........ no
      Building shared libraries .............. no
      Using C++ standard ..................... C++11
      Using ccache ........................... no
      Using gold linker ...................... no
      Using new DTAGS ........................ yes
      Using precompiled headers .............. yes
      Using LTCG ............................. no
      Target compiler supports:
      Build parts ............................ libs
    Qt modules and options:
      Qt Concurrent .......................... no
      Qt D-Bus ............................... yes
      Qt D-Bus directly linked to libdbus .... no
      Qt Gui ................................. yes
      Qt Network ............................. yes
      Qt Sql ................................. no
      Qt Testlib ............................. yes
      Qt Widgets ............................. yes
      Qt Xml ................................. no
    Support enabled for:
      Using pkg-config ....................... yes
      QML debugging .......................... no
      udev ................................... no
      Using system zlib ...................... yes
    Qt Core:
      DoubleConversion ....................... yes
        Using system DoubleConversion ........ no
      GLib ................................... no
      iconv .................................. no
      ICU .................................... no
      Logging backends:
        journald ............................. no
        syslog ............................... no
        slog2 ................................ no
      Using system PCRE2 ..................... no
    Qt Network:
      getaddrinfo() .......................... no
      getifaddrs() ........................... yes
      IPv6 ifname ............................ yes
      libproxy ............................... no
      OpenSSL ................................ no
        Qt directly linked to OpenSSL ........ no
      SCTP ................................... no
      Use system proxies ..................... yes
    Qt Gui:
      Accessibility .......................... yes
      FreeType ............................... yes
        Using system FreeType ................ no
      HarfBuzz ............................... yes
        Using system HarfBuzz ................ no
      Fontconfig ............................. no
      Image formats:
        GIF .................................. no
        ICO .................................. yes
        JPEG ................................. no
          Using system libjpeg ............... no
        PNG .................................. yes
          Using system libpng ................ yes
      EGL .................................... no
      OpenVG ................................. no
      OpenGL:
        Desktop OpenGL ....................... no
        OpenGL ES 2.0 ........................ no
        OpenGL ES 3.0 ........................ no
        OpenGL ES 3.1 ........................ no
      Session Management ..................... no
    Features used by QPA backends:
      evdev .................................. yes
      libinput ............................... no
      INTEGRITY HID .......................... no
      mtdev .................................. no
      tslib .................................. no
      xkbcommon-evdev ........................ no
    QPA backends:
      DirectFB ............................... no
      EGLFS .................................. no
      LinuxFB ................................ no
      VNC .................................... yes
      Mir client ............................. no
      X11:
        Using system-provided XCB libraries .. no
        EGL on X11 ........................... no
        Xinput2 .............................. no
        XCB XKB .............................. yes
        XLib ................................. yes
        XCB render ........................... yes
        XCB GLX .............................. yes
        XCB Xlib ............................. yes
        Using system-provided xkbcommon ...... no
    Qt Widgets:
      GTK+ ................................... no
      Styles ................................. Fusion Windows
    Qt PrintSupport:
      CUPS ................................... no
    Qt Sql:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. no
      OCI (Oracle) ........................... no
      ODBC ................................... no
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. no
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    
    Note: Using static linking will disable the use of dynamically
    loaded plugins. Make sure to import all needed static plugins,
    or compile needed modules into the library.
    
    Note: -optimized-tools is not useful in -release mode.
    
    Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing.
    
    ERROR: Qt requires a compliant STL library.
    
    ERROR: detected a std::atomic implementation that fails for function pointers.
    Please apply the patch corresponding to your Standard Library vendor, found in
      qtbase/config.tests/atomicfptr
    
    ERROR: Feature 'openssl-linked' was enabled, but the pre-condition '!features.securetransport && libs.openssl' failed.
    
    ERROR: Feature 'openssl' was enabled, but the pre-condition '!features.securetransport && (features.openssl-linked || libs.openssl_headers)' failed.
    
    ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed.
    
    ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig' failed.
    funcs.mk:243: recipe for target '/home/ubuntu/build/bitcoin/depends/work/build/powerpc64-linux-gnu/qt/5.9.7-72625d07ee6/qtbase/.stamp_configured' failed
    make: *** [/home/ubuntu/build/bitcoin/depends/work/build/powerpc64-linux-gnu/qt/5.9.7-72625d07ee6/qtbase/.stamp_configured] Error 3
    make: Leaving directory '/home/ubuntu/build/bitcoin/depends'
    
  59. luke-jr commented at 9:07 PM on March 29, 2019: member

    Worked for me and the bot? :/

  60. in depends/README.md:64 in a19df5fa25 outdated
      55 | @@ -54,6 +56,10 @@ For linux AARCH64 cross compilation:
      56 |  
      57 |      sudo apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
      58 |  
      59 | +For linux POWER 64-bit cross compilation (there are no packages for 32-bit):
      60 | +
      61 | +    sudo apt-get install curl g++-7-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-7-powerpc64le-linux-gnu binutils-powerpc64le-linux-gnu
    


    MarcoFalke commented at 10:00 PM on March 29, 2019:
        sudo apt-get install g++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-powerpc64le-linux-gnu binutils-powerpc64le-linux-gnu
    

    (Same as the other instructions)

  61. MarcoFalke commented at 10:20 PM on March 29, 2019: member
  62. MarcoFalke commented at 10:22 PM on March 29, 2019: member

    Worked for me and the bot? :/

    Oh, the failure is from the bot. But it passes for me locally on a fresh bionic vm:

    apt update && apt install -y git vim htop make automake cmake curl g++-multilib libtool binutils-gold bsdmainutils pkg-config python3 && apt install -y  g++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu g++-powerpc64le-linux-gnu binutils-powerpc64le-linux-gnu
    git clone https://github.com/luke-jr/bitcoin --depth=1 --branch gitian_power64 && cd bitcoin/depends && make -j 9 HOST=powerpc64-linux-gnu qt
    
  63. MarcoFalke added the label Needs gitian build on Mar 29, 2019
  64. luke-jr force-pushed on May 2, 2019
  65. DrahtBot removed the label Needs rebase on May 2, 2019
  66. DrahtBot removed the label Needs gitian build on May 5, 2019
  67. bitcoin deleted a comment on May 27, 2019
  68. bitcoin deleted a comment on May 27, 2019
  69. MarcoFalke added the label Needs gitian build on May 27, 2019
  70. DrahtBot removed the label Needs gitian build on May 28, 2019
  71. dongcarl commented at 7:59 PM on May 31, 2019: contributor

    Tested that Gitian building works on my own machine.

  72. DrahtBot added the label Needs rebase on Jul 23, 2019
  73. bitcoin deleted a comment on Jul 23, 2019
  74. MarcoFalke added the label Needs gitian build on Jul 23, 2019
  75. luke-jr force-pushed on Oct 14, 2019
  76. DrahtBot removed the label Needs rebase on Oct 14, 2019
  77. practicalswift commented at 7:55 AM on October 14, 2019: contributor

    Concept ACK

    Diversity in testing is good. Thanks for working on this!

  78. DrahtBot removed the label Needs gitian build on Oct 15, 2019
  79. DrahtBot added the label Needs rebase on Oct 26, 2019
  80. laanwj added this to the milestone 0.20.0 on Nov 1, 2019
  81. laanwj commented at 10:42 AM on November 1, 2019: member

    Would be nice to have this for 0.20.

  82. MarcoFalke added the label Needs gitian build on Nov 1, 2019
  83. bitcoin deleted a comment on Nov 1, 2019
  84. elichai cross-referenced this on Nov 7, 2019 from issue ci: Travis support for PowerPC64 by elichai
  85. laanwj commented at 7:37 PM on November 8, 2019: member

    Also splits libpng out of Qt (since Qt's bundled copy is broken on POWER) and disables JPEG (since we don't use it).

    Could this be solved by changing to a new version of Qt? If so, I'd prefer that.

  86. MarcoFalke commented at 5:50 PM on December 9, 2019: member

    One of the commits has been cherry-picked and merged as 989fd539d5bf590c5f6070ee2a4a9e2d3018df2c

  87. in contrib/gitian-descriptors/gitian-linux.yml:90 in ba5948a8b4 outdated
      84 | @@ -79,7 +85,11 @@ script: |
      85 |              echo "REAL=\`which -a ${i}-${prog}-8 | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
      86 |              echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
      87 |              echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
      88 | -            echo "exec \"\$REAL\" \"\$@\"" >> $WRAP_DIR/${i}-${prog}
      89 | +            if [ "${i:0:9}" = "powerpc64" ]; then
      90 | +                echo "exec \"\$REAL\" -mcpu=970 -mtune=power9 \"\$@\"" >> $WRAP_DIR/${i}-${prog}
    


    dongcarl commented at 5:55 PM on December 9, 2019:

    Could we set these as CFLAGS/CPPFLAGS in depends instead of in the wrapper?


    luke-jr commented at 6:25 PM on December 9, 2019:

    I don't know how reliably those get passed everywhere. Also, you mean CXXFLAGS...


    dongcarl commented at 6:38 PM on December 9, 2019:

    :sweat_smile: yeah I meant CXXFLAGS...

    with depends you can just modify hosts/linux.mk... I'm also not sure about tuning for a specific cpu here (perhaps I'm understanding incorrectly), especially because this will be activated for both big and small endian HOSTs? Do you have sources for why these flags are needed?


    luke-jr commented at 6:51 PM on December 9, 2019:

    We don't want to force these CFLAGS on everyone... just use them for gitian builds so they perform well.


    dongcarl commented at 7:16 PM on December 9, 2019:

    Sure, then we can just supply powerpc64_linux_CFLAGS='-mcpu=970 -mtune=power9' powerpc64le_linux_CFLAGS='-mcpu=970 -mtune=power9', but let's do that in a followup :-)

    Wondering about the choice of -mcpu here... Why PowerPC 970 instead of a more generic powerpc64 or powerpc64le? My reference: https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html#RS_002f6000-and-PowerPC-Options


    fanquake commented at 2:14 AM on October 31, 2020:

    Wondering about the choice of -mcpu here... Why PowerPC 970 instead of a more generic powerpc64 or powerpc64le?

    This still atleast needs answering.


    luke-jr commented at 4:32 AM on October 31, 2020:

    I don't know. GCC doesn't let me compare -mcpu values AFAICT. Presumably generic options wouldn't be optimal for modern CPUs? (even 970 is pretty ancient)


    luke-jr commented at 2:15 AM on November 2, 2020:

    I'm told -mcpu=970 is just powerpc64 + altivec.

  88. laanwj commented at 10:51 PM on March 6, 2020: member

    This has needed rebase for a while (if we still want this for 0.20).

  89. hebasto commented at 8:57 PM on March 15, 2020: member

    @luke-jr

    Also splits libpng out of Qt (since Qt's bundled copy is broken on POWER)

    Just for reference:

    Could this be solved by changing to a new version of Qt? If so, I'd prefer that.

    Fixed since Qt 5.12.0 (according to the bugtracker).

  90. sipa commented at 4:24 AM on March 16, 2020: member

    Would be nice to have this for 0.20.

  91. luke-jr force-pushed on Mar 16, 2020
  92. luke-jr commented at 7:48 PM on March 16, 2020: member

    Rebased and fixed a bug (GCC 8 miscompiles for LE targets with -mcpu=970)

    Considering the fragility of using the wrong -mcpu, I kept it in the wrapper...

  93. DrahtBot removed the label Needs rebase on Mar 16, 2020
  94. DrahtBot cross-referenced this on Mar 16, 2020 from issue net: Add NAT-PMP port forwarding support by hebasto
  95. DrahtBot cross-referenced this on Mar 16, 2020 from issue build: make linker checks more robust by fanquake
  96. DrahtBot removed the label Needs gitian build on Mar 18, 2020
  97. MarcoFalke commented at 2:55 PM on March 18, 2020: member

    Excerpt:

    + make -j1 -C src check-security
    make: Entering directory '/home/ubuntu/build/bitcoin/distsrc-powerpc64-linux-gnu/src'
    Checking binary security...
    bitcoind: failed NX
    bitcoin-cli: failed NX
    bitcoin-tx: failed NX
    bitcoin-wallet: failed NX
    test/test_bitcoin: failed NX
    bench/bench_bitcoin: failed NX
    qt/bitcoin-qt: failed NX
    Makefile:18486: recipe for target 'check-security' failed
    make: *** [check-security] Error 1
    make: Leaving directory '/home/ubuntu/build/bitcoin/distsrc-powerpc64-linux-gnu/src'
    
  98. luke-jr commented at 4:56 AM on March 24, 2020: member

    Fixed by making noexecstack explicit on all platforms (it doesn't make sense to rely on defaults when we require it...)

  99. MarcoFalke added the label Needs gitian build on Mar 24, 2020
  100. DrahtBot removed the label Needs gitian build on Mar 25, 2020
  101. bitcoin deleted a comment on Mar 25, 2020
  102. MarcoFalke added the label Needs gitian build on Mar 25, 2020
  103. DrahtBot removed the label Needs gitian build on Mar 29, 2020
  104. laanwj removed this from the milestone 0.20.0 on Apr 2, 2020
  105. laanwj added this to the milestone 0.21.0 on Apr 2, 2020
  106. DrahtBot cross-referenced this on Apr 12, 2020 from issue build: Link time garbage collection by fanquake
  107. DrahtBot cross-referenced this on Apr 12, 2020 from issue build: add linker optimisation flags to gitian & guix (Linux) by fanquake
  108. DrahtBot added the label Needs rebase on Apr 15, 2020
  109. bitcoin deleted a comment on Apr 15, 2020
  110. bitcoin deleted a comment on Apr 15, 2020
  111. luke-jr force-pushed on May 14, 2020
  112. DrahtBot removed the label Needs rebase on May 14, 2020
  113. DrahtBot cross-referenced this on May 27, 2020 from issue build: Use a zip instead of dmg for macOS releases by fanquake
  114. DrahtBot cross-referenced this on Jul 29, 2020 from issue build: Drop ancient hack in gitian-linux descriptor by hebasto
  115. DrahtBot cross-referenced this on Jul 30, 2020 from issue build: Drop per-host faketime wrappers in gitian-linux build by hebasto
  116. achow101 cross-referenced this on Aug 6, 2020 from issue Sqlite wallet storage by Sjors
  117. DrahtBot added the label Needs rebase on Aug 10, 2020
  118. luke-jr force-pushed on Aug 17, 2020
  119. luke-jr cross-referenced this on Aug 17, 2020 from issue depends: Split libpng out of Qt by luke-jr
  120. DrahtBot removed the label Needs rebase on Aug 17, 2020
  121. luke-jr commented at 4:52 AM on August 20, 2020: member

    Needs rebasing on top of #19751 once that's merged

  122. luke-jr closed this on Aug 20, 2020

  123. symbol-check: Fix readelf output parsing bf7357a6a0
  124. Support glibc-back-compat on 64-bit POWER 6711b0855f
  125. gitian: Properly quote arguments in wrappers 8782e8e72c
  126. gitian-linux: Build binaries for 64-bit POWER b74c21fad1
  127. gitian: Always specify noexecstack since we enforce it unconditionally a951c598fb
  128. luke-jr reopened this on Oct 24, 2020

  129. luke-jr force-pushed on Oct 24, 2020
  130. luke-jr force-pushed on Oct 24, 2020
  131. luke-jr commented at 1:26 PM on October 24, 2020: member

    Rebased and re-tested.

  132. MarcoFalke added the label Needs gitian build on Oct 24, 2020
  133. MarcoFalke added the label Needs Guix build on Oct 24, 2020
  134. DrahtBot cross-referenced this on Oct 24, 2020 from issue depends: Properly pass $PATH to configure and pin by dongcarl
  135. DrahtBot cross-referenced this on Oct 24, 2020 from issue depends: Pin clang search paths for darwin host by dongcarl
  136. DrahtBot commented at 11:06 AM on October 25, 2020: contributor

    <!--9cd9c72976c961c55c7acef8f6ba82cd-->

    Guix builds

    File commit d67883d01e507dd22d1281f4a4860e79d6a46a47<br>(master) commit f8cb73189115a63d45256b9340816bfce96393f5<br>(master and this pull)
    *-aarch64-linux-gnu-debug.tar.gz 4e64895ca673f44e... 1c81820b04d543dd...
    *-aarch64-linux-gnu.tar.gz 59412baa429f4803... 5dc2a94eaa2d701b...
    *-arm-linux-gnueabihf-debug.tar.gz 463e2260deb8b17f... 5670537d76a83b2c...
    *-arm-linux-gnueabihf.tar.gz b5b819ebe904c8d3... d7bb7e2d75f2b466...
    *-riscv64-linux-gnu-debug.tar.gz 07942c124d73619a... a79ac723d8df3b89...
    *-riscv64-linux-gnu.tar.gz d8db9b1641e07df6... 48bbc2666ce652a0...
    *-win-unsigned.tar.gz 4061f534e46b79ac... 0edd48d828d0ba55...
    *-win64-debug.zip 5f9c0b65b643cab3... 3e68aba4980c4394...
    *-win64-setup-unsigned.exe 2df62ea3d8d62971... aa0bb79cebe4b9f9...
    *-win64.zip a3b3594fbcc248a8... 02c28d554ded69a3...
    *-x86_64-linux-gnu-debug.tar.gz 9a98775dcd5ac4ec... 3171288b07d28835...
    *-x86_64-linux-gnu.tar.gz 9461e33851c966c7... 16e6a1e5649a2b45...
    *.tar.gz 70f224763adead92... b0942820765c35a9...
    guix_build.log 5e2deeb86785b090... 6cd0579e43b4f588...
    guix_build.log.diff f5ec2913e23b04b6...
  137. DrahtBot removed the label Needs Guix build on Oct 25, 2020
  138. DrahtBot commented at 12:52 PM on October 26, 2020: contributor

    <!--a722867cd34abeea1fadc8d60700f111-->

    Gitian builds

    File commit d67883d01e507dd22d1281f4a4860e79d6a46a47<br>(master) commit f8cb73189115a63d45256b9340816bfce96393f5<br>(master and this pull)
    bitcoin-core-linux-0.21-res.yml fb2670f2f8ab0d0a... 57d59a44bffa740a...
    bitcoin-core-osx-0.21-res.yml d24523299fb03e93... 15dbc11fa63ccda4...
    bitcoin-core-win-0.21-res.yml 56c065d51ffa9fb6... 250e9b116781e91c...
    *-aarch64-linux-gnu-debug.tar.gz b4d05463fda0adac... 05b2ee6295f2e033...
    *-aarch64-linux-gnu.tar.gz 3a43937219f4fbef... c00e5233a0c93442...
    *-arm-linux-gnueabihf-debug.tar.gz 54e6c6f85955de26... e24bf2d02a8198de...
    *-arm-linux-gnueabihf.tar.gz 76dee1ea73dd31b7... feb4e7976ee0ee1d...
    *-osx-unsigned.dmg 6d0b6c8274d37dbb... 1c58228bce6b6118...
    *-osx64.tar.gz 902a69555d82322d... b13444feb8a9c24a...
    *-riscv64-linux-gnu-debug.tar.gz e87c71666376fe9a... d1bf41dc3cabb2b9...
    *-riscv64-linux-gnu.tar.gz 38c0ca912040a8b4... 0e4832f29b4f2219...
    *-win64-debug.zip f815299d5d2100f2... 2e88232c4e5ea247...
    *-win64-setup-unsigned.exe 854105d5cef6ab9c... cb5d93c039b3c21e...
    *-win64.zip e01a2d84b4fb5653... 78516aed31be5d0a...
    *-x86_64-linux-gnu-debug.tar.gz f75d8220b59ed46e... 52936ad4725853d2...
    *-x86_64-linux-gnu.tar.gz a6d8292cf44c959e... 8bdba6613953e49f...
    *.tar.gz 70f224763adead92... b0942820765c35a9...
    linux-build.log ceaaa58ad271c807... c067489d8a64916f...
    osx-build.log e48082cd327972e1... 21a106676aff913c...
    win-build.log 4c0c68075af70f26... 98e8b6f1fac30696...
    bitcoin-core-linux-0.21-res.yml.diff 52bd17632c91381e...
    bitcoin-core-osx-0.21-res.yml.diff 10814c03d2f02a18...
    bitcoin-core-win-0.21-res.yml.diff 05c123318fddccb1...
    *-powerpc64-linux-gnu-debug.tar.gz 49050c85b7776ebc...
    *-powerpc64-linux-gnu.tar.gz 76908c390ae80531...
    *-powerpc64le-linux-gnu-debug.tar.gz c84351a042c4aa31...
    *-powerpc64le-linux-gnu.tar.gz 766246b8a94227f4...
    linux-build.log.diff 6b78b10de4a501ce...
    osx-build.log.diff 89499c0a4d99986e...
    win-build.log.diff e68c80d64b8709db...
  139. DrahtBot removed the label Needs gitian build on Oct 26, 2020
  140. in contrib/devtools/security-check.py:148 in 622de1cc7e outdated
     144 | @@ -145,7 +145,6 @@ def check_ELF_separate_code(executable):
     145 |      EXPECTED_FLAGS = {
     146 |          # Read + execute
     147 |          '.init': 'R E',
     148 | -        '.plt': 'R E',
    


    laanwj commented at 7:55 AM on October 30, 2020:

    Why remove this? Is .plt writable? We should make this specific on architecture. If POWER9 is an exception here that needs the jump table to be writable (which would be kind of insecure in itself, so this is an important security check), let's make a specific exception for that.

    Edit: writability of the .plt section is not determined by separate-code. It's part of "early binding". E.g. -z,relro or -z,now.


    fanquake commented at 2:13 AM on October 31, 2020:

    Agree with @laanwj. No need to wholesale relax our checks just to accommodate POWER. A special case with a comment should be fine.


    luke-jr commented at 2:12 AM on November 2, 2020:

    Fixed

  141. in contrib/gitian-descriptors/gitian-linux.yml:53 in 622de1cc7e outdated
      50 |    FAKETIME_HOST_PROGS="gcc g++"
      51 |    FAKETIME_PROGS="date ar ranlib nm"
      52 |    HOST_CFLAGS="-O2 -g"
      53 |    HOST_CXXFLAGS="-O2 -g"
      54 | -  HOST_LDFLAGS_BASE="-static-libstdc++ -Wl,-O2"
      55 | +  HOST_LDFLAGS="-static-libstdc++ -Wl,-O2 -Wl,-z,noexecstack"
    


    fanquake commented at 2:20 AM on October 31, 2020:

    If you're going to add -z,noexecstack in the gitian descriptor, it should have a comment explaining why it's here, rather than along with all of the other hardening options in configure, otherwise it's not going to be clear why this flag is special cased.


    luke-jr commented at 2:14 AM on November 2, 2020:

    I don't know the answer to that myself. This PR is merely making explicit what was already enforced by our scripts for other platforms.

  142. luke-jr force-pushed on Nov 2, 2020
  143. laanwj removed this from the milestone 0.21.0 on Nov 2, 2020
  144. laanwj added this to the milestone 22.0 on Nov 2, 2020
  145. laanwj referenced this in commit e6441c6dec on Nov 20, 2020
  146. laanwj cross-referenced this on Nov 20, 2020 from issue contrib: Parse ELF directly for symbol and security checks by laanwj
  147. laanwj referenced this in commit e656dbf40f on Nov 21, 2020
  148. laanwj referenced this in commit a0a771843f on Nov 22, 2020
  149. DrahtBot cross-referenced this on Nov 22, 2020 from issue lint: run mypy over contrib/devtools by fanquake
  150. fanquake referenced this in commit 12266bc028 on Nov 23, 2020
  151. devtools/security-check: Abstract get_ELF_header out of check_ELF_PIE 8c73a4cd36
  152. devtools/security-check: Allow .plt to be RW on PowerPC64 31dbf0b677
  153. luke-jr force-pushed on Nov 30, 2020
  154. laanwj commented at 11:27 AM on December 18, 2020: member

    Now that #20434 is merged the symbol/security tooling-related changes should be able to be dropped here.

  155. DrahtBot added the label Needs rebase on Dec 18, 2020
  156. DrahtBot commented at 12:20 PM on December 18, 2020: contributor

    <!--cf906140f33d8803c4a75a2196329ecb-->

    🐙 This pull request conflicts with the target branch and needs rebase.

    <sub>Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".</sub>

  157. mjdietzx referenced this in commit 85f2e5c08e on Dec 26, 2020
  158. laanwj commented at 3:36 PM on January 11, 2021: member

    Would be good to get this in early in the 0.22 cycle. But it needs rebase; ping @luke-jr .

  159. laanwj cross-referenced this on Jan 19, 2021 from issue gitian-linux: Build binaries for 64-bit POWER (continued) by laanwj
  160. laanwj commented at 1:45 PM on January 19, 2021: member

    Closing in favor of #20963.

  161. laanwj closed this on Jan 19, 2021

  162. laanwj referenced this in commit 6a726cb534 on Jan 28, 2021
  163. bitcoin 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: 2026-05-20 06:54 UTC