fanquake added the label
Build system
on Aug 26, 2018
DrahtBot
commented at 4:26 am on August 26, 2018:
member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
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 0: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
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?
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.
0/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
1/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
2/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
3...
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:
0> make[1]: Leaving directory '/home/ubuntu/build/bitcoin/depends/work/build/powerpc64-linux-gnu/qt/5.9.7-72625d07ee6/qtbase/config.tests/xcb_xlib' 1=> source accepted. 2test config.gui.libraries.xcb_xlib succeeded
3Checking for XKB config root... 4test config.gui.tests.xkbconfigroot gave result /usr/share/X11/xkb
5Checking for xkbcommon... 6Trying source 0 (type pkgConfig) of library xkbcommon ... 7+ 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
8pkg-config did not find package. 9=> source produced no result. 10test config.gui.libraries.xkbcommon FAILED
11Done running configuration tests. 12 13Configure summary:
14 15Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
16Building for: bitcoin-linux-g++ (power64, CPU features: altivec)
17Configuration: cross_compile enable_new_dtags largefile precompile_header silent release c++11 dbus no-qml-debug reduce_exports release_tools static 18Build options:
19 Mode ................................... release; optimized tools
20 Optimize release build for size ........ no
21 Building shared libraries .............. no
22 Using C++ standard ..................... C++11 23 Using ccache ........................... no
24 Using gold linker ...................... no
25 Using new DTAGS ........................ yes
26 Using precompiled headers .............. yes
27 Using LTCG ............................. no
28 Target compiler supports:
29 Build parts ............................ libs
30Qt modules and options:
31 Qt Concurrent .......................... no
32 Qt D-Bus ............................... yes
33 Qt D-Bus directly linked to libdbus .... no
34 Qt Gui ................................. yes
35 Qt Network ............................. yes
36 Qt Sql ................................. no
37 Qt Testlib ............................. yes
38 Qt Widgets ............................. yes
39 Qt Xml ................................. no
40Support enabled for:
41 Using pkg-config ....................... yes
42 QML debugging .......................... no
43 udev ................................... no
44 Using system zlib ...................... yes
45Qt Core:
46 DoubleConversion ....................... yes
47 Using system DoubleConversion ........ no
48 GLib ................................... no
49 iconv .................................. no
50 ICU .................................... no
51 Logging backends:
52 journald ............................. no
53 syslog ............................... no
54 slog2 ................................ no
55 Using system PCRE2 ..................... no
56Qt Network:
57 getaddrinfo() .......................... no
58 getifaddrs() ........................... yes
59 IPv6 ifname ............................ yes
60 libproxy ............................... no
61 OpenSSL ................................ no
62 Qt directly linked to OpenSSL ........ no
63 SCTP ................................... no
64 Use system proxies ..................... yes
65Qt Gui:
66 Accessibility .......................... yes
67 FreeType ............................... yes
68 Using system FreeType ................ no
69 HarfBuzz ............................... yes
70 Using system HarfBuzz ................ no
71 Fontconfig ............................. no
72Image formats:
73 GIF .................................. no
74 ICO .................................. yes
75 JPEG ................................. no
76 Using system libjpeg ............... no
77 PNG .................................. yes
78 Using system libpng ................ yes
79 EGL .................................... no
80 OpenVG ................................. no
81 OpenGL:
82 Desktop OpenGL ....................... no
83 OpenGL ES 2.0........................ no
84 OpenGL ES 3.0........................ no
85 OpenGL ES 3.1........................ no
86 Session Management ..................... no
87Features used by QPA backends:
88 evdev .................................. yes
89 libinput ............................... no
90 INTEGRITY HID .......................... no
91 mtdev .................................. no
92 tslib .................................. no
93 xkbcommon-evdev ........................ no
94QPA backends:
95 DirectFB ............................... no
96 EGLFS .................................. no
97 LinuxFB ................................ no
98 VNC .................................... yes
99 Mir client ............................. no
100 X11:
101 Using system-provided XCB libraries .. no
102 EGL on X11 ........................... no
103 Xinput2 .............................. no
104 XCB XKB .............................. yes
105 XLib ................................. yes
106 XCB render ........................... yes
107 XCB GLX .............................. yes
108 XCB Xlib ............................. yes
109 Using system-provided xkbcommon ...... no
110Qt Widgets:
111 GTK+................................... no
112 Styles ................................. Fusion Windows
113Qt PrintSupport:
114 CUPS ................................... no
115Qt Sql:
116 DB2 (IBM) .............................. no
117 InterBase .............................. no
118 MySql .................................. no
119 OCI (Oracle) ........................... no
120 ODBC ................................... no
121 PostgreSQL ............................. no
122 SQLite2 ................................ no
123 SQLite ................................. no
124 Using system provided SQLite ......... no
125 TDS (Sybase) ........................... no
126127Note: Using static linking will disable the use of dynamically
128loaded plugins. Make sure to import all needed static plugins,
129or compile needed modules into the library.130131Note: -optimized-tools is not useful in-release mode.132133Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing.134135ERROR: Qt requires a compliant STL library.136137ERROR: detected a std::atomic implementation that fails for function pointers.138Please apply the patch corresponding to your Standard Library vendor, found in139 qtbase/config.tests/atomicfptr
140141ERROR: Feature 'openssl-linked' was enabled, but the pre-condition '!features.securetransport && libs.openssl' failed.142143ERROR: Feature 'openssl' was enabled, but the pre-condition '!features.securetransport && (features.openssl-linked || libs.openssl_headers)' failed.144145ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed.146147ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig' failed.148funcs.mk:243: recipe for target '/home/ubuntu/build/bitcoin/depends/work/build/powerpc64-linux-gnu/qt/5.9.7-72625d07ee6/qtbase/.stamp_configured' failed
149make: *** [/home/ubuntu/build/bitcoin/depends/work/build/powerpc64-linux-gnu/qt/5.9.7-72625d07ee6/qtbase/.stamp_configured] Error 3150make: 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:
5657 sudo apt-get install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
5859+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: 2024-11-17 03:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me