Skip to content

Commit c07d90a

Browse files
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 <ronald.cron@arm.com>
1 parent f98ac77 commit c07d90a

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

scripts/check_names.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -971,15 +971,17 @@ def parse_symbols(self):
971971
)
972972
my_environment = os.environ.copy()
973973
my_environment["CFLAGS"] = "-fno-asynchronous-unwind-tables"
974-
# Run make clean separately to lib to prevent unwanted behavior when
975-
# make is invoked with parallelism.
974+
975+
source_dir = os.getcwd()
976+
build_dir = tempfile.mkdtemp()
977+
os.chdir(build_dir)
976978
subprocess.run(
977-
["make", "clean"],
979+
["cmake", "-DGEN_FILES=ON", source_dir],
978980
universal_newlines=True,
979981
check=True
980982
)
981983
subprocess.run(
982-
["make", "lib"],
984+
["make"],
983985
env=my_environment,
984986
universal_newlines=True,
985987
stdout=subprocess.PIPE,
@@ -988,17 +990,21 @@ def parse_symbols(self):
988990
)
989991

990992
# Perform object file analysis using nm
991-
symbols = self.parse_symbols_from_nm([
992-
"library/libmbedcrypto.a",
993-
"library/libmbedtls.a",
994-
"library/libmbedx509.a"
995-
])
993+
if build_tree.is_mbedtls_3_6():
994+
symbols = self.parse_symbols_from_nm([
995+
"library/libmbedcrypto.a",
996+
"library/libmbedtls.a",
997+
"library/libmbedx509.a"
998+
])
999+
else:
1000+
symbols = self.parse_symbols_from_nm([
1001+
"library/libtfpsacrypto.a",
1002+
"library/libmbedtls.a",
1003+
"library/libmbedx509.a"
1004+
])
9961005

997-
subprocess.run(
998-
["make", "clean"],
999-
universal_newlines=True,
1000-
check=True
1001-
)
1006+
os.chdir(source_dir)
1007+
shutil.rmtree(build_dir)
10021008
except subprocess.CalledProcessError as error:
10031009
self.log.debug(error.output)
10041010
raise error

0 commit comments

Comments
 (0)