Clone of official tools

Revision:
30:f12ce67666d0
Parent:
29:1210849dba19
Child:
31:8ea194f6145b
--- a/toolchains/gcc.py	Mon Aug 29 11:18:36 2016 +0100
+++ b/toolchains/gcc.py	Mon Aug 29 11:56:59 2016 +0100
@@ -16,7 +16,6 @@
 """
 import re
 from os.path import join, basename, splitext, dirname, exists
-from distutils.spawn import find_executable
 
 from tools.toolchains import mbedToolchain, TOOLCHAIN_PATHS
 from tools.hooks import hook_tool
@@ -40,7 +39,7 @@
         'c': ["-std=gnu99"],
         'cxx': ["-std=gnu++98", "-fno-rtti", "-Wvla"],
         'ld': ["-Wl,--gc-sections", "-Wl,--wrap,main",
-            "-Wl,--wrap,_malloc_r", "-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r", "-Wl,--wrap,_calloc_r"],
+            "-Wl,--wrap,_malloc_r", "-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r"],
     }
 
     def __init__(self, target, options=None, notify=None, macros=None, silent=False, tool_path="", extra_verbose=False):
@@ -111,11 +110,6 @@
         self.ar = join(tool_path, "arm-none-eabi-ar")
         self.elf2bin = join(tool_path, "arm-none-eabi-objcopy")
 
-        if tool_path:
-            self.toolchain_path = main_cc
-        else:
-            self.toolchain_path = find_executable("arm-none-eabi-gcc") or ''
-
     def parse_dependencies(self, dep_path):
         dependencies = []
         buff = open(dep_path).readlines()
@@ -144,7 +138,7 @@
         # The warning/error notification is multiline
         msg = None
         for line in output.splitlines():
-            match = GCC.DIAGNOSTIC_PATTERN.search(line)
+            match = GCC.DIAGNOSTIC_PATTERN.match(line)
             if match is not None:
                 if msg is not None:
                     self.cc_info(msg)
@@ -279,13 +273,13 @@
         GCC.__init__(self, target, options, notify, macros, silent, TOOLCHAIN_PATHS['GCC_ARM'], extra_verbose=extra_verbose)
 
         # Use latest gcc nanolib
-        if "std-lib" in self.options:
+        if "big-build" in self.options:
             use_nano = False
-        elif "small-lib" in self.options:
+        elif "small-build" in self.options:
             use_nano = True
-        elif target.default_lib == "std":
+        elif target.default_build == "standard":
             use_nano = False
-        elif target.default_lib == "small":
+        elif target.default_build == "small":
             use_nano = True
         else:
             use_nano = False