Suppress linker warning about RWX sections.

This commit is contained in:
imi415 2022-08-26 23:15:46 +08:00
parent de70080bd4
commit daf4d9d699
Signed by: imi415
GPG Key ID: 17F01E106F9F5E0A
1 changed files with 4 additions and 1 deletions

View File

@ -127,6 +127,9 @@ set(TARGET_C_INCLUDES
# Shared libraries linked with application
set(TARGET_LIBS
"c"
"m"
"nosys"
)
# Shared library and linker script search paths
@ -153,7 +156,7 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-flto")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_CFLAGS_HARDWARE} -Wall -fno-common -fno-builtin -ffreestanding -fdata-sections -ffunction-sections")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TARGET_CFLAGS_HARDWARE} -Wall -fno-common -fno-builtin -ffreestanding -fdata-sections -ffunction-sections")
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_C_FLAGS} -x assembler-with-cpp")
set(CMAKE_EXE_LINKER_FLAGS "-specs=nano.specs -specs=nosys.specs -Wl,--gc-sections -Wl,--print-memory-usage -lc -lm -lnosys ")
set(CMAKE_EXE_LINKER_FLAGS "-specs=nano.specs -specs=nosys.specs -Wl,--gc-sections -Wl,--print-memory-usage -Wl,--no-warn-rwx-segments")
# Shared sources, includes and definitions
add_compile_definitions(${TARGET_C_DEFINES})