This export was introduced in #17270 which added
//! Necessary on some platforms
extern char** environ;
This should (finally) make the gitian build pass again (fix issue #17525.).
Built on top of #17538 which should be merged first.
Ever since statically linking Qt, we've been linking the C++ library
statically too (-static-libstdc++). Take this into
account in the symbol checker.
Debian 8 (Jessie) has:
- g++ version 4.9.2
- libc version 2.19
Ubuntu 16.04.4 (Xenial) has:
- g++ version 5.3.1
- libc version 2.23.0
CentOS 7 has:
- g++ version 4.8.5
- libc version 2.17
Taking the minimum of these as our target.
According to the GNU ABI document this corresponds to:
- GCC 4.8.5: GCC_4.8.0
- (glibc) GLIBC_2_17
Co-Authored-By: fanquake <fanquake@gmail.com>
This export was introduced in #17270 which added
```
//! Necessary on some platforms
extern char** environ;
```
I also think it'd be OK to remove the exports check completely. It was introduced back in the day because of symbol collisions between dynamically-linked Qt and the built-in statically built OpenSSL which could have scary implications.
This hasn't been the case for ages—ever since Qt5 and before, we've statically linked Qt—and we don't even use OpenSSL anymore. I don't think a binary that exports symbols can usually cause problems (exporting excessive numbers of symbols would be an indication that something is going wrong in the link, but besides that).
The check is already being skipped for some architectures.
It looks like there is a third problem that needs to be fixed before gitian passes again, the RISC-V binaries fail on the NX (non-executable stack) check.
I'm really confused as to what could cause this. Will try to bisect. I suspect it's another unexpected by-effect of #17270, because it passes with 1baf7d1819317e4f4aeeaba2f9d72057e63b1fea.
Edit: no, it's not #17270, I don't have the issue with 0bb37e437e9cb4a29476edc9fa42f3e03c8bd797
Edit: bisected it to b49b6b0f7090cc15860d815fb0ef306ddfc718ba . Seems that linking to OpenSSL was the only thing that made it set noexecstack, on RISC-V. I'm not sure why yet, although we do explicitly pass -Wa,--noexecstack" CFLAGS there.
(removed "needs gitian build" for now as i'm sure it will fail, will add it back after fixing this)
Added a workaround to force noexecstack on RISC-V (I can't find any reason why this is different from other platforms, so blaming it on the immaturity of the toolchain, FWIW: gcc 9.2.1 on native Fedora RISC-V does get this right):
# Workaround for Ubuntu's g++ compiler for RV64, which
# doesn't add .note.GNU-stack sections automatically unlike other platforms,
# resulting in a NX failure of the binary in security-check.py
# TODO: remove this when no longer needed
if [ "${i}" = "riscv64-linux-gnu" ]; then
HOST_LDFLAGS="${HOST_LDFLAGS_BASE} -Wl,-z,noexecstack"
else
HOST_LDFLAGS="${HOST_LDFLAGS_BASE}"
fi
This is necessary now that the flag is no longer "inherited" through OpenSSL's build settings.
I think this should be it.
<!--a722867cd34abeea1fadc8d60700f111-->
| File | commit 0b79caf658019de2c65a53c9e11fd1d2f4c369b6<br>(master) | commit 32870545c8ab5860b44bd96936c69a27b493d1da<br>(master and this pull) |
|---|---|---|
| bitcoin-0.19.99-osx-unsigned.dmg | 2f8db30ccf876813... |
82343ad664875e96... |
| bitcoin-0.19.99-osx64.tar.gz | e692e7414fd60d08... |
eb1e8c377377a213... |
| bitcoin-0.19.99-win64-debug.zip | d5aac0d177e3dd19... |
b34cd515f1dbb637... |
| bitcoin-0.19.99-win64-setup-unsigned.exe | 99e74ad4f140b9f8... |
ea20a481f8622076... |
| bitcoin-0.19.99-win64.zip | 5ee17a36809deed3... |
66f3245a53c8ada3... |
| bitcoin-0.19.99.tar.gz | 60c0d2b9351b2072... |
4cd8c5397c650f69... |
| bitcoin-core-osx-0.20-res.yml | 496ef99b99af9cbc... |
48332aaaa2c60e36... |
| bitcoin-core-win-0.20-res.yml | e59bdc5fb20fdf13... |
309ecb699ef99f07... |
| linux-build.log | 3a0ebaaea4f04719... |
82589ac811ca3239... |
| osx-build.log | ac5e595f7863b747... |
b34943c2650f8d33... |
| win-build.log | 0e887a344ee447e9... |
7d58d84db71362f8... |
| bitcoin-core-osx-0.20-res.yml.diff | 895a4bab149fe1af... |
|
| bitcoin-core-win-0.20-res.yml.diff | f1ed4819b157fd5c... |
|
| linux-build.log.diff | 061419aa8adac16c... |
|
| osx-build.log.diff | 8cec15944eb98c34... |
|
| win-build.log.diff | c57597d6d218619c... |
Issue (hopefully correctly) reported upstream: https://bugs.launchpad.net/ubuntu/+source/gcc-8-cross-ports/+bug/1853740 (updated commit message and comment for upstream issue)
Work around https://bugs.launchpad.net/ubuntu/+source/gcc-8-cross-ports/+bug/1853740.
<!--a722867cd34abeea1fadc8d60700f111-->
| File | commit 2eeacdfe44e5f5cbb240f92b3d7ddcdf5079dc3b<br>(master) | commit 144cfbad5df96a1a4a97ba98d505700e334efa8e<br>(master and this pull) |
|---|---|---|
| bitcoin-0.19.99-osx-unsigned.dmg | 9d05f23d3ce7ffd1... |
782f72b90f18c7c0... |
| bitcoin-0.19.99-osx64.tar.gz | 14fde6d21fa0df03... |
053715c9149fbd25... |
| bitcoin-0.19.99-win64-debug.zip | c78aee8a8c2c4ae0... |
a52a8f036f1df958... |
| bitcoin-0.19.99-win64-setup-unsigned.exe | 8156ba3b081bf2c4... |
d7ce63f9714aa678... |
| bitcoin-0.19.99-win64.zip | cad87205c28ae17d... |
bf51d177625cdb7d... |
| bitcoin-0.19.99.tar.gz | 46dfa562551072cb... |
5040ad08bc1e402a... |
| bitcoin-core-osx-0.20-res.yml | 43eae47a941ba34d... |
80317d208000be54... |
| bitcoin-core-win-0.20-res.yml | 3e08f7574e6f4f8d... |
febd388c91ac60c2... |
| linux-build.log | 45da2e115d050f5d... |
e0cc8fd1cd1d3bcf... |
| osx-build.log | b4b31f4eab66517d... |
ea6285cfdd1ddfd3... |
| win-build.log | f7628df4d0e3626e... |
4af0bea034cf10e0... |
| bitcoin-0.19.99-aarch64-linux-gnu-debug.tar.gz | a1864a0a0db049fa... |
|
| bitcoin-0.19.99-aarch64-linux-gnu.tar.gz | 16f123fd5ecb608f... |
|
| bitcoin-0.19.99-arm-linux-gnueabihf-debug.tar.gz | fe966ae938727336... |
|
| bitcoin-0.19.99-arm-linux-gnueabihf.tar.gz | 3c4527f935d82e9f... |
|
| bitcoin-0.19.99-i686-pc-linux-gnu-debug.tar.gz | a33a46e5bb9aee2a... |
|
| bitcoin-0.19.99-i686-pc-linux-gnu.tar.gz | cf61a9ce3a1da558... |
|
| bitcoin-0.19.99-riscv64-linux-gnu-debug.tar.gz | 7aa8c7d73913d990... |
|
| bitcoin-0.19.99-riscv64-linux-gnu.tar.gz | e72e23083959b56f... |
|
| bitcoin-0.19.99-x86_64-linux-gnu-debug.tar.gz | e3583adbf8616184... |
|
| bitcoin-0.19.99-x86_64-linux-gnu.tar.gz | be927699aacba560... |
|
| bitcoin-core-linux-0.20-res.yml | 31194810f698f0cb... |
|
| bitcoin-core-osx-0.20-res.yml.diff | 56c1281a4cddb0ce... |
|
| bitcoin-core-win-0.20-res.yml.diff | 47177a1074bd1ea2... |
|
| linux-build.log.diff | ca6a1e0fbd16a1fa... |
|
| osx-build.log.diff | 499fece744e01854... |
|
| win-build.log.diff | 0cb56cc3f2779056... |
I'm going to untag this as needing backport to 0.19, as per my comments here:
Is backporting either of these really required?
The changes that necessitated https://github.com/bitcoin/bitcoin/commit/f6e42256fe8900ed90f9644906b77f97e1600952 (https://github.com/bitcoin/bitcoin/pull/18175/commits/102547606f512f791ded0a610afe9f41b3ef2666 here) are not in the
0.19branch.
As for https://github.com/bitcoin/bitcoin/pull/17569/commits/eafd2593674b6890418a50eadf69425071b824e4, the
0.19.1rc2RISCV binaries still have GNU_STACK marked asRW, because we're still receiving it from OpenSSL: