Detect soname clashes

The same library may be present in the same build tree, eg.
libtfpsacrypto.so, which gets copied from the tf-psa-crypto/core/ to
library/ during an Mbed TLS build.

Make sure that the duplicated libraries are byte-for-byte identical,
otherwise abort the test.

Signed-off-by: Bence Szépkúti <[email protected]>
This commit is contained in:
Bence Szépkúti
2025-12-18 20:20:25 +01:00
parent dad0f26dc2
commit 56400d627e
+5 -3
View File
@@ -96,6 +96,7 @@ import subprocess
import argparse
import logging
import tempfile
import filecmp
import fnmatch
from types import SimpleNamespace
@@ -251,9 +252,10 @@ class AbiChecker:
self.log.debug(build_output.decode("utf-8"))
for root, _dirs, files in os.walk(build_dir):
for file in fnmatch.filter(files, "*.so"):
version.modules[os.path.splitext(file)[0]] = (
os.path.join(root, file)
)
new_path = os.path.join(root, file)
path = version.modules.setdefault(os.path.splitext(file)[0], new_path)
if path != new_path and not filecmp.cmp(path, new_path, False):
raise Exception(f"The following libraries differ, but have the same soname:\n{path}\n{new_path}")
@staticmethod
def _pretty_revision(version):