Clone of official tools

Revision:
20:835f6355470d
Parent:
13:ab47a20b66f0
Child:
21:4fdf0dd04f6f
--- a/toolchains/gcc.py	Fri Jul 15 13:11:30 2016 +0100
+++ b/toolchains/gcc.py	Fri Jul 15 15:28:09 2016 +0100
@@ -17,8 +17,7 @@
 import re
 from os.path import join, basename, splitext, dirname, exists
 
-from tools.toolchains import mbedToolchain
-from tools.settings import GCC_ARM_PATH, GCC_CR_PATH
+from tools.toolchains import mbedToolchain, TOOLCHAIN_PATHS
 from tools.settings import GOANNA_PATH
 from tools.hooks import hook_tool
 
@@ -236,15 +235,8 @@
         cmd = self.hook.get_cmdline_linker(cmd)
 
         # Split link command to linker executable + response file
-        link_files = join(dirname(output), ".link_files.txt")
-        with open(link_files, "wb") as f:
-            cmd_linker = cmd[0]
-            cmd_list = []
-            for c in cmd[1:]:
-                if c:
-                    cmd_list.append(('"%s"' % c) if not c.startswith('-') else c)
-            string = " ".join(cmd_list).replace("\\", "/")
-            f.write(string)
+        cmd_linker = cmd[0]
+        link_files = self.get_link_file(cmd[1:])
 
         # Exec command
         self.default_cmd([cmd_linker, "@%s" % link_files])
@@ -276,7 +268,7 @@
 
 class GCC_ARM(GCC):
     def __init__(self, target, options=None, notify=None, macros=None, silent=False, extra_verbose=False):
-        GCC.__init__(self, target, options, notify, macros, silent, GCC_ARM_PATH, extra_verbose=extra_verbose)
+        GCC.__init__(self, target, options, notify, macros, silent, TOOLCHAIN_PATHS['GCC_ARM'], extra_verbose=extra_verbose)
 
         # Use latest gcc nanolib
         if "big-build" in self.options:
@@ -309,7 +301,7 @@
 
 class GCC_CR(GCC):
     def __init__(self, target, options=None, notify=None, macros=None, silent=False, extra_verbose=False):
-        GCC.__init__(self, target, options, notify, macros, silent, GCC_CR_PATH, extra_verbose=extra_verbose)
+        GCC.__init__(self, target, options, notify, macros, silent, TOOLCHAIN_PATHS['GCC_CR'], extra_verbose=extra_verbose)
 
         additional_compiler_flags = [
             "-D__NEWLIB__", "-D__CODE_RED", "-D__USE_CMSIS", "-DCPP_USE_HEAP",