Skip to content

Commit e8cd370

Browse files
committed
devtools: Integrate ARCH_MIN_GLIBC_VER table into MAX_VERSIONS in symbol-check.py
The (ancient) versions specified here were deceptive. Entries older than MAX_VERSIONS['GLIBC'], which is 2.17, are ignored here. So reorganize the code to avoid confusion for other people reading this code.
1 parent a33381a commit e8cd370

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

contrib/devtools/symbol-check.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@
4141
#
4242
MAX_VERSIONS = {
4343
'GCC': (4,8,0),
44-
'GLIBC': (2,17),
44+
'GLIBC': {
45+
pixie.EM_386: (2,17),
46+
pixie.EM_X86_64: (2,17),
47+
pixie.EM_ARM: (2,17),
48+
pixie.EM_AARCH64:(2,17),
49+
pixie.EM_PPC64: (2,17),
50+
pixie.EM_RISCV: (2,27),
51+
},
4552
'LIBATOMIC': (1,0),
4653
'V': (0,5,0), # xkb (bitcoin-qt only)
4754
}
@@ -79,14 +86,6 @@
7986
'libfreetype.so.6', # font parsing
8087
'libdl.so.2' # programming interface to dynamic linker
8188
}
82-
ARCH_MIN_GLIBC_VER = {
83-
pixie.EM_386: (2,1),
84-
pixie.EM_X86_64: (2,2,5),
85-
pixie.EM_ARM: (2,4),
86-
pixie.EM_AARCH64:(2,17),
87-
pixie.EM_PPC64: (2,17),
88-
pixie.EM_RISCV: (2,27)
89-
}
9089

9190
MACHO_ALLOWED_LIBRARIES = {
9291
# bitcoind and bitcoin-qt
@@ -162,7 +161,10 @@ def check_version(max_versions, version, arch) -> bool:
162161
ver = tuple([int(x) for x in ver.split('.')])
163162
if not lib in max_versions:
164163
return False
165-
return ver <= max_versions[lib] or lib == 'GLIBC' and ver <= ARCH_MIN_GLIBC_VER[arch]
164+
if isinstance(max_versions[lib], tuple):
165+
return ver <= max_versions[lib]
166+
else:
167+
return ver <= max_versions[lib][arch]
166168

167169
def check_imported_symbols(filename) -> bool:
168170
elf = pixie.load(filename)

0 commit comments

Comments
 (0)