for soname in CHECK_SYMBOL_LIBS: for suffix in ["so", "dylib"]:
so = os.path.join(builddir, "lib%s.%s" % (soname, suffix)) ifnot os.path.exists(so): continue
# On macOS, C symbols are prefixed with _
symprefix = "_"if suffix == "dylib"else""
EXPORTED_SYMBOLS = [
s.split()[2] for s in re.findall(
r"^.+ [BCDGIRSTu] .+$",
subprocess.check_output(nm.split() + [so]).decode("utf-8"),
re.MULTILINE,
) ifnot re.match(r".* %s(%s)\b" % (symprefix, IGNORED_SYMBOLS), s)
]
print("Checking that %s does not expose internal symbols" % so)
suspicious_symbols = [
x for x in EXPORTED_SYMBOLS ifnot re.match(r"^%s(_|$)" % prefix, x)
] if suspicious_symbols:
print("Ouch, internal symbols exposed:", suspicious_symbols)
stat = 1
def_path = os.path.join(builddir, soname + ".def") ifnot os.path.exists(def_path):
print("'%s' not found; skipping" % def_path) else:
print("Checking that %s has the same symbol list as %s" % (so, def_path)) with open(def_path, "r", encoding="utf-8") as f:
def_file = f.read()
diff_result = list(
difflib.context_diff(
def_file.splitlines(),
["EXPORTS"]
+ [re.sub("^%shb" % symprefix, "hb", x) for x in EXPORTED_SYMBOLS]
+ # cheat: copy the last line from the def file!
[def_file.splitlines()[-1]],
)
)
if diff_result:
print("\n".join(diff_result))
stat = 1
tested = True
ifnot tested:
print("check-symbols.py: no shared libraries found; skipping test")
sys.exit(77)
sys.exit(stat)
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.12Bemerkung:
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.