diff --git a/workspace_tools/toolchains/gcc.py b/workspace_tools/toolchains/gcc.py index 176ff5c250..76c1fd6783 100644 --- a/workspace_tools/toolchains/gcc.py +++ b/workspace_tools/toolchains/gcc.py @@ -69,8 +69,11 @@ class GCC(mbedToolchain): if "save-asm" in self.options: common_flags.append("-save-temps") - common_flags.append("-ggdb") - common_flags.append("-O0") + if "debug-info" in self.options: + common_flags.append("-g") + common_flags.append("-O0") + else: + common_flags.append("-O2") main_cc = join(tool_path, "arm-none-eabi-gcc") main_cppc = join(tool_path, "arm-none-eabi-g++")