@@ -56,6 +56,12 @@ def __init__(self, target, notify=None, macros=None,
56
56
raise NotSupportedException (
57
57
"this compiler does not support the core %s" % target .core )
58
58
59
+ if getattr (target , "default_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
+
59
65
if target .core == "Cortex-M0+" :
60
66
cpu = "Cortex-M0"
61
67
elif target .core == "Cortex-M4F" :
@@ -85,6 +91,12 @@ def __init__(self, target, notify=None, macros=None,
85
91
86
92
self .SHEBANG += " --cpu=%s" % cpu
87
93
94
+ def _get_toolchain_labels (self ):
95
+ if getattr (self .target , "default_lib" , "std" ) == "small" :
96
+ return ["ARM" , "ARM_MICRO" ]
97
+ else :
98
+ return ["ARM" , "ARM_STD" ]
99
+
88
100
def parse_dependencies (self , dep_path ):
89
101
dependencies = []
90
102
for line in open (dep_path ).readlines ():
@@ -291,8 +303,8 @@ def __init__(self, target, notify=None, macros=None,
291
303
build_profile = None , build_dir = None ):
292
304
ARM .__init__ (self , target , notify , macros , build_dir = build_dir ,
293
305
build_profile = build_profile )
294
- if "ARM" not in target .supported_toolchains :
295
- raise NotSupportedException ("ARM compiler support is required for ARM build" )
306
+ if not set (( "ARM" , "uARM" )). intersection ( set ( target .supported_toolchains )) :
307
+ raise NotSupportedException ("ARM/uARM compiler support is required for ARM build" )
296
308
297
309
298
310
class ARM_MICRO (ARM ):
@@ -388,6 +400,9 @@ def __init__(self, target, *args, **kwargs):
388
400
self .ar = [join (TOOLCHAIN_PATHS ["ARMC6" ], "armar" )]
389
401
self .elf2bin = join (TOOLCHAIN_PATHS ["ARMC6" ], "fromelf" )
390
402
403
+ def _get_toolchain_labels (self ):
404
+ return ["ARM" , "ARM_STD" , "ARMC6" ]
405
+
391
406
def parse_dependencies (self , dep_path ):
392
407
return mbedToolchain .parse_dependencies (self , dep_path )
393
408
0 commit comments