From ee00dbd9a7f12913fa1a13fd0fb22b8f0f0f4d44 Mon Sep 17 00:00:00 2001 From: 0xc0170 Date: Wed, 4 May 2016 09:45:14 -0500 Subject: [PATCH] uvision - fix c/asm flags Some flags are only C specific, causes problems when there's .S file in the workspace. For instance, -Ox is only C flag, causes a project to fail with "unrecognized option" --- workspace_tools/toolchains/arm.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/workspace_tools/toolchains/arm.py b/workspace_tools/toolchains/arm.py index 4a072c7a20..f247421457 100644 --- a/workspace_tools/toolchains/arm.py +++ b/workspace_tools/toolchains/arm.py @@ -31,10 +31,10 @@ class ARM(mbedToolchain): DEP_PATTERN = re.compile('\S+:\s(?P.+)\n') DEFAULT_FLAGS = { - 'common': ["-c", "--gnu", "-Otime", "--split_sections", "--apcs=interwork", - "--brief_diagnostics", "--restrict", "--multibyte_chars"], + 'common': ["--apcs=interwork", + "--brief_diagnostics"], 'asm': ['-I%s' % ARM_INC], - 'c': ["--md", "--no_depend_system_headers", '-I%s' % ARM_INC, + 'c': ["-c", "--gnu", "-Otime", "--restrict", "--multibyte_chars", "--split_sections", "--md", "--no_depend_system_headers", '-I%s' % ARM_INC, "--c99", "-D__ASSERT_MSG" ], 'cxx': ["--cpp", "--no_rtti", "-D__ASSERT_MSG"], 'ld': [], @@ -61,9 +61,9 @@ class ARM(mbedToolchain): if "debug-info" in self.options: self.flags['common'].append("-g") - self.flags['common'].append("-O0") + self.flags['c'].append("-O0") else: - self.flags['common'].append("-O3") + self.flags['c'].append("-O3") self.asm = [main_cc] + self.flags['common'] + self.flags['asm'] if not "analyze" in self.options: