Skip to content

Commit 0e292ed

Browse files
committed
Properly set flags for default_lib = small
Use newlib nano for targets which have the key "default_lib" set to "small". Also support the legacy key of "default_build".
1 parent fa4df09 commit 0e292ed

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/toolchains/gcc.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ def __init__(self, target, notify=None, macros=None,
3535
extra_verbose=extra_verbose,
3636
build_profile=build_profile)
3737

38+
# Add flags for current size setting
39+
default_lib = "std"
40+
if hasattr(target, "default_lib"):
41+
default_lib = target.default_lib
42+
elif hasattr(target, "default_build"): # Legacy
43+
default_lib = target.default_build
44+
45+
if default_lib == "small":
46+
self.flags["common"].append("-DMBED_RTOS_SINGLE_THREAD")
47+
self.flags["ld"].append("--specs=nano.specs")
48+
3849
if target.core == "Cortex-M0+":
3950
cpu = "cortex-m0plus"
4051
elif target.core == "Cortex-M4F":

0 commit comments

Comments
 (0)