|
|
@@ -122,7 +122,7 @@ set( WARN "-Wall -ggdb3" ) |
|
|
|
#| -f...: tuning, see GCC manual |
|
|
|
#| NOTE: -fshort-wchar is specified to allow USB strings be passed conveniently |
|
|
|
if( BOOTLOADER ) |
|
|
|
set( TUNING "-D_bootloader_ -Wno-main -msoft-float -mthumb -fplan9-extensions -ffunction-sections -fdata-sections -fno-builtin -fstrict-volatile-bitfields -flto -fno-use-linker-plugin" ) |
|
|
|
set( TUNING "-D_bootloader_ -Wno-main -msoft-float -mthumb -fplan9-extensions -ffunction-sections -fdata-sections -fno-builtin -fstrict-volatile-bitfields -flto -fno-use-linker-plugin -nostdlib" ) |
|
|
|
#set( TUNING "-mthumb -fdata-sections -ffunction-sections -fno-builtin -msoft-float -fstrict-volatile-bitfields -flto -fno-use-linker-plugin -fwhole-program -Wno-main -nostartfiles -fplan9-extensions -D_bootloader_" ) |
|
|
|
else() |
|
|
|
set( TUNING "-mthumb -nostdlib -fdata-sections -ffunction-sections -fshort-wchar -fno-builtin -nostartfiles" ) |
|
|
@@ -156,10 +156,9 @@ add_definitions( "-mcpu=${CPU} -DF_CPU=${F_CPU} -D_${CHIP}_=1 -O${OPT} ${TUNING} |
|
|
|
if( BOOTLOADER ) |
|
|
|
# Bootloader linker flags |
|
|
|
set( LINKER_FLAGS "${TUNING} -Wl,--gc-sections -fwhole-program -T${CMAKE_CURRENT_SOURCE_DIR}/../Lib/${CHIP}.bootloader.ld -nostartfiles -Wl,-Map=link.map" ) |
|
|
|
#set( LINKER_FLAGS "-Wl,-Map=link.map,--cref -Wl,--gc-sections -Wl,--no-wchar-size-warning -T${CMAKE_CURRENT_SOURCE_DIR}/../Lib/${CHIP}.bootloader.ld" ) |
|
|
|
else() |
|
|
|
# Normal linker flags |
|
|
|
set( LINKER_FLAGS "-Wl,-Map=link.map,--cref -Wl,--gc-sections -Wl,--no-wchar-size-warning -T${CMAKE_CURRENT_SOURCE_DIR}/Lib/${CHIP}.ld" ) |
|
|
|
set( LINKER_FLAGS "${TUNING} -Wl,-Map=link.map,--cref -Wl,--gc-sections -Wl,--no-wchar-size-warning -T${CMAKE_CURRENT_SOURCE_DIR}/Lib/${CHIP}.ld" ) |
|
|
|
endif() |
|
|
|
|
|
|
|
|