contrib: run test-symbol check for RISCV

Now that we are using Focal for Gitian building (glibc 2.31), we can
user a newer introduced  symbol, and include RISCV in this test.
pull/21255/head
fanquake 4 years ago
parent 5bb64acd9d
commit ccb7b6a976
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

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

@ -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 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 RUN_SECURITY_TESTS="true"
export RUN_UNIT_TESTS_SEQUENTIAL="true"
export RUN_UNIT_TESTS="false"
export GOAL="install"

@ -23,29 +23,26 @@ class TestSymbolChecks(unittest.TestCase):
executable = 'test1'
cc = 'gcc'
# there's no way to do this test for RISC-V at the moment; bionic's libc is 2.27
# and we allow all symbols from 2.27.
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
# renameat2 was introduced in GLIBC 2.28, so is newer than the upper limit
# of glibc for all platforms
with open(source, 'w', encoding="utf8") as f:
f.write('''
#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()
{
memfd_create("test", 0);
renameat2(0, "test", 0, "test_", RENAME_EXCHANGE);
return 0;
}
''')
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'))
# -lutil is part of the libc6 package so a safe bet that it's installed

Loading…
Cancel
Save