From 619af6dd9c0bdfbbcfba407e9dd098c107246c91 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 29 Aug 2021 19:51:36 +0200 Subject: [PATCH 1/4] feat: add `libz.so.1` to whitelisted libraries This also requires to blacklist some symbols from `libz.so.1`. There was some breakage in ABI compatibility for this library. It's seems unlikely that those symbols are used in the wild. --- auditwheel/elfutils.py | 24 +++++ auditwheel/main_repair.py | 7 ++ auditwheel/main_show.py | 30 ++++-- auditwheel/policy/external_references.py | 12 ++- auditwheel/policy/manylinux-policy.json | 112 ++++++++++++++++------- auditwheel/policy/musllinux-policy.json | 17 ++-- auditwheel/policy/policy-schema.json | 33 ++----- auditwheel/wheel_abi.py | 21 ++++- tests/integration/test_manylinux.py | 34 +++++++ tests/integration/testzlib/setup.py | 17 ++++ tests/integration/testzlib/testzlib.c | 46 ++++++++++ 11 files changed, 275 insertions(+), 78 deletions(-) create mode 100644 tests/integration/testzlib/setup.py create mode 100644 tests/integration/testzlib/testzlib.c diff --git a/auditwheel/elfutils.py b/auditwheel/elfutils.py index d6873e51..64a50153 100644 --- a/auditwheel/elfutils.py +++ b/auditwheel/elfutils.py @@ -137,3 +137,27 @@ def is_subdir(path: str, directory: str) -> bool: if relative.startswith(os.pardir): return False return True + + +def filter_undefined_symbols( + path: str, symbols: Dict[str, List[str]] +) -> Dict[str, List[str]]: + if not symbols: + return {} + undef_symbols = set("*") + with open(path, "rb") as f: + elf = ELFFile(f) + section = elf.get_section_by_name(".dynsym") + if section is not None: + # look for all undef symbols + for sym in section.iter_symbols(): + if sym["st_shndx"] == "SHN_UNDEF": + undef_symbols.add(sym.name) + + result = {} + for lib in symbols: + intersection = set(symbols[lib]) & undef_symbols + if intersection: + result[lib] = sorted(intersection) + + return result diff --git a/auditwheel/main_repair.py b/auditwheel/main_repair.py index 6ff2fc83..c4fafa79 100644 --- a/auditwheel/main_repair.py +++ b/auditwheel/main_repair.py @@ -135,6 +135,13 @@ def execute(args, p): ) p.error(msg) + if reqd_tag > get_priority_by_name(wheel_abi.blacklist_tag): + msg = ( + 'cannot repair "%s" to "%s" ABI because it depends on ' + "black-listed symbols." % (args.WHEEL_FILE, args.PLAT) + ) + p.error(msg) + abis = [policy["name"]] + policy["aliases"] if not args.ONLY_PLAT: if reqd_tag < get_priority_by_name(wheel_abi.overall_tag): diff --git a/auditwheel/main_show.py b/auditwheel/main_show.py index 67e0174f..6bfdaae3 100644 --- a/auditwheel/main_show.py +++ b/auditwheel/main_show.py @@ -103,12 +103,26 @@ def execute(args, p): for p in sorted(load_policies(), key=lambda p: p["priority"]): if p["priority"] > get_priority_by_name(winfo.overall_tag): - printp( - ( - 'In order to achieve the tag platform tag "%s" ' - "the following shared library dependencies " - "will need to be eliminated:" + libs = winfo.external_refs[p["name"]]["libs"] + if len(libs): + printp( + ( + 'In order to achieve the tag platform tag "%s" ' + "the following shared library dependencies " + "will need to be eliminated:" + ) + % p["name"] ) - % p["name"] - ) - printp(", ".join(sorted(winfo.external_refs[p["name"]]["libs"].keys()))) + printp(", ".join(sorted(libs.keys()))) + blacklist = winfo.external_refs[p["name"]]["blacklist"] + if len(blacklist): + printp( + ( + 'In order to achieve the tag platform tag "%s" ' + "the following black-listed symbol dependencies " + "will need to be eliminated:" + ) + % p["name"] + ) + for key in sorted(blacklist.keys()): + printp(f"From {key}: " + ", ".join(sorted(blacklist[key]))) diff --git a/auditwheel/policy/external_references.py b/auditwheel/policy/external_references.py index 4aabcfa5..cecd5948 100644 --- a/auditwheel/policy/external_references.py +++ b/auditwheel/policy/external_references.py @@ -2,7 +2,7 @@ import re from typing import Any, Dict, Generator, Set -from ..elfutils import is_subdir +from ..elfutils import filter_undefined_symbols, is_subdir from . import load_policies log = logging.getLogger(__name__) @@ -45,6 +45,7 @@ def get_req_external(libs: Set[str], whitelist: Set[str]) -> Set[str]: ret = {} # type: Dict[str, Dict[str, Any]] for p in policies: needed_external_libs = set() # type: Set[str] + blacklist = {} if not (p["name"] == "linux" and p["priority"] == 0): # special-case the generic linux platform here, because it @@ -52,6 +53,9 @@ def get_req_external(libs: Set[str], whitelist: Set[str]) -> Set[str]: # whitelist is the complete set of all libraries. so nothing # is considered "external" that needs to be copied in. whitelist = set(p["lib_whitelist"]) + blacklist_libs = set(p["blacklist"].keys()) & set(lddtree["needed"]) + blacklist = {k: p["blacklist"][k] for k in blacklist_libs} + blacklist = filter_undefined_symbols(lddtree["realpath"], blacklist) needed_external_libs = get_req_external( set(filter_libs(lddtree["needed"], whitelist)), whitelist ) @@ -66,5 +70,9 @@ def get_req_external(libs: Set[str], whitelist: Set[str]) -> Set[str]: log.debug("RPATH FTW: %s", lib) continue pol_ext_deps[lib] = lddtree["libs"][lib]["realpath"] - ret[p["name"]] = {"libs": pol_ext_deps, "priority": p["priority"]} + ret[p["name"]] = { + "libs": pol_ext_deps, + "priority": p["priority"], + "blacklist": blacklist, + } return ret diff --git a/auditwheel/policy/manylinux-policy.json b/auditwheel/policy/manylinux-policy.json index a8efca23..214f5bd9 100644 --- a/auditwheel/policy/manylinux-policy.json +++ b/auditwheel/policy/manylinux-policy.json @@ -3,7 +3,8 @@ "aliases": [], "priority": 0, "symbol_versions": {}, - "lib_whitelist": [] + "lib_whitelist": [], + "blacklist": {} }, {"name": "manylinux_2_5", "aliases": ["manylinux1"], @@ -13,13 +14,15 @@ "CXXABI": ["1.3", "1.3.1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "4.0.0", "4.2.0"], "GLIBC": ["2.0", "2.1", "2.1.1", "2.1.2", "2.1.3", "2.2", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8"], + "ZLIB": [] }, "x86_64": { "CXXABI": ["1.3", "1.3.1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0"], "GLIBC": ["2.2.5", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8"], + "ZLIB": [] } }, "lib_whitelist": [ @@ -29,8 +32,12 @@ "libc.so.6", "libnsl.so.1", "libutil.so.1", "libpthread.so.0", "libX11.so.6", "libXext.so.6", "libXrender.so.1", "libICE.so.6", "libSM.so.6", "libGL.so.1", "libgobject-2.0.so.0", - "libgthread-2.0.so.0", "libglib-2.0.so.0", "libresolv.so.2" - ]}, + "libgthread-2.0.so.0", "libglib-2.0.so.0", "libresolv.so.2", + "libz.so.1" + ], + "blacklist": { + "libz.so.1": ["_dist_code", "_length_code", "_tr_align", "_tr_flush_block", "_tr_init", "_tr_stored_block", "_tr_tally", "bi_windup", "crc32_vpmsum", "crc_fold_512to32", "crc_fold_copy", "crc_fold_init", "deflate_copyright", "deflate_medium", "fill_window", "flush_pending", "gzflags", "inflate_copyright", "inflate_fast", "inflate_table", "longest_match", "slide_hash_sse", "static_ltree", "uncompress2", "x86_check_features", "x86_cpu_has_pclmul", "x86_cpu_has_sse2", "x86_cpu_has_sse42", "z_errmsg", "zcalloc", "zcfree"] + }}, {"name": "manylinux_2_12", "aliases": ["manylinux2010"], "priority": 90, @@ -39,13 +46,15 @@ "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "4.0.0", "4.2.0", "4.3.0", "4.4.0", "4.5.0"], "GLIBC": ["2.0", "2.1", "2.1.1", "2.1.2", "2.1.3", "2.2", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4"] }, "x86_64": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0"], "GLIBC": ["2.2.5", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4"] } }, "lib_whitelist": [ @@ -56,8 +65,12 @@ "libX11.so.6", "libXext.so.6", "libXrender.so.1", "libICE.so.6", "libSM.so.6", "libGL.so.1", "libgobject-2.0.so.0", "libgthread-2.0.so.0", "libglib-2.0.so.0", "libresolv.so.2", - "libexpat.so.1" - ]}, + "libexpat.so.1", + "libz.so.1" + ], + "blacklist": { + "libz.so.1": ["_dist_code", "_length_code", "_tr_align", "_tr_flush_block", "_tr_init", "_tr_stored_block", "_tr_tally", "bi_windup", "crc32_vpmsum", "crc_fold_512to32", "crc_fold_copy", "crc_fold_init", "deflate_copyright", "deflate_medium", "fill_window", "flush_pending", "gzflags", "inflate_copyright", "inflate_fast", "inflate_table", "longest_match", "slide_hash_sse", "static_ltree", "uncompress2", "x86_check_features", "x86_cpu_has_pclmul", "x86_cpu_has_sse2", "x86_cpu_has_sse42", "z_errmsg", "zcalloc", "zcfree"] + }}, {"name": "manylinux_2_17", "aliases": ["manylinux2014"], "priority": 80, @@ -66,43 +79,50 @@ "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "4.0.0", "4.2.0", "4.3.0", "4.4.0", "4.5.0", "4.7.0", "4.8.0"], "GLIBC": ["2.0", "2.1", "2.1.1", "2.1.2", "2.1.3", "2.2", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "x86_64": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0", "4.7.0", "4.8.0"], "GLIBC": ["2.2.5", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "aarch64": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0", "4.5.0", "4.7.0"], "GLIBC": ["2.0", "2.17", "2.18"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "ppc64": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0", "4.4.0", "4.5.0", "4.7.0", "4.8.0"], "GLIBC": ["2.0", "2.1", "2.1.1", "2.1.2", "2.1.3", "2.2", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.5", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "ppc64le": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "LDBL_1.3", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0", "4.7.0"], "GLIBC": ["2.0", "2.17"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.7"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.7"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "s390x": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "LDBL_1.3", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.1.0", "4.2.0", "4.3.0", "4.7.0"], "GLIBC": ["2.2", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.7"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.7"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "armv7l": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "ARM_1.3.3", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.3.4", "3.4", "3.4.2", "3.5", "4.0.0", "4.2.0", "4.3.0", "4.7.0"], "GLIBC": ["2.0", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] } }, "lib_whitelist": [ @@ -113,8 +133,12 @@ "libX11.so.6", "libXext.so.6", "libXrender.so.1", "libICE.so.6", "libSM.so.6", "libGL.so.1", "libgobject-2.0.so.0", "libgthread-2.0.so.0", "libglib-2.0.so.0", "libresolv.so.2", - "libexpat.so.1" - ]}, + "libexpat.so.1", + "libz.so.1" + ], + "blacklist": { + "libz.so.1": ["_dist_code", "_length_code", "_tr_align", "_tr_flush_block", "_tr_init", "_tr_stored_block", "_tr_tally", "bi_windup", "crc32_vpmsum", "crc_fold_512to32", "crc_fold_copy", "crc_fold_init", "deflate_copyright", "deflate_medium", "fill_window", "flush_pending", "gzflags", "inflate_copyright", "inflate_fast", "inflate_table", "longest_match", "slide_hash_sse", "static_ltree", "uncompress2", "x86_check_features", "x86_cpu_has_pclmul", "x86_cpu_has_sse2", "x86_cpu_has_sse42", "z_errmsg", "zcalloc", "zcfree"] + }}, {"name": "manylinux_2_24", "aliases": [], "priority": 70, @@ -123,37 +147,43 @@ "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "FLOAT128", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "4.0.0", "4.2.0", "4.3.0", "4.4.0", "4.5.0", "4.7.0", "4.8.0"], "GLIBC": ["2.0", "2.1", "2.1.1", "2.1.2", "2.1.3", "2.2", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18", "2.22", "2.23", "2.24"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "x86_64": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "FLOAT128", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0", "4.7.0", "4.8.0"], "GLIBC": ["2.2.5", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18", "2.22", "2.23", "2.24"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "aarch64": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0", "4.5.0", "4.7.0"], "GLIBC": ["2.0", "2.17", "2.18", "2.22", "2.23", "2.24"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "ppc64le": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "LDBL_1.3", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0", "4.7.0"], "GLIBC": ["2.0", "2.17", "2.18", "2.22", "2.23", "2.24"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.21", "LDBL_3.4.7"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.21", "LDBL_3.4.7"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "s390x": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "LDBL_1.3", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.1.0", "4.2.0", "4.3.0", "4.7.0"], "GLIBC": ["2.2", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18", "2.19", "2.22", "2.23", "2.24"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.21", "LDBL_3.4.7"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.21", "LDBL_3.4.7"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] }, "armv7l": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "ARM_1.3.3", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.3.4", "3.4", "3.4.2", "3.5", "4.0.0", "4.2.0", "4.3.0", "4.7.0"], "GLIBC": ["2.0", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18", "2.22", "2.23", "2.24"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2"] } }, "lib_whitelist": [ @@ -164,8 +194,12 @@ "libX11.so.6", "libXext.so.6", "libXrender.so.1", "libICE.so.6", "libSM.so.6", "libGL.so.1", "libgobject-2.0.so.0", "libgthread-2.0.so.0", "libglib-2.0.so.0", "libresolv.so.2", - "libexpat.so.1" - ]}, + "libexpat.so.1", + "libz.so.1" + ], + "blacklist": { + "libz.so.1": ["_dist_code", "_length_code", "_tr_align", "_tr_flush_block", "_tr_init", "_tr_stored_block", "_tr_tally", "bi_windup", "crc32_vpmsum", "crc_fold_512to32", "crc_fold_copy", "crc_fold_init", "deflate_copyright", "deflate_medium", "fill_window", "flush_pending", "gzflags", "inflate_copyright", "inflate_fast", "inflate_table", "longest_match", "slide_hash_sse", "static_ltree", "uncompress2", "x86_check_features", "x86_cpu_has_pclmul", "x86_cpu_has_sse2", "x86_cpu_has_sse42", "z_errmsg", "zcalloc", "zcfree"] + }}, {"name": "manylinux_2_27", "aliases": [], "priority": 65, @@ -174,37 +208,43 @@ "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "1.3.11", "FLOAT128", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "4.0.0", "4.2.0", "4.3.0", "4.4.0", "4.5.0", "4.7.0", "4.8.0", "7.0.0"], "GLIBC": ["2.0", "2.1", "2.1.1", "2.1.2", "2.1.3", "2.2", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18", "2.22", "2.23", "2.24", "2.25", "2.26", "2.27"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2", "1.2.7.1", "1.2.9"] }, "x86_64": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "1.3.11", "FLOAT128", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0", "4.7.0", "4.8.0", "7.0.0"], "GLIBC": ["2.2.5", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18", "2.22", "2.23", "2.24", "2.25", "2.26", "2.27"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2", "1.2.7.1", "1.2.9"] }, "aarch64": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "1.3.11", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0", "4.5.0", "4.7.0", "7.0.0"], "GLIBC": ["2.0", "2.17", "2.18", "2.22", "2.23", "2.24", "2.25", "2.26", "2.27"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2", "1.2.7.1", "1.2.9"] }, "ppc64le": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "1.3.11", "LDBL_1.3", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.2.0", "4.3.0", "4.7.0", "7.0.0"], "GLIBC": ["2.0", "2.17", "2.18", "2.22", "2.23", "2.24", "2.25", "2.26", "2.27"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.21", "LDBL_3.4.7"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.21", "LDBL_3.4.7"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2", "1.2.7.1", "1.2.9"] }, "s390x": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "1.3.11", "LDBL_1.3", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.4", "3.4.2", "3.4.4", "4.0.0", "4.1.0", "4.2.0", "4.3.0", "4.7.0", "7.0.0"], "GLIBC": ["2.2", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "2.2.6", "2.3", "2.3.2", "2.3.3", "2.3.4", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18", "2.19", "2.22", "2.23", "2.24", "2.25", "2.26", "2.27"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.21", "LDBL_3.4.7"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24", "LDBL_3.4", "LDBL_3.4.10", "LDBL_3.4.21", "LDBL_3.4.7"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2", "1.2.7.1", "1.2.9"] }, "armv7l": { "CXXABI": ["1.3", "1.3.1", "1.3.2", "1.3.3", "1.3.4", "1.3.5", "1.3.6", "1.3.7", "1.3.8", "1.3.9", "1.3.10", "1.3.11", "ARM_1.3.3", "TM_1"], "GCC": ["3.0", "3.3", "3.3.1", "3.3.4", "3.4", "3.4.2", "3.5", "4.0.0", "4.2.0", "4.3.0", "4.7.0", "7.0.0"], "GLIBC": ["2.0", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "2.14", "2.15", "2.16", "2.17", "2.18", "2.22", "2.23", "2.24", "2.25", "2.26", "2.27"], - "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24"] + "GLIBCXX": ["3.4", "3.4.1", "3.4.2", "3.4.3", "3.4.4", "3.4.5", "3.4.6", "3.4.7", "3.4.8", "3.4.9", "3.4.10", "3.4.11", "3.4.12", "3.4.13", "3.4.14", "3.4.15", "3.4.16", "3.4.17", "3.4.18", "3.4.19", "3.4.20", "3.4.21", "3.4.22", "3.4.23", "3.4.24"], + "ZLIB": ["1.2.0", "1.2.0.2", "1.2.0.8", "1.2.2", "1.2.2.3", "1.2.2.4", "1.2.3.3", "1.2.3.4", "1.2.3.5", "1.2.5.1", "1.2.5.2", "1.2.7.1", "1.2.9"] } }, "lib_whitelist": [ @@ -215,6 +255,10 @@ "libX11.so.6", "libXext.so.6", "libXrender.so.1", "libICE.so.6", "libSM.so.6", "libGL.so.1", "libgobject-2.0.so.0", "libgthread-2.0.so.0", "libglib-2.0.so.0", "libresolv.so.2", - "libexpat.so.1" - ]} + "libexpat.so.1", + "libz.so.1" + ], + "blacklist": { + "libz.so.1": ["_dist_code", "_length_code", "_tr_align", "_tr_flush_block", "_tr_init", "_tr_stored_block", "_tr_tally", "bi_windup", "crc32_vpmsum", "crc_fold_512to32", "crc_fold_copy", "crc_fold_init", "deflate_copyright", "deflate_medium", "fill_window", "flush_pending", "gzflags", "inflate_copyright", "inflate_fast", "inflate_table", "longest_match", "slide_hash_sse", "static_ltree", "uncompress2", "x86_check_features", "x86_cpu_has_pclmul", "x86_cpu_has_sse2", "x86_cpu_has_sse42", "z_errmsg", "zcalloc", "zcfree"] + }} ] diff --git a/auditwheel/policy/musllinux-policy.json b/auditwheel/policy/musllinux-policy.json index 6cf8c318..b1030996 100644 --- a/auditwheel/policy/musllinux-policy.json +++ b/auditwheel/policy/musllinux-policy.json @@ -3,7 +3,8 @@ "aliases": [], "priority": 0, "symbol_versions": {}, - "lib_whitelist": [] + "lib_whitelist": [], + "blacklist": {} }, {"name": "musllinux_1_1", "aliases": [], @@ -22,9 +23,10 @@ "armv7l": { } }, - "lib_whitelist": [ - "libc.so" - ]}, + "lib_whitelist": ["libc.so", "libz.so.1"], + "blacklist": { + "libz.so.1": ["_dist_code", "_length_code", "_tr_align", "_tr_flush_block", "_tr_init", "_tr_stored_block", "_tr_tally", "bi_windup", "crc32_vpmsum", "crc_fold_512to32", "crc_fold_copy", "crc_fold_init", "deflate_copyright", "deflate_medium", "fill_window", "flush_pending", "gzflags", "inflate_copyright", "inflate_fast", "inflate_table", "longest_match", "slide_hash_sse", "static_ltree", "uncompress2", "x86_check_features", "x86_cpu_has_pclmul", "x86_cpu_has_sse2", "x86_cpu_has_sse42", "z_errmsg", "zcalloc", "zcfree"] + }}, {"name": "musllinux_1_2", "aliases": [], "priority": 90, @@ -42,7 +44,8 @@ "armv7l": { } }, - "lib_whitelist": [ - "libc.so" - ]} + "lib_whitelist": ["libc.so", "libz.so.1"], + "blacklist": { + "libz.so.1": ["_dist_code", "_length_code", "_tr_align", "_tr_flush_block", "_tr_init", "_tr_stored_block", "_tr_tally", "bi_windup", "crc32_vpmsum", "crc_fold_512to32", "crc_fold_copy", "crc_fold_init", "deflate_copyright", "deflate_medium", "fill_window", "flush_pending", "gzflags", "inflate_copyright", "inflate_fast", "inflate_table", "longest_match", "slide_hash_sse", "static_ltree", "uncompress2", "x86_check_features", "x86_cpu_has_pclmul", "x86_cpu_has_sse2", "x86_cpu_has_sse42", "z_errmsg", "zcalloc", "zcfree"] + }} ] diff --git a/auditwheel/policy/policy-schema.json b/auditwheel/policy/policy-schema.json index d7f339c9..74b43f58 100644 --- a/auditwheel/policy/policy-schema.json +++ b/auditwheel/policy/policy-schema.json @@ -22,16 +22,20 @@ "type": "integer" }, "symbol_versions": { - "$ref": "#/definitions/SymbolVersion" + "$ref": "#/definitions/DictOfArrayOfString" }, "lib_whitelist": { "type": "array", "items": { "type": "string" } + }, + "blacklist": { + "$ref": "#/definitions/DictOfArrayOfString" } }, "required": [ + "blacklist", "lib_whitelist", "name", "priority", @@ -39,37 +43,18 @@ ], "title": "PolicyElement" }, - "SymbolVersion": { + "DictOfArrayOfString": { "type": "object", "additionalProperties": false, - "properties": { - "CXXABI": { - "type": "array", - "items": { - "type": "string" - } - }, - "GCC": { - "type": "array", - "items": { - "type": "string" - } - }, - "GLIBC": { - "type": "array", - "items": { - "type": "string" - } - }, - "GLIBCXX": { + "patternProperties": { + ".*": { "type": "array", "items": { "type": "string" } } }, - "required": [], - "title": "SymbolVersion" + "title": "DictOfArrayOfString" } } } diff --git a/auditwheel/wheel_abi.py b/auditwheel/wheel_abi.py index 59bababd..467efd76 100644 --- a/auditwheel/wheel_abi.py +++ b/auditwheel/wheel_abi.py @@ -38,6 +38,7 @@ "sym_tag", "ucs_tag", "pyfpe_tag", + "blacklist_tag", ], ) @@ -224,7 +225,8 @@ def get_symbol_policies(versioned_symbols, external_versioned_symbols, external_ def analyze_wheel_abi(wheel_fn: str) -> WheelAbIInfo: external_refs = { - p["name"]: {"libs": {}, "priority": p["priority"]} for p in load_policies() + p["name"]: {"libs": {}, "blacklist": {}, "priority": p["priority"]} + for p in load_policies() } ( @@ -259,6 +261,11 @@ def analyze_wheel_abi(wheel_fn: str) -> WheelAbIInfo: default=POLICY_PRIORITY_LOWEST, ) + blacklist_policy = max( + (e["priority"] for e in external_refs.values() if len(e["blacklist"]) == 0), + default=POLICY_PRIORITY_LOWEST, + ) + if has_ucs2: ucs_policy = POLICY_PRIORITY_LOWEST else: @@ -273,8 +280,9 @@ def analyze_wheel_abi(wheel_fn: str) -> WheelAbIInfo: sym_tag = get_policy_name(symbol_policy) ucs_tag = get_policy_name(ucs_policy) pyfpe_tag = get_policy_name(pyfpe_policy) + blacklist_tag = get_policy_name(blacklist_policy) overall_tag = get_policy_name( - min(symbol_policy, ref_policy, ucs_policy, pyfpe_policy) + min(symbol_policy, ref_policy, ucs_policy, pyfpe_policy, blacklist_policy) ) return WheelAbIInfo( @@ -285,12 +293,19 @@ def analyze_wheel_abi(wheel_fn: str) -> WheelAbIInfo: sym_tag, ucs_tag, pyfpe_tag, + blacklist_tag, ) def update(d, u): for k, v in u.items(): - if isinstance(v, Mapping): + if k == "blacklist": + for lib, symbols in v.items(): + if lib not in d[k]: + d[k][lib] = list(symbols) + else: + d[k][lib] = sorted(set(d[k][lib]) | set(symbols)) + elif isinstance(v, Mapping): r = update(d.get(k, {}), v) d[k] = r elif isinstance(v, (str, int, float, type(None))): diff --git a/tests/integration/test_manylinux.py b/tests/integration/test_manylinux.py index a684cf24..1ffb4791 100644 --- a/tests/integration/test_manylinux.py +++ b/tests/integration/test_manylinux.py @@ -846,3 +846,37 @@ def test_nonpy_rpath(any_manylinux_container, docker_python, io_folder): "import nonpy_rpath; assert nonpy_rpath.crypt_something().startswith('*')", ], ) + + +def test_zlib_blacklist(any_manylinux_container, docker_python, io_folder): + policy, tag, manylinux_ctr = any_manylinux_container + if policy.startswith("manylinux_2_17_"): + pytest.skip(f"{policy} image has no blacklist symbols in libz.so.1") + if policy.startswith("manylinux_2_24_"): + docker_exec(manylinux_ctr, "apt-get update") + docker_exec( + manylinux_ctr, "apt-get install -y --no-install-recommends libz-dev" + ) + else: + docker_exec(manylinux_ctr, "yum install -y zlib-devel") + docker_exec( + manylinux_ctr, + [ + "bash", + "-c", + "cd /auditwheel_src/tests/integration/testzlib " + "&& python -m pip wheel --no-deps -w /io .", + ], + ) + + orig_wheel, *_ = os.listdir(io_folder) + assert orig_wheel.startswith("testzlib-0.0.1") + + # Repair the wheel using the appropriate manylinux container + repair_command = f"auditwheel repair --plat {policy} -w /io /io/{orig_wheel}" + with pytest.raises(CalledProcessError): + docker_exec(manylinux_ctr, repair_command) + + # Check auditwheel show warns about the black listed symbols + output = docker_exec(manylinux_ctr, f"auditwheel -v show /io/{orig_wheel}") + assert "black-listed symbol dependencies" in output.replace("\n", " ") diff --git a/tests/integration/testzlib/setup.py b/tests/integration/testzlib/setup.py new file mode 100644 index 00000000..dd9b135f --- /dev/null +++ b/tests/integration/testzlib/setup.py @@ -0,0 +1,17 @@ +from setuptools import Extension, setup + +define_macros = [("_GNU_SOURCE", None)] +libraries = ["z", "c"] + +setup( + name="testzlib", + version="0.0.1", + ext_modules=[ + Extension( + "testzlib", + sources=["testzlib.c"], + define_macros=define_macros, + libraries=libraries, + ) + ], +) diff --git a/tests/integration/testzlib/testzlib.c b/tests/integration/testzlib/testzlib.c new file mode 100644 index 00000000..a048c50e --- /dev/null +++ b/tests/integration/testzlib/testzlib.c @@ -0,0 +1,46 @@ +#include +#include +#include + + +static PyObject * +run(PyObject *self, PyObject *args) +{ + int res; + + (void)self; + (void)args; + +#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 24) + res = gzflags() != 0; +#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 17) + /* blacklist ineffective on manylinux 2014 */ + res = 0; +#elif defined(__GLIBC_PREREQ) + { + void* memory = zcalloc(NULL, 1U, 1U); + res = (memory != NULL); + zcfree(NULL, memory); + } +#else + res = 0; +#endif + return PyLong_FromLong(res); +} + +/* Module initialization */ +PyMODINIT_FUNC PyInit_testzlib(void) +{ + static PyMethodDef module_methods[] = { + {"run", (PyCFunction)run, METH_NOARGS, "run."}, + {NULL} /* Sentinel */ + }; + static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "testzlib", + "testzlib module", + -1, + module_methods, + }; + return PyModule_Create(&moduledef); +} From fed00a8a227c14e4db080b2969a5873aabc2be00 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Thu, 9 Sep 2021 07:56:07 +0200 Subject: [PATCH 2/4] chore: refactor iterating over symbol dict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: László Kiss Kollár --- auditwheel/elfutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auditwheel/elfutils.py b/auditwheel/elfutils.py index 64a50153..8a5e96a7 100644 --- a/auditwheel/elfutils.py +++ b/auditwheel/elfutils.py @@ -155,8 +155,8 @@ def filter_undefined_symbols( undef_symbols.add(sym.name) result = {} - for lib in symbols: - intersection = set(symbols[lib]) & undef_symbols + for lib, sym_list in symbols: + intersection = set(sym_list) & undef_symbols if intersection: result[lib] = sorted(intersection) From 195681a962c09e36ec73c02a06247b840d65a7d6 Mon Sep 17 00:00:00 2001 From: mayeut Date: Thu, 9 Sep 2021 08:27:32 +0200 Subject: [PATCH 3/4] fix: refactor iterating over symbol dict --- auditwheel/elfutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auditwheel/elfutils.py b/auditwheel/elfutils.py index 8a5e96a7..5dbaf885 100644 --- a/auditwheel/elfutils.py +++ b/auditwheel/elfutils.py @@ -155,7 +155,7 @@ def filter_undefined_symbols( undef_symbols.add(sym.name) result = {} - for lib, sym_list in symbols: + for lib, sym_list in symbols.items(): intersection = set(sym_list) & undef_symbols if intersection: result[lib] = sorted(intersection) From 8a03a19dea531d4a1073f98cf4a70304fcae3b8c Mon Sep 17 00:00:00 2001 From: mayeut Date: Tue, 14 Sep 2021 07:53:00 +0200 Subject: [PATCH 4/4] refactor: add elfutils.get_undefined_symbols --- auditwheel/elfutils.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/auditwheel/elfutils.py b/auditwheel/elfutils.py index 5dbaf885..33527c9c 100644 --- a/auditwheel/elfutils.py +++ b/auditwheel/elfutils.py @@ -1,6 +1,6 @@ import os from os.path import basename, realpath, relpath -from typing import Dict, Iterator, List, Optional, Tuple +from typing import Dict, Iterator, List, Optional, Set, Tuple from elftools.common.exceptions import ELFError from elftools.elf.elffile import ELFFile @@ -139,12 +139,8 @@ def is_subdir(path: str, directory: str) -> bool: return True -def filter_undefined_symbols( - path: str, symbols: Dict[str, List[str]] -) -> Dict[str, List[str]]: - if not symbols: - return {} - undef_symbols = set("*") +def get_undefined_symbols(path: str) -> Set[str]: + undef_symbols = set() with open(path, "rb") as f: elf = ELFFile(f) section = elf.get_section_by_name(".dynsym") @@ -153,11 +149,18 @@ def filter_undefined_symbols( for sym in section.iter_symbols(): if sym["st_shndx"] == "SHN_UNDEF": undef_symbols.add(sym.name) + return undef_symbols + +def filter_undefined_symbols( + path: str, symbols: Dict[str, List[str]] +) -> Dict[str, List[str]]: + if not symbols: + return {} + undef_symbols = set("*") | get_undefined_symbols(path) result = {} for lib, sym_list in symbols.items(): intersection = set(sym_list) & undef_symbols if intersection: result[lib] = sorted(intersection) - return result