@@ -29,12 +29,12 @@ class GCC(mbedToolchain):
29
29
INDEX_PATTERN = re .compile ('(?P<col>\s*)\^' )
30
30
31
31
def __init__ (self , target , notify = None , macros = None ,
32
- silent = False , tool_path = "" , extra_verbose = False ,
33
- build_profile = None ):
32
+ silent = False , extra_verbose = False , build_profile = None ):
34
33
mbedToolchain .__init__ (self , target , notify , macros , silent ,
35
34
extra_verbose = extra_verbose ,
36
35
build_profile = build_profile )
37
36
37
+ tool_path = TOOLCHAIN_PATHS ['GCC_ARM' ]
38
38
# Add flags for current size setting
39
39
default_lib = "std"
40
40
if hasattr (target , "default_lib" ):
@@ -92,7 +92,7 @@ def __init__(self, target, notify=None, macros=None,
92
92
93
93
self .flags ['ld' ] += self .cpu
94
94
self .ld = [join (tool_path , "arm-none-eabi-gcc" )] + self .flags ['ld' ]
95
- self .sys_libs = ["stdc++" , "supc++" , "m" , "c" , "gcc" ]
95
+ self .sys_libs = ["stdc++" , "supc++" , "m" , "c" , "gcc" , "nosys" ]
96
96
self .preproc = [join (tool_path , "arm-none-eabi-cpp" ), "-E" , "-P" ]
97
97
98
98
self .ar = join (tool_path , "arm-none-eabi-ar" )
@@ -126,7 +126,7 @@ def parse_output(self, output):
126
126
# The warning/error notification is multiline
127
127
msg = None
128
128
for line in output .splitlines ():
129
- match = GCC .DIAGNOSTIC_PATTERN .search (line )
129
+ match = self .DIAGNOSTIC_PATTERN .search (line )
130
130
if match is not None :
131
131
if msg is not None :
132
132
self .cc_info (msg )
@@ -143,7 +143,7 @@ def parse_output(self, output):
143
143
}
144
144
elif msg is not None :
145
145
# Determine the warning/error column by calculating the ^ position
146
- match = GCC .INDEX_PATTERN .match (line )
146
+ match = self .INDEX_PATTERN .match (line )
147
147
if match is not None :
148
148
msg ['col' ] = len (match .group ('col' ))
149
149
self .cc_info (msg )
@@ -280,46 +280,12 @@ def make_ld_define(name, value):
280
280
def redirect_symbol (source , sync , build_dir ):
281
281
return "-Wl,--defsym=%s=%s" % (source , sync )
282
282
283
-
284
- class GCC_ARM (GCC ):
285
283
@staticmethod
286
284
def check_executable ():
287
285
"""Returns True if the executable (arm-none-eabi-gcc) location
288
286
specified by the user exists OR the executable can be found on the PATH.
289
287
Returns False otherwise."""
290
288
return mbedToolchain .generic_check_executable ("GCC_ARM" , 'arm-none-eabi-gcc' , 1 )
291
289
292
- def __init__ (self , target , notify = None , macros = None ,
293
- silent = False , extra_verbose = False , build_profile = None ):
294
- GCC .__init__ (self , target , notify , macros , silent ,
295
- TOOLCHAIN_PATHS ['GCC_ARM' ], extra_verbose = extra_verbose ,
296
- build_profile = build_profile )
297
-
298
- self .sys_libs .append ("nosys" )
299
-
300
-
301
- class GCC_CR (GCC ):
302
- @staticmethod
303
- def check_executable ():
304
- """Returns True if the executable (arm-none-eabi-gcc) location
305
- specified by the user exists OR the executable can be found on the PATH.
306
- Returns False otherwise."""
307
- return mbedToolchain .generic_check_executable ("GCC_CR" , 'arm-none-eabi-gcc' , 1 )
308
-
309
- def __init__ (self , target , notify = None , macros = None ,
310
- silent = False , extra_verbose = False , build_profile = None ):
311
- GCC .__init__ (self , target , notify , macros , silent ,
312
- TOOLCHAIN_PATHS ['GCC_CR' ], extra_verbose = extra_verbose ,
313
- build_profile = build_profile )
314
-
315
- additional_compiler_flags = [
316
- "-D__NEWLIB__" , "-D__CODE_RED" , "-D__USE_CMSIS" , "-DCPP_USE_HEAP" ,
317
- ]
318
- self .cc += additional_compiler_flags
319
- self .cppc += additional_compiler_flags
320
-
321
- # Use latest gcc nanolib
322
- self .ld .append ("--specs=nano.specs" )
323
- if target .name in ["LPC1768" , "LPC4088" , "LPC4088_DM" , "LPC4330" , "UBLOX_C027" , "LPC2368" ]:
324
- self .ld .extend (["-u _printf_float" , "-u _scanf_float" ])
325
- self .ld += ["-nostdlib" ]
290
+ class GCC_ARM (GCC ):
291
+ pass
0 commit comments