Skip to content

Commit 0619941

Browse files
committed
uARM: Fix depreciate warning printing wrongly for other toolchains.
1 parent 5d71e69 commit 0619941

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

tools/build_api.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,19 @@ def find_valid_toolchain(target, toolchain):
236236
internal_tc_name = get_toolchain_name(target, toolchain_name)
237237
if toolchain == "ARM" and toolchain_name == "ARMC5" and index != 0:
238238
end_warnings.append(ARMC5_MIGRATION_WARNING)
239+
if target.default_toolchain == "uARM":
240+
end_warnings.append(UARM_DEFAULT_TOOLCHAIN_WARNING)
239241
if not TOOLCHAIN_CLASSES[internal_tc_name].check_executable():
240242
search_path = TOOLCHAIN_PATHS[internal_tc_name] or "No path set"
241243
last_error = (
242244
"Could not find executable for {}.\n"
243245
"Currently set search path: {}"
244246
).format(toolchain_name, search_path)
245247
else:
246-
if toolchain_name == "uARM" or target.default_toolchain == "uARM":
247-
end_warnings.append(UARM_TOOLCHAIN_WARNING)
248+
if toolchain_name == "uARM":
249+
end_warnings.append(UARM_TOOLCHAIN_WARNING)
250+
elif toolchain_name == "ARMC6" and target.default_toolchain == "uARM":
251+
end_warnings.append(UARM_DEFAULT_TOOLCHAIN_WARNING)
248252
return toolchain_name, internal_tc_name, end_warnings
249253
else:
250254
if last_error:

tools/toolchains/arm.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@
4444
"please visit https://os.mbed.com/docs/mbed-os/latest/reference/using-small-c-libraries.html"
4545
)
4646

47+
UARM_DEFAULT_TOOLCHAIN_WARNING = (
48+
"Warning: We noticed that this target default_toolchain overrides --toolchain option with uARM Toolchain. "
49+
"We are deprecating the use of uARM Toolchain. "
50+
"For more information on how to use the ARM toolchain with small C libraries, "
51+
"please visit https://os.mbed.com/docs/mbed-os/latest/reference/using-small-c-libraries.html"
52+
)
53+
4754
class ARM(mbedToolchain):
4855
LINKER_EXT = '.sct'
4956
LIBRARY_EXT = '.ar'

0 commit comments

Comments
 (0)