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.
This commit is contained in:
1 parent
a33381acf5
commit
e8cd3700ee
1 file changed
+12
-10
@@ -41,7 +41,14 @@ import pixie
|
|||||||
#
|
#
|
||||||
MAX_VERSIONS = {
|
MAX_VERSIONS = {
|
||||||
'GCC': (4,8,0),
|
'GCC': (4,8,0),
|
||||||
'GLIBC': (2,17),
|
'GLIBC': {
|
||||||
|
pixie.EM_386: (2,17),
|
||||||
|
pixie.EM_X86_64: (2,17),
|
||||||
|
pixie.EM_ARM: (2,17),
|
||||||
|
pixie.EM_AARCH64:(2,17),
|
||||||
|
pixie.EM_PPC64: (2,17),
|
||||||
|
pixie.EM_RISCV: (2,27),
|
||||||
|
},
|
||||||
'LIBATOMIC': (1,0),
|
'LIBATOMIC': (1,0),
|
||||||
'V': (0,5,0), # xkb (bitcoin-qt only)
|
'V': (0,5,0), # xkb (bitcoin-qt only)
|
||||||
}
|
}
|
||||||
@@ -79,14 +86,6 @@ ELF_ALLOWED_LIBRARIES = {
|
|||||||
'libfreetype.so.6', # font parsing
|
'libfreetype.so.6', # font parsing
|
||||||
'libdl.so.2' # programming interface to dynamic linker
|
'libdl.so.2' # programming interface to dynamic linker
|
||||||
}
|
}
|
||||||
ARCH_MIN_GLIBC_VER = {
|
|
||||||
pixie.EM_386: (2,1),
|
|
||||||
pixie.EM_X86_64: (2,2,5),
|
|
||||||
pixie.EM_ARM: (2,4),
|
|
||||||
pixie.EM_AARCH64:(2,17),
|
|
||||||
pixie.EM_PPC64: (2,17),
|
|
||||||
pixie.EM_RISCV: (2,27)
|
|
||||||
}
|
|
||||||
|
|
||||||
MACHO_ALLOWED_LIBRARIES = {
|
MACHO_ALLOWED_LIBRARIES = {
|
||||||
# bitcoind and bitcoin-qt
|
# bitcoind and bitcoin-qt
|
||||||
@@ -162,7 +161,10 @@ def check_version(max_versions, version, arch) -> bool:
|
|||||||
ver = tuple([int(x) for x in ver.split('.')])
|
ver = tuple([int(x) for x in ver.split('.')])
|
||||||
if not lib in max_versions:
|
if not lib in max_versions:
|
||||||
return False
|
return False
|
||||||
return ver <= max_versions[lib] or lib == 'GLIBC' and ver <= ARCH_MIN_GLIBC_VER[arch]
|
if isinstance(max_versions[lib], tuple):
|
||||||
|
return ver <= max_versions[lib]
|
||||||
|
else:
|
||||||
|
return ver <= max_versions[lib][arch]
|
||||||
|
|
||||||
def check_imported_symbols(filename) -> bool:
|
def check_imported_symbols(filename) -> bool:
|
||||||
elf = pixie.load(filename)
|
elf = pixie.load(filename)
|
||||||
|
|||||||
Reference in new issue
Block a user