mirror of https://github.com/ARMmbed/mbed-os.git
Clean up notifier API usage in compilers
parent
de91c93108
commit
56ec4677b5
|
@ -227,13 +227,13 @@ class Resources:
|
||||||
for objname, filenames in dupe_dict.items():
|
for objname, filenames in dupe_dict.items():
|
||||||
if len(filenames) > 1:
|
if len(filenames) > 1:
|
||||||
count+=1
|
count+=1
|
||||||
toolchain.tool_error(
|
toolchain.notify.tool_error(
|
||||||
"Object file %s.o is not unique! It could be made from: %s"\
|
"Object file %s.o is not unique! It could be made from: %s"\
|
||||||
% (objname, " ".join(filenames)))
|
% (objname, " ".join(filenames)))
|
||||||
for headername, locations in dupe_headers.items():
|
for headername, locations in dupe_headers.items():
|
||||||
if len(locations) > 1:
|
if len(locations) > 1:
|
||||||
count+=1
|
count+=1
|
||||||
toolchain.tool_error(
|
toolchain.notify.tool_error(
|
||||||
"Header file %s is not unique! It could be: %s" %\
|
"Header file %s is not unique! It could be: %s" %\
|
||||||
(headername, " ".join(locations)))
|
(headername, " ".join(locations)))
|
||||||
return count
|
return count
|
||||||
|
@ -1110,7 +1110,7 @@ class mbedToolchain:
|
||||||
|
|
||||||
if _rc != 0:
|
if _rc != 0:
|
||||||
for line in _stderr.splitlines():
|
for line in _stderr.splitlines():
|
||||||
self.tool_error(line)
|
self.notify.tool_error(line)
|
||||||
raise ToolException(_stderr)
|
raise ToolException(_stderr)
|
||||||
|
|
||||||
def progress(self, action, file, build_update=False):
|
def progress(self, action, file, build_update=False):
|
||||||
|
|
|
@ -28,11 +28,9 @@ class GCC(mbedToolchain):
|
||||||
STD_LIB_NAME = "lib%s.a"
|
STD_LIB_NAME = "lib%s.a"
|
||||||
DIAGNOSTIC_PATTERN = re.compile('((?P<file>[^:]+):(?P<line>\d+):)(?P<col>\d+):? (?P<severity>warning|[eE]rror|fatal error): (?P<message>.+)')
|
DIAGNOSTIC_PATTERN = re.compile('((?P<file>[^:]+):(?P<line>\d+):)(?P<col>\d+):? (?P<severity>warning|[eE]rror|fatal error): (?P<message>.+)')
|
||||||
|
|
||||||
def __init__(self, target, notify=None, macros=None,
|
def __init__(self, target, notify=None, macros=None, build_profile=None,
|
||||||
silent=False, extra_verbose=False, build_profile=None,
|
|
||||||
build_dir=None):
|
build_dir=None):
|
||||||
mbedToolchain.__init__(self, target, notify, macros, silent,
|
mbedToolchain.__init__(self, target, notify, macros,
|
||||||
extra_verbose=extra_verbose,
|
|
||||||
build_profile=build_profile, build_dir=build_dir)
|
build_profile=build_profile, build_dir=build_dir)
|
||||||
|
|
||||||
tool_path=TOOLCHAIN_PATHS['GCC_ARM']
|
tool_path=TOOLCHAIN_PATHS['GCC_ARM']
|
||||||
|
@ -119,7 +117,7 @@ class GCC(mbedToolchain):
|
||||||
match = self.DIAGNOSTIC_PATTERN.search(line)
|
match = self.DIAGNOSTIC_PATTERN.search(line)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
if msg is not None:
|
if msg is not None:
|
||||||
self.cc_info(msg)
|
self.notify.cc_info(msg)
|
||||||
msg = None
|
msg = None
|
||||||
msg = {
|
msg = {
|
||||||
'severity': match.group('severity').lower(),
|
'severity': match.group('severity').lower(),
|
||||||
|
@ -133,7 +131,7 @@ class GCC(mbedToolchain):
|
||||||
}
|
}
|
||||||
|
|
||||||
if msg is not None:
|
if msg is not None:
|
||||||
self.cc_info(msg)
|
self.notify.cc_info(msg)
|
||||||
|
|
||||||
def get_dep_option(self, object):
|
def get_dep_option(self, object):
|
||||||
base, _ = splitext(object)
|
base, _ = splitext(object)
|
||||||
|
@ -200,7 +198,7 @@ class GCC(mbedToolchain):
|
||||||
preproc_output = join(dirname(output), ".link_script.ld")
|
preproc_output = join(dirname(output), ".link_script.ld")
|
||||||
cmd = (self.preproc + [mem_map] + self.ld[1:] +
|
cmd = (self.preproc + [mem_map] + self.ld[1:] +
|
||||||
[ "-o", preproc_output])
|
[ "-o", preproc_output])
|
||||||
self.cc_verbose("Preproc: %s" % ' '.join(cmd))
|
self.notify.cc_verbose("Preproc: %s" % ' '.join(cmd))
|
||||||
self.default_cmd(cmd)
|
self.default_cmd(cmd)
|
||||||
mem_map = preproc_output
|
mem_map = preproc_output
|
||||||
|
|
||||||
|
@ -230,10 +228,10 @@ class GCC(mbedToolchain):
|
||||||
cmd = [cmd_linker, "@%s" % link_files]
|
cmd = [cmd_linker, "@%s" % link_files]
|
||||||
|
|
||||||
# Exec command
|
# Exec command
|
||||||
self.cc_verbose("Link: %s" % ' '.join(cmd))
|
self.notify.cc_verbose("Link: %s" % ' '.join(cmd))
|
||||||
self.default_cmd(cmd)
|
self.default_cmd(cmd)
|
||||||
if self.target.core == "Cortex-M23" or self.target.core == "Cortex-M33":
|
if self.target.core == "Cortex-M23" or self.target.core == "Cortex-M33":
|
||||||
self.info("Secure Library Object %s" %secure_file)
|
self.notify.info("Secure Library Object %s" %secure_file)
|
||||||
|
|
||||||
@hook_tool
|
@hook_tool
|
||||||
def archive(self, objects, lib_path):
|
def archive(self, objects, lib_path):
|
||||||
|
@ -256,7 +254,7 @@ class GCC(mbedToolchain):
|
||||||
cmd = self.hook.get_cmdline_binary(cmd)
|
cmd = self.hook.get_cmdline_binary(cmd)
|
||||||
|
|
||||||
# Exec command
|
# Exec command
|
||||||
self.cc_verbose("FromELF: %s" % ' '.join(cmd))
|
self.notify.cc_verbose("FromELF: %s" % ' '.join(cmd))
|
||||||
self.default_cmd(cmd)
|
self.default_cmd(cmd)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
@ -36,12 +36,9 @@ class IAR(mbedToolchain):
|
||||||
Returns False otherwise."""
|
Returns False otherwise."""
|
||||||
return mbedToolchain.generic_check_executable("IAR", 'iccarm', 2, "bin")
|
return mbedToolchain.generic_check_executable("IAR", 'iccarm', 2, "bin")
|
||||||
|
|
||||||
def __init__(self, target, notify=None, macros=None,
|
def __init__(self, target, notify=None, macros=None, build_profile=None,
|
||||||
silent=False, extra_verbose=False, build_profile=None,
|
|
||||||
build_dir=None):
|
build_dir=None):
|
||||||
mbedToolchain.__init__(self, target, notify, macros, silent,
|
mbedToolchain.__init__(self, target, notify, macros, build_dir=build_dir,
|
||||||
build_dir=build_dir,
|
|
||||||
extra_verbose=extra_verbose,
|
|
||||||
build_profile=build_profile)
|
build_profile=build_profile)
|
||||||
if target.core == "Cortex-M7F" or target.core == "Cortex-M7FD":
|
if target.core == "Cortex-M7F" or target.core == "Cortex-M7FD":
|
||||||
cpuchoice = "Cortex-M7"
|
cpuchoice = "Cortex-M7"
|
||||||
|
@ -104,7 +101,7 @@ class IAR(mbedToolchain):
|
||||||
match = IAR.DIAGNOSTIC_PATTERN.match(line)
|
match = IAR.DIAGNOSTIC_PATTERN.match(line)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
if msg is not None:
|
if msg is not None:
|
||||||
self.cc_info(msg)
|
self.notify.cc_info(msg)
|
||||||
msg = None
|
msg = None
|
||||||
msg = {
|
msg = {
|
||||||
'severity': match.group('severity').lower(),
|
'severity': match.group('severity').lower(),
|
||||||
|
@ -121,13 +118,13 @@ class IAR(mbedToolchain):
|
||||||
match = IAR.INDEX_PATTERN.match(line)
|
match = IAR.INDEX_PATTERN.match(line)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
msg['col'] = len(match.group('col'))
|
msg['col'] = len(match.group('col'))
|
||||||
self.cc_info(msg)
|
self.notify.cc_info(msg)
|
||||||
msg = None
|
msg = None
|
||||||
else:
|
else:
|
||||||
msg['text'] += line+"\n"
|
msg['text'] += line+"\n"
|
||||||
|
|
||||||
if msg is not None:
|
if msg is not None:
|
||||||
self.cc_info(msg)
|
self.notify.cc_info(msg)
|
||||||
|
|
||||||
def get_dep_option(self, object):
|
def get_dep_option(self, object):
|
||||||
base, _ = splitext(object)
|
base, _ = splitext(object)
|
||||||
|
@ -207,7 +204,7 @@ class IAR(mbedToolchain):
|
||||||
cmd = [cmd_linker, '-f', link_files]
|
cmd = [cmd_linker, '-f', link_files]
|
||||||
|
|
||||||
# Exec command
|
# Exec command
|
||||||
self.cc_verbose("Link: %s" % ' '.join(cmd))
|
self.notify.cc_verbose("Link: %s" % ' '.join(cmd))
|
||||||
self.default_cmd(cmd)
|
self.default_cmd(cmd)
|
||||||
|
|
||||||
@hook_tool
|
@hook_tool
|
||||||
|
@ -233,7 +230,7 @@ class IAR(mbedToolchain):
|
||||||
cmd = self.hook.get_cmdline_binary(cmd)
|
cmd = self.hook.get_cmdline_binary(cmd)
|
||||||
|
|
||||||
# Exec command
|
# Exec command
|
||||||
self.cc_verbose("FromELF: %s" % ' '.join(cmd))
|
self.notify.cc_verbose("FromELF: %s" % ' '.join(cmd))
|
||||||
self.default_cmd(cmd)
|
self.default_cmd(cmd)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in New Issue