Skip to content

Commit 12704f8

Browse files
committed
Review comments changes
1 parent 3bf7517 commit 12704f8

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

tools/build_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def find_valid_toolchain(target, toolchain):
253253
):
254254
end_warnings.append(UARM_TOOLCHAIN_WARNING)
255255

256-
if replace_small_c_lib(target, toolchain, True):
256+
if replace_small_c_lib(target, toolchain):
257257
warning = (
258258
"Warning: We noticed that target.c_lib is set to small.\n"
259259
"As the {} target does not support a small C library for the {} toolchain,\n"

tools/toolchains/arm.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def __init__(self, target, notify=None, macros=None,
7474

7575
toolchain = "arm"
7676

77-
replace_small_c_lib(target, toolchain)
77+
if replace_small_c_lib(target, toolchain):
78+
target.c_lib = "std"
7879

7980
self.check_c_lib_supported(target, toolchain)
8081

@@ -570,7 +571,8 @@ def __init__(self, target, *args, **kwargs):
570571

571572
toolchain = "arm"
572573

573-
replace_small_c_lib(target, toolchain)
574+
if replace_small_c_lib(target, toolchain):
575+
target.c_lib = "std"
574576

575577
self.check_c_lib_supported(target, toolchain)
576578

tools/toolchains/gcc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
5858
if hasattr(target, "c_lib"):
5959
toolchain = "gcc_arm"
6060

61-
replace_small_c_lib(target, toolchain)
61+
if replace_small_c_lib(target, toolchain):
62+
target.c_lib = "std"
6263

6364
self.check_c_lib_supported(target, toolchain)
6465
c_lib = target.c_lib

tools/toolchains/iar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
5858

5959
toolchain = "iar"
6060

61-
replace_small_c_lib(target, toolchain)
61+
if replace_small_c_lib(target, toolchain):
62+
target.c_lib = "std"
6263

6364
self.check_c_lib_supported(target, "iar")
6465

tools/toolchains/mbed_toolchain.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,21 +1394,16 @@ def report(self):
13941394
to_ret.update(self.config.report)
13951395
return to_ret
13961396

1397-
def replace_small_c_lib(target, toolchain, check_only=False):
1397+
def replace_small_c_lib(target, toolchain):
13981398
"""
1399-
Replace the small C lib for the standard C lib.
1400-
1401-
The replacement occurs only if the small C lib is not supported but the
1402-
standard C lib is.
1399+
Check if the small C lib should be replaced with the standard C lib.
14031400
Return True if the replacement occurs otherwise return None.
14041401
"""
14051402
if (
14061403
not is_library_supported("small", target, toolchain)
14071404
and is_library_supported("std", target, toolchain)
14081405
and target.c_lib == "small"
14091406
):
1410-
if not check_only:
1411-
target.c_lib = "std"
14121407
return True
14131408

14141409

0 commit comments

Comments
 (0)