Mercurial > lcfOS
diff python/ppci/buildtasks.py @ 337:b00219172a42
Added cool lm3s811 qemu project
author | Windel Bouwman |
---|---|
date | Thu, 20 Feb 2014 20:04:52 +0100 |
parents | d1ecc493384e |
children | 86b02c98a717 |
line wrap: on
line diff
--- a/python/ppci/buildtasks.py Wed Feb 19 22:32:15 2014 +0100 +++ b/python/ppci/buildtasks.py Thu Feb 20 20:04:52 2014 +0100 @@ -10,8 +10,8 @@ from .irutils import Verifier from .codegen import CodeGenerator from .transform import CleanPass, RemoveAddZero -from .tasks import Task -from . import DiagnosticsManager +from .tasks import Task, TaskError +from . import DiagnosticsManager, CompilerError from .assembler import Assembler from .objectfile import ObjectFile from .linker import Linker @@ -93,7 +93,10 @@ self.output_file = output_file def run(self): - output_obj = self.linker.link(self.objects, self.layout) + try: + output_obj = self.linker.link(self.objects, self.layout) + except CompilerError as e: + raise TaskError(e.msg) code = output_obj.get_section('code').data with open(self.output_file, 'wb') as f: f.write(code)