0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-06 14:19:59 -05:00

Merge #21255: contrib: run test-symbol-check for RISC-V

ccb7b6a976 contrib: run test-symbol check for RISCV (fanquake)

Pull request description:

  Now that we are using Focal for gitian building (glibc 2.31), we can use a newer introduced symbol, and include RISC-V in this test.

ACKs for top commit:
  laanwj:
    Code review re-ACK ccb7b6a976

Tree-SHA512: 4ddaafc0b6cced49a504847ed8da02b0a514eca69014fdc2ad01068c6f8ddf9ad992525f47b2a182c3b4a5845f8dacfe5a7e4acf2f303a5dab6a70daa3b89509
This commit is contained in:
Wladimir J. van der Laan 2021-02-22 12:31:05 +01:00
commit 84af29337c
No known key found for this signature in database
GPG key ID: 1E4AED62986CD25D
3 changed files with 9 additions and 12 deletions

View file

@ -13,3 +13,4 @@ export DEP_OPTS="MULTIPROCESS=1"
export GOAL="install" export GOAL="install"
export BITCOIN_CONFIG="--with-boost-process" export BITCOIN_CONFIG="--with-boost-process"
export TEST_RUNNER_ENV="BITCOIND=bitcoin-node" export TEST_RUNNER_ENV="BITCOIND=bitcoin-node"
export RUN_SECURITY_TESTS="true"

View file

@ -11,7 +11,6 @@ export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic gcc-7 can compile our c
export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev" export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1" export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1"
export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash
export RUN_SECURITY_TESTS="true"
export RUN_UNIT_TESTS_SEQUENTIAL="true" export RUN_UNIT_TESTS_SEQUENTIAL="true"
export RUN_UNIT_TESTS="false" export RUN_UNIT_TESTS="false"
export GOAL="install" export GOAL="install"

View file

@ -23,29 +23,26 @@ class TestSymbolChecks(unittest.TestCase):
executable = 'test1' executable = 'test1'
cc = 'gcc' cc = 'gcc'
# there's no way to do this test for RISC-V at the moment; bionic's libc is 2.27 # renameat2 was introduced in GLIBC 2.28, so is newer than the upper limit
# and we allow all symbols from 2.27. # of glibc for all platforms
if 'riscv' in get_machine(cc):
self.skipTest("test not available for RISC-V")
# memfd_create was introduced in GLIBC 2.27, so is newer than the upper limit of
# all but RISC-V but still available on bionic
with open(source, 'w', encoding="utf8") as f: with open(source, 'w', encoding="utf8") as f:
f.write(''' f.write('''
#define _GNU_SOURCE #define _GNU_SOURCE
#include <sys/mman.h> #include <stdio.h>
#include <linux/fs.h>
int memfd_create(const char *name, unsigned int flags); int renameat2(int olddirfd, const char *oldpath,
int newdirfd, const char *newpath, unsigned int flags);
int main() int main()
{ {
memfd_create("test", 0); renameat2(0, "test", 0, "test_", RENAME_EXCHANGE);
return 0; return 0;
} }
''') ''')
self.assertEqual(call_symbol_check(cc, source, executable, []), self.assertEqual(call_symbol_check(cc, source, executable, []),
(1, executable + ': symbol memfd_create from unsupported version GLIBC_2.27\n' + (1, executable + ': symbol renameat2 from unsupported version GLIBC_2.28\n' +
executable + ': failed IMPORTED_SYMBOLS')) executable + ': failed IMPORTED_SYMBOLS'))
# -lutil is part of the libc6 package so a safe bet that it's installed # -lutil is part of the libc6 package so a safe bet that it's installed