GCC: Move link-time optimizer flags to extensions dir

Disable the lto for the default develop and release prifiles and move
the flags to tools/profiles/extensions/lto.json profile.

Usage:
mbed compile --profile release --profile tools/profiles/extensions/lto.json
pull/11856/head
Filip Jagodzinski 2020-01-31 12:14:55 +01:00
parent 3e3bee4a21
commit b03f974d03
3 changed files with 8 additions and 4 deletions

View File

@ -5,14 +5,14 @@
"-fmessage-length=0", "-fno-exceptions",
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
"-MMD",
"-fomit-frame-pointer", "-Os", "-flto", "-g", "-DMBED_TRAP_ERRORS_ENABLED=1"],
"-fomit-frame-pointer", "-Os", "-g", "-DMBED_TRAP_ERRORS_ENABLED=1"],
"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", "-u main"]
"-Wl,-n"]
},
"ARMC6": {
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Os",

View File

@ -2,5 +2,9 @@
"ARMC6": {
"common": ["-flto"],
"ld": ["--lto", "--lto_level=Oz"]
},
"GCC_ARM": {
"common": ["-flto"],
"ld": ["-u main"]
}
}

View File

@ -5,14 +5,14 @@
"-fmessage-length=0", "-fno-exceptions",
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
"-MMD",
"-fomit-frame-pointer", "-Os", "-flto", "-DNDEBUG", "-g"],
"-fomit-frame-pointer", "-Os", "-DNDEBUG", "-g"],
"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", "-u main"]
"-Wl,-n"]
},
"ARMC6": {
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz",