fanquake added the label Build system on Aug 26, 2018
DrahtBot
commented at 4:26 AM on August 26, 2018:
member
<!--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.
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.
laanwj requested review from theuni on Aug 29, 2018
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).
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.
MarcoFalke added the label Needs gitian build on Aug 30, 2018
DrahtBot added the label Needs rebase on Aug 31, 2018
DrahtBot removed the label Needs gitian build on Sep 1, 2018
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+.
luke-jr force-pushed on Sep 18, 2018
luke-jr
commented at 2:20 PM on September 18, 2018:
member
Rebased
DrahtBot removed the label Needs rebase on Sep 18, 2018
in
contrib/devtools/symbol-check.py:117
in
53b7504697outdated
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.
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)
in
configure.ac:775
in
ebd0de5e2foutdated
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.
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
...
in
contrib/gitian-descriptors/gitian-linux.yml:88
in
c921a197f3outdated
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+.)
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.
theuni
commented at 8:03 PM on September 26, 2018:
member
Concept ACK, a few questions though.
MarcoFalke deleted a comment on Oct 21, 2018
MarcoFalke added the label Needs gitian build on Oct 21, 2018
DrahtBot removed the label Needs gitian build on Oct 22, 2018
luke-jr force-pushed on Oct 22, 2018
luke-jr force-pushed on Oct 22, 2018
MarcoFalke added the label Needs gitian build on Oct 24, 2018
MarcoFalke deleted a comment on Oct 24, 2018
DrahtBot removed the label Needs gitian build on Oct 25, 2018
DrahtBot added the label Needs rebase on Dec 13, 2018
luke-jr referenced this in commit 3b1ba09f14 on Dec 24, 2018
luke-jr referenced this in commit 34faa781d6 on Dec 24, 2018
luke-jr referenced this in commit 771043a418 on Dec 24, 2018
luke-jr referenced this in commit 68a678577d on Dec 24, 2018
luke-jr referenced this in commit e7ce6e2082 on Dec 24, 2018
luke-jr referenced this in commit 79efe21e96 on Dec 24, 2018
luke-jr referenced this in commit bbbdda3716 on Dec 24, 2018
luke-jr referenced this in commit 51f311ab8e on Dec 29, 2018
luke-jr force-pushed on Dec 30, 2018
luke-jr force-pushed on Feb 11, 2019
DrahtBot removed the label Needs rebase on Feb 11, 2019
practicalswift
commented at 11:48 PM on February 16, 2019:
contributor
Concept ACK
DrahtBot added the label Needs rebase on Feb 21, 2019
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?
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.
luke-jr force-pushed on Mar 28, 2019
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!).
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?
luke-jr
commented at 11:09 AM on March 28, 2019:
member
DrahtBot removed the label Needs rebase on Mar 28, 2019
MarcoFalke deleted a comment on Mar 28, 2019
MarcoFalke added the label Needs gitian build on Mar 28, 2019
DrahtBot added the label Needs rebase on Mar 28, 2019
DrahtBot removed the label Needs gitian build on Mar 29, 2019
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'
luke-jr
commented at 9:07 PM on March 29, 2019:
member
Worked for me and the bot? :/
in
depends/README.md:64
in
a19df5fa25outdated
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:
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?
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 :-)
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)
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.
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.
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-26 09:15 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me