支持Os编译

This commit is contained in:
zhangzheng
2023-12-02 20:18:32 +08:00
parent ebde91c418
commit 8c4692ac39
8 changed files with 26 additions and 21 deletions

View File

@@ -21,20 +21,20 @@ set(CMAKE_SIZE "${CROSS_COMPILE}size" CACHE PATH "" FORCE)
set(MKRTOS_ARCH $ENV{ARCH})
# -mfloat-abi=soft -u _printf_float
set(CMAKE_C_FLAGS "-mcpu=${MKRTOS_ARCH} -mthumb -O0 -g3 -lc -lrdimon -msoft-float -u _printf_float -D=MKRTOS \
set(CMAKE_C_FLAGS "-mcpu=${MKRTOS_ARCH} -mthumb -Os -g3 -lc -lrdimon -msoft-float -u _printf_float -D=MKRTOS \
-std=gnu11 -ffunction-sections -fdata-sections -fno-builtin -mfix-cortex-m3-ldrd \
-nostartfiles -nodefaultlibs -nostdlib -nostdinc -Xlinker \
-fno-stack-protector -Wl,--gc-sections \
" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "-mcpu=${MKRTOS_ARCH}-mthumb -mno-thumb-interwork -D=MKRTOS \
-mfix-cortex-m3-ldrd -O0 -g -std=c++11 \
-mfix-cortex-m3-ldrd -Os -g3 -std=c++11 \
-fmessage-length=0 -Xlinker --print-map -Wall -W -fno-stack-protector -g \
-mfloat-abi=soft -lc -lrdimon -u _printf_float \
-ffunction-sections -fdata-sections -fno-builtin -nostartfiles -nodefaultlibs -nostdlib -nostdinc -Xlinker \
" CACHE STRING "" FORCE)
set(CMAKE_ASM_FLAGS "-mcpu=${MKRTOS_ARCH} -mthumb -O0 -g -mfloat-abi=soft -lc -lrdimon -D=MKRTOS \
set(CMAKE_ASM_FLAGS "-mcpu=${MKRTOS_ARCH} -mthumb -Os -g3 -mfloat-abi=soft -lc -lrdimon -D=MKRTOS \
-u _printf_float -std=gnu11 -ffunction-sections -fdata-sections -fno-builtin \
-nostartfiles -nodefaultlibs -nostdlib -nostdinc -Xlinker -fno-stack-protector \
" CACHE STRING "" FORCE)