From d9548419839982b6ef3b480b1658b946acebef12 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Tue, 14 Sep 2021 15:47:14 +0100 Subject: [PATCH] memap.py: Allow .a extension for Arm Compiler-generated libraries The most common extension for static libraries is .a and CMake generates it with both GCC and Arm toolchains. Mbed CLI 1 generates .ar files with the Arm Compiler, but since Mbed CLI 2 uses memap.py to generate map files too, both extensions should be permitted. This fixes a warning when building greentea tests: Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o) Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o) Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o) ... which repeats over 30 times per test. --- tools/memap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/memap.py b/tools/memap.py index 2a0a90a596..42f3a5ad94 100644 --- a/tools/memap.py +++ b/tools/memap.py @@ -247,7 +247,7 @@ class _GccParser(_Parser): class _ArmccParser(_Parser): RE = re.compile( r'^\s+0x(\w{8})\s+0x(\w{8})\s+(\w+)\s+(\w+)\s+(\d+)\s+[*]?.+\s+(.+)$') - RE_OBJECT = re.compile(r'(.+\.(l|ar))\((.+\.o(bj)?)\)') + RE_OBJECT = re.compile(r'(.+\.(l|a|ar))\((.+\.o(bj)?)\)') OBJECT_EXTENSIONS = (".o", ".obj") def parse_object_name(self, line):