summaryrefslogtreecommitdiff
path: root/scripts/cmake/toolchains/bare-metal-gcc.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/cmake/toolchains/bare-metal-gcc.cmake')
-rw-r--r--scripts/cmake/toolchains/bare-metal-gcc.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/cmake/toolchains/bare-metal-gcc.cmake b/scripts/cmake/toolchains/bare-metal-gcc.cmake
index 455f5ec..2bf5fd3 100644
--- a/scripts/cmake/toolchains/bare-metal-gcc.cmake
+++ b/scripts/cmake/toolchains/bare-metal-gcc.cmake
@@ -62,6 +62,7 @@ add_compile_options(
add_compile_options(
-funsigned-char
-fno-function-sections
+ -fdata-sections
"$<$<COMPILE_LANGUAGE:CXX>:-fno-unwind-tables;-fno-rtti;-fno-exceptions>")
# Arch compile options:
@@ -88,12 +89,13 @@ add_link_options(
-mlittle-endian
--specs=nosys.specs
--stats
+ "SHELL:-Xlinker --gc-sections"
"$<$<CONFIG:RELEASE>:--no-debug>")
# Function to add a map file output for the linker to dump diagnostic information to.
function(add_target_map_file TARGET_NAME MAP_FILE_PATH)
target_link_options(${TARGET_NAME} PUBLIC
- -Xlinker -Map=${MAP_FILE_PATH})
+ "SHELL:-Xlinker -Map=${MAP_FILE_PATH}")
endfunction()
# Function to add linker option to use the chosen linker script.