Skip to content

Commit

Permalink
Enables GCC's Link-Time Optimization with tiny profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Veijo Pesonen authored and Seppo Takalo committed Dec 20, 2019
1 parent 885622a commit 0afc44d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def bootloaderBuildStep(stepName,
// build with default setup
sh ("""
mbed --version
mbed compile -m ${target} -t ${toolchain} --app-config ${mbed_app_json} --build ${build_dir} --profile release
mbed compile -m ${target} -t ${toolchain} --app-config ${mbed_app_json} --build ${build_dir} --profile tiny.json
""")

// Archive the binary
Expand Down
63 changes: 63 additions & 0 deletions tiny.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"GCC_ARM": {
"common": ["-Wall", "-Wextra",
"-Wno-unused-parameter", "-Wno-missing-field-initializers",
"-fmessage-length=0", "-fno-exceptions", "-fno-builtin",
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
"-MMD", "-fno-delete-null-pointer-checks",
"-fomit-frame-pointer", "-Os", "-flto", "-DNDEBUG", "-g"],
"asm": ["-c", "-x", "assembler-with-cpp"],
"c": ["-c", "-std=gnu11"],
"cxx": ["-c", "-std=gnu++14", "-fno-rtti", "-Wvla"],
"ld": ["-Wall", "-Wextra",
"-Wno-unused-parameter", "-Wno-missing-field-initializers",
"-fmessage-length=0", "-fno-exceptions", "-fno-builtin",
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
"-MMD", "-fno-delete-null-pointer-checks",
"-fomit-frame-pointer", "-Os", "-flto", "-DNDEBUG", "-g",
"-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r",
"-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r",
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit",
"-u main"]
},
"ARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
"--apcs=interwork", "--brief_diagnostics", "--restrict",
"--multibyte_chars", "-O3", "-DNDEBUG"],
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp11", "--no_rtti", "--no_vla"],
"ld": []
},
"uARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
"--apcs=interwork", "--brief_diagnostics", "--restrict",
"--multibyte_chars", "-O3", "-D__MICROLIB",
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DNDEBUG"],
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp11", "--no_rtti", "--no_vla"],
"ld": ["--library_type=microlib"]
},
"IAR": {
"common": [
"--no_wrap_diagnostics", "-e",
"--diag_suppress=Pa050,Pa084,Pa093,Pa082,Pe540", "-Ohz", "-DNDEBUG", "--enable_restrict"],
"asm": [],
"c": ["--vla", "--diag_suppress=Pe546"],
"cxx": ["--guard_calls", "--no_static_destruction"],
"ld": ["--skip_dynamic_initialization", "--threaded_lib"]
},
"ARMC6": {
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz",
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
"-Wno-reserved-user-defined-literal", "-Wno-deprecated-register",
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=",
"-fshort-enums", "-fshort-wchar", "-DNDEBUG"],
"asm": [],
"c": ["-D__ASSERT_MSG", "-std=gnu11"],
"cxx": ["-fno-rtti", "-std=gnu++14"],
"ld": ["--show_full_path"]
}
}

0 comments on commit 0afc44d

Please sign in to comment.