Clone of official tools
Diff: toolchains/iar.py
- Revision:
- 2:07730b0f452c
- Parent:
- 0:66f3b5499f7f
- Child:
- 7:5af61d55adbe
--- a/toolchains/iar.py Fri May 20 20:16:44 2016 +0100 +++ b/toolchains/iar.py Fri May 20 22:27:03 2016 +0100 @@ -30,14 +30,15 @@ DIAGNOSTIC_PATTERN = re.compile('"(?P<file>[^"]+)",(?P<line>[\d]+)\s+(?P<severity>Warning|Error)(?P<message>.+)') - def __init__(self, target, options=None, notify=None, macros=None, silent=False, extra_verbose=False): - mbedToolchain.__init__(self, target, options, notify, macros, silent, extra_verbose=extra_verbose) + def __init__(self, target, options=None, notify=None, macros=None, silent=False, extra_verbose=False, profile=None): + mbedToolchain.__init__(self, target, options, notify, macros, silent, extra_verbose=extra_verbose, profile=profile) if target.core == "Cortex-M7F": - cpuchoice = "Cortex-M7" + cpu = "Cortex-M7" else: - cpuchoice = target.core + cpu = target.core + c_flags = [ - "--cpu=%s" % cpuchoice, "--thumb", + "--cpu=%s" % cpu, "--thumb", "--dlib_config", join(IAR_PATH, "inc", "c", "DLib_Config_Full.h"), "-e", # Enable IAR language extension "--no_wrap_diagnostics", @@ -50,24 +51,20 @@ if target.core == "Cortex-M7F": c_flags.append("--fpu=VFPv5_sp") - if "debug-info" in self.options: c_flags.append("-On") else: c_flags.append("-Oh") + # add debug symbols for all builds c_flags.append("-r") IAR_BIN = join(IAR_PATH, "bin") main_cc = join(IAR_BIN, "iccarm") - self.asm = [join(IAR_BIN, "iasmarm")] + ["--cpu", cpuchoice] - if not "analyze" in self.options: - self.cc = [main_cc] + c_flags - self.cppc = [main_cc, "--c++", "--no_rtti", "--no_exceptions"] + c_flags - else: - self.cc = [join(GOANNA_PATH, "goannacc"), '--with-cc="%s"' % main_cc.replace('\\', '/'), "--dialect=iar-arm", '--output-format="%s"' % self.GOANNA_FORMAT] + c_flags - self.cppc = [join(GOANNA_PATH, "goannac++"), '--with-cxx="%s"' % main_cc.replace('\\', '/'), "--dialect=iar-arm", '--output-format="%s"' % self.GOANNA_FORMAT] + ["--c++", "--no_rtti", "--no_exceptions"] + c_flags + self.asm = [join(IAR_BIN, "iasmarm")] + ["--cpu", cpu] + self.cc = [main_cc] + c_flags + self.cppc = [main_cc, "--c++", "--no_rtti", "--no_exceptions"] + c_flags self.ld = join(IAR_BIN, "ilinkarm") self.ar = join(IAR_BIN, "iarchive") self.elf2bin = join(IAR_BIN, "ielftool")