Skip to content

Commit ccb7b6a

Browse files
committed
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.
1 parent 5bb64ac commit ccb7b6a

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

ci/test/00_setup_env_native_multiprocess.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ export DEP_OPTS="MULTIPROCESS=1"
1313
export GOAL="install"
1414
export BITCOIN_CONFIG="--with-boost-process"
1515
export TEST_RUNNER_ENV="BITCOIND=bitcoin-node"
16+
export RUN_SECURITY_TESTS="true"

ci/test/00_setup_env_native_qt5.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic gcc-7 can compile our c
1111
export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev"
1212
export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1"
1313
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
14-
export RUN_SECURITY_TESTS="true"
1514
export RUN_UNIT_TESTS_SEQUENTIAL="true"
1615
export RUN_UNIT_TESTS="false"
1716
export GOAL="install"

contrib/devtools/test-symbol-check.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,26 @@ def test_ELF(self):
2323
executable = 'test1'
2424
cc = 'gcc'
2525

26-
# there's no way to do this test for RISC-V at the moment; bionic's libc is 2.27
27-
# and we allow all symbols from 2.27.
28-
if 'riscv' in get_machine(cc):
29-
self.skipTest("test not available for RISC-V")
30-
31-
# memfd_create was introduced in GLIBC 2.27, so is newer than the upper limit of
32-
# all but RISC-V but still available on bionic
26+
# renameat2 was introduced in GLIBC 2.28, so is newer than the upper limit
27+
# of glibc for all platforms
3328
with open(source, 'w', encoding="utf8") as f:
3429
f.write('''
3530
#define _GNU_SOURCE
36-
#include <sys/mman.h>
31+
#include <stdio.h>
32+
#include <linux/fs.h>
3733
38-
int memfd_create(const char *name, unsigned int flags);
34+
int renameat2(int olddirfd, const char *oldpath,
35+
int newdirfd, const char *newpath, unsigned int flags);
3936
4037
int main()
4138
{
42-
memfd_create("test", 0);
39+
renameat2(0, "test", 0, "test_", RENAME_EXCHANGE);
4340
return 0;
4441
}
4542
''')
4643

4744
self.assertEqual(call_symbol_check(cc, source, executable, []),
48-
(1, executable + ': symbol memfd_create from unsupported version GLIBC_2.27\n' +
45+
(1, executable + ': symbol renameat2 from unsupported version GLIBC_2.28\n' +
4946
executable + ': failed IMPORTED_SYMBOLS'))
5047

5148
# -lutil is part of the libc6 package so a safe bet that it's installed

0 commit comments

Comments
 (0)