Skip to content

Revert "Fix iar exporter - flags duplication and consolidations" #1942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions tools/export/iar.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

from tools.export.exporters import Exporter
from tools.targets import TARGET_MAP, TARGET_NAMES
from tools.settings import IAR_PATH

# If you wish to add a new target, add it to project_generator_definitions, and then
# define progen_target name in the target class (`` self.progen_target = 'my_target_name' ``)
Expand Down Expand Up @@ -71,15 +70,6 @@ def generate(self):
project_data['tool_specific']['iar'].setdefault("misc", {})
project_data['tool_specific']['iar'].update(tool_specific['iar'])
project_data['tool_specific']['iar']['misc'].update(self.progen_flags)
# progen does not have common flags, expand c flags by common one
project_data['tool_specific']['iar']['misc']['c_flags'] += self.progen_flags['common_flags']
# template sets full dlib, this would produce the error as it's duplicate
project_data['tool_specific']['iar']['misc']['c_flags'].remove("--dlib_config")
project_data['tool_specific']['iar']['misc']['c_flags'].remove(os.path.join(IAR_PATH, "inc", "c", "DLib_Config_Full.h"))
# these c++ flags are set by template - c++, no rtti, no exceptions
project_data['tool_specific']['iar']['misc']['cxx_flags'].remove("--c++")
project_data['tool_specific']['iar']['misc']['cxx_flags'].remove("--no_rtti")
project_data['tool_specific']['iar']['misc']['cxx_flags'].remove("--no_exceptions")
project_data['common']['build_dir'] = os.path.join(project_data['common']['build_dir'], 'iar_arm')
self.progen_gen_file('iar_arm', project_data)

Expand Down
4 changes: 2 additions & 2 deletions tools/export/iar_template.ewp.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@
<debug>1</debug>
<option>
<name>OOCOutputFormat</name>
<version>3</version>
<state>3</state>
<version>2</version>
<state>2</state>
</option>
<option>
<name>OCOutputOverride</name>
Expand Down
24 changes: 13 additions & 11 deletions tools/toolchains/iar.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ class IAR(mbedToolchain):
# Pa093: Implicit conversion from float to integer (ie: wait_ms(85.4) -> wait_ms(85))
# Pa082: Operation involving two values from two registers (ie: (float)(*obj->MR)/(float)(LPC_PWM1->MR0))
"-e", # Enable IAR language extension
"--diag_suppress=Pa050,Pa084,Pa093,Pa082",
"--thumb",
"--dlib_config", join(IAR_PATH, "inc", "c", "DLib_Config_Full.h")],
"--diag_suppress=Pa050,Pa084,Pa093,Pa082"],
'asm': [],
'c': [],
'c': ["--vla"],
'cxx': ["--c++", "--no_rtti", "--no_exceptions", "--guard_calls"],
'ld': ["--skip_dynamic_initialization", "--threaded_lib"],
}
Expand All @@ -53,31 +51,35 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
cpuchoice = "Cortex-M7"
else:
cpuchoice = target.core
self.flags["common"] += [
"--cpu=%s" % cpuchoice, "--thumb",
"--dlib_config", join(IAR_PATH, "inc", "c", "DLib_Config_Full.h"),
]

if target.core == "Cortex-M7F":
self.flags["common"].append("--fpu=VFPv5_sp")

optimization = []
if "debug-info" in self.options:
optimization.append("-r")
optimization.append("-On")
self.flags["common"].append("-r")
self.flags["common"].append("-On")
else:
optimization.append("-Oh")
self.flags["common"].append("-Oh")

IAR_BIN = join(IAR_PATH, "bin")
main_cc = join(IAR_BIN, "iccarm")

self.flags["asm"] += ["--cpu", cpuchoice]
if target.core == "Cortex-M7F":
self.flags["asm"] += ["--fpu", "VFPv5_sp"]
self.asm = [join(IAR_BIN, "iasmarm")] + self.flags["asm"] + ["--cpu=%s" % cpuchoice]
self.asm = [join(IAR_BIN, "iasmarm")] + self.flags["asm"]
if not "analyze" in self.options:
self.cc = [main_cc]
self.cppc = [main_cc]
else:
self.cc = [join(GOANNA_PATH, "goannacc"), '--with-cc="%s"' % main_cc.replace('\\', '/'), "--dialect=iar-arm", '--output-format="%s"' % self.GOANNA_FORMAT]
self.cppc = [join(GOANNA_PATH, "goannac++"), '--with-cxx="%s"' % main_cc.replace('\\', '/'), "--dialect=iar-arm", '--output-format="%s"' % self.GOANNA_FORMAT]
self.cc += self.flags["common"] + self.flags["c"] + ["--cpu=%s" % cpuchoice] + optimization
self.cppc += self.flags["common"] + self.flags["cxx"] + ["--cpu=%s" % cpuchoice] + optimization
self.cc += self.flags["common"] + self.flags["c"]
self.cppc += self.flags["common"] + self.flags["cxx"]
self.ld = join(IAR_BIN, "ilinkarm")
self.ar = join(IAR_BIN, "iarchive")
self.elf2bin = join(IAR_BIN, "ielftool")
Expand Down