@@ -342,9 +342,9 @@ def __init__(self, target, notify=None, macros=None,
342
342
build_profile = None , build_dir = None ):
343
343
ARM .__init__ (self , target , notify , macros , build_dir = build_dir ,
344
344
build_profile = build_profile )
345
- if not set (( "ARM" , "uARM" )). intersection ( set ( target . supported_toolchains )):
346
- raise NotSupportedException ( "ARM/uARM compiler support is required for ARM build" )
347
-
345
+ #check only for ARMC5 because ARM_STD means using ARMC5, and thus supported_toolchains must include ARMC5
346
+ if not set (( "ARMC5" ,)). intersection ( set ( target . supported_toolchains )):
347
+ raise NotSupportedException ( "ARM compiler 5 support is required for ARM build" )
348
348
349
349
class ARM_MICRO (ARM ):
350
350
PATCHED_LIBRARY = False
@@ -353,13 +353,17 @@ def __init__(self, target, notify=None, macros=None,
353
353
silent = False , extra_verbose = False , build_profile = None ,
354
354
build_dir = None ):
355
355
target .default_toolchain = "uARM"
356
- ARM .__init__ (self , target , notify , macros , build_dir = build_dir ,
357
- build_profile = build_profile )
358
- if not set (("ARM" , "uARM" )).intersection (set (target .supported_toolchains )):
356
+
357
+ #At this point we already know that we want to use ARMC5+Microlib, so check for if they are supported
358
+ #For, AC6+Microlib we still use ARMC6 class
359
+ if not set (("uARM" ,"ARMC5" )).intersection (set (target .supported_toolchains )) == set (("uARM" ,"ARMC5" )):
359
360
raise NotSupportedException ("ARM/uARM compiler support is required for ARM build" )
361
+ ARM .__init__ (self , target , notify , macros , build_dir = build_dir ,
362
+ build_profile = build_profile )
363
+
360
364
361
365
class ARMC6 (ARM_STD ):
362
- OFFICIALLY_SUPPORTED = False
366
+ OFFICIALLY_SUPPORTED = True
363
367
SHEBANG = "#! armclang -E --target=arm-arm-none-eabi -x c"
364
368
SUPPORTED_CORES = ["Cortex-M0" , "Cortex-M0+" , "Cortex-M3" , "Cortex-M4" ,
365
369
"Cortex-M4F" , "Cortex-M7" , "Cortex-M7F" , "Cortex-M7FD" ,
@@ -378,8 +382,18 @@ def __init__(self, target, *args, **kwargs):
378
382
raise NotSupportedException (
379
383
"this compiler does not support the core %s" % target .core )
380
384
381
- if not set (("ARM" , "ARMC6" )).intersection (set (target .supported_toolchains )):
385
+ if not set (("ARM" , "ARMC6" , "uARM" )).intersection (set (target .supported_toolchains )):
382
386
raise NotSupportedException ("ARM/ARMC6 compiler support is required for ARMC6 build" )
387
+
388
+ if getattr (target , "default_toolchain" , "ARMC6" ) == "uARM" :
389
+ if "-DMBED_RTOS_SINGLE_THREAD" not in self .flags ['common' ]:
390
+ self .flags ['common' ].append ("-DMBED_RTOS_SINGLE_THREAD" )
391
+ if "-D__MICROLIB" not in self .flags ['common' ]:
392
+ self .flags ['common' ].append ("-D__MICROLIB" )
393
+ if "-Wl,--library_type=microlib" not in self .flags ['ld' ]:
394
+ self .flags ['ld' ].append ("-Wl,--library_type=microlib" )
395
+ if "-Wl,--library_type=microlib" not in self .flags ['common' ]:
396
+ self .flags ['common' ].append ("-Wl,--library_type=microlib" )
383
397
384
398
core = target .core
385
399
if CORE_ARCH [target .core ] == 8 :
0 commit comments