From c07d90a2efc067d2e1003a48f07e23bb53d81193 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Thu, 28 Aug 2025 09:25:03 +0200 Subject: [PATCH] Prepare check_names.py for the deprecation of Make We now use CMake to build the Mbed TLS libraries in both the development and 3.6 cases. This change aligns with what is already done for TF-PSA-Crypto. Signed-off-by: Ronald Cron --- scripts/check_names.py | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/scripts/check_names.py b/scripts/check_names.py index e2b6b8a73..f1f1ee412 100755 --- a/scripts/check_names.py +++ b/scripts/check_names.py @@ -971,15 +971,17 @@ class MBEDTLSCodeParser(CodeParser): ) my_environment = os.environ.copy() my_environment["CFLAGS"] = "-fno-asynchronous-unwind-tables" - # Run make clean separately to lib to prevent unwanted behavior when - # make is invoked with parallelism. + + source_dir = os.getcwd() + build_dir = tempfile.mkdtemp() + os.chdir(build_dir) subprocess.run( - ["make", "clean"], + ["cmake", "-DGEN_FILES=ON", source_dir], universal_newlines=True, check=True ) subprocess.run( - ["make", "lib"], + ["make"], env=my_environment, universal_newlines=True, stdout=subprocess.PIPE, @@ -988,17 +990,21 @@ class MBEDTLSCodeParser(CodeParser): ) # Perform object file analysis using nm - symbols = self.parse_symbols_from_nm([ - "library/libmbedcrypto.a", - "library/libmbedtls.a", - "library/libmbedx509.a" - ]) + if build_tree.is_mbedtls_3_6(): + symbols = self.parse_symbols_from_nm([ + "library/libmbedcrypto.a", + "library/libmbedtls.a", + "library/libmbedx509.a" + ]) + else: + symbols = self.parse_symbols_from_nm([ + "library/libtfpsacrypto.a", + "library/libmbedtls.a", + "library/libmbedx509.a" + ]) - subprocess.run( - ["make", "clean"], - universal_newlines=True, - check=True - ) + os.chdir(source_dir) + shutil.rmtree(build_dir) except subprocess.CalledProcessError as error: self.log.debug(error.output) raise error