Skip to content

Commit b922201

Browse files
committed
Heed default_lib in arm compiler
1 parent 0c8f66f commit b922201

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/toolchains/arm.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ def __init__(self, target, notify=None, macros=None,
5656
raise NotSupportedException(
5757
"this compiler does not support the core %s" % target.core)
5858

59+
if getattr(target, "defalut_lib", "std") == "small":
60+
if "-DMBED_RTOS_SINGLE_THREAD" not in self.flags['common']:
61+
self.flags['common'].append("-DMBED_RTOS_SINGLE_THREAD")
62+
if "--library_type=microlib" not in self.flags['ld']:
63+
self.flags['ld'].append("--library_type=microlib")
64+
5965
if target.core == "Cortex-M0+":
6066
cpu = "Cortex-M0"
6167
elif target.core == "Cortex-M4F":
@@ -291,8 +297,8 @@ def __init__(self, target, notify=None, macros=None,
291297
build_profile=None, build_dir=None):
292298
ARM.__init__(self, target, notify, macros, build_dir=build_dir,
293299
build_profile=build_profile)
294-
if "ARM" not in target.supported_toolchains:
295-
raise NotSupportedException("ARM compiler support is required for ARM build")
300+
if not set(("ARM", "uARM")).intersection(set(target.supported_toolchains)):
301+
raise NotSupportedException("ARM/uARM compiler support is required for ARM build")
296302

297303

298304
class ARM_MICRO(ARM):

0 commit comments

Comments
 (0)