diff --git a/tools/profiles/debug.json b/tools/profiles/debug.json index 295211564d..d6c439eff6 100644 --- a/tools/profiles/debug.json +++ b/tools/profiles/debug.json @@ -1,15 +1,15 @@ { "GCC_ARM": { - "common": ["-c", "-Wall", "-Wextra", + "common": ["-Wall", "-Wextra", "-Wno-unused-parameter", "-Wno-missing-field-initializers", "-fmessage-length=0", "-fno-exceptions", "-ffunction-sections", "-fdata-sections", "-funsigned-char", "-MMD", - "-fomit-frame-pointer", "-Og", "-g3", "-DMBED_DEBUG", + "-fomit-frame-pointer", "-Og", "-DMBED_DEBUG", "-DMBED_TRAP_ERRORS_ENABLED=1"], - "asm": ["-x", "assembler-with-cpp"], - "c": ["-std=gnu11"], - "cxx": ["-std=gnu++14", "-fno-rtti", "-Wvla"], + "asm": ["-c", "-g3", "-x", "assembler-with-cpp"], + "c": ["-c", "-g3", "-std=gnu11"], + "cxx": ["-c", "-g3", "-std=gnu++14", "-fno-rtti", "-Wvla"], "ld": ["-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r", "-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r", "-Wl,--wrap,_memalign_r", "-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit", diff --git a/tools/profiles/develop.json b/tools/profiles/develop.json index f8626d86f9..ddd4585ef3 100644 --- a/tools/profiles/develop.json +++ b/tools/profiles/develop.json @@ -1,14 +1,14 @@ { "GCC_ARM": { - "common": ["-c", "-Wall", "-Wextra", + "common": ["-Wall", "-Wextra", "-Wno-unused-parameter", "-Wno-missing-field-initializers", "-fmessage-length=0", "-fno-exceptions", "-ffunction-sections", "-fdata-sections", "-funsigned-char", "-MMD", "-fomit-frame-pointer", "-Os", "-g", "-DMBED_TRAP_ERRORS_ENABLED=1"], - "asm": ["-x", "assembler-with-cpp"], - "c": ["-std=gnu11"], - "cxx": ["-std=gnu++14", "-fno-rtti", "-Wvla"], + "asm": ["-c", "-x", "assembler-with-cpp"], + "c": ["-c", "-std=gnu11"], + "cxx": ["-c", "-std=gnu++14", "-fno-rtti", "-Wvla"], "ld": ["-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r", "-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r", "-Wl,--wrap,_memalign_r", "-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit", diff --git a/tools/profiles/release.json b/tools/profiles/release.json index ede1382b3e..129514d0bf 100644 --- a/tools/profiles/release.json +++ b/tools/profiles/release.json @@ -1,18 +1,18 @@ { "GCC_ARM": { - "common": ["-c", "-Wall", "-Wextra", + "common": ["-Wall", "-Wextra", "-Wno-unused-parameter", "-Wno-missing-field-initializers", "-fmessage-length=0", "-fno-exceptions", "-ffunction-sections", "-fdata-sections", "-funsigned-char", "-MMD", "-fomit-frame-pointer", "-Os", "-flto", "-DNDEBUG", "-g"], - "asm": ["-x", "assembler-with-cpp"], - "c": ["-std=gnu11"], - "cxx": ["-std=gnu++14", "-fno-rtti", "-Wvla"], + "asm": ["-c", "-x", "assembler-with-cpp"], + "c": ["-c", "-std=gnu11"], + "cxx": ["-c", "-std=gnu++14", "-fno-rtti", "-Wvla"], "ld": ["-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r", "-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r", "-Wl,--wrap,_memalign_r", "-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit", - "-Wl,-n", "-Os", "-flto"] + "-Wl,-n"] }, "ARMC6": { "common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz", diff --git a/tools/toolchains/gcc.py b/tools/toolchains/gcc.py index a55de6696a..d2c352aea4 100644 --- a/tools/toolchains/gcc.py +++ b/tools/toolchains/gcc.py @@ -149,7 +149,8 @@ class GCC(mbedToolchain): self.cppc += self.flags['cxx'] + self.flags['common'] self.flags['ld'] += self.cpu - self.ld = [join(tool_path, "arm-none-eabi-gcc")] + self.flags['ld'] + self.ld = [join(tool_path, "arm-none-eabi-gcc")] + self.ld += self.flags['ld'] + self.flags['common'] self.sys_libs = ["stdc++", "supc++", "m", "c", "gcc", "nosys"] self.preproc = [join(tool_path, "arm-none-eabi-cpp"), "-E", "-P"]