adds -mcmodel=medany and map generation;updaes bsp
This commit is contained in:
Submodule bare-metal-bsp updated: 7d55172d51...db3a2d68d6
@@ -1,11 +1,24 @@
|
|||||||
cmake_minimum_required(VERSION 3.21)
|
cmake_minimum_required(VERSION 3.21)
|
||||||
project(hello-world C)
|
project(hello-world C)
|
||||||
set(TARGET hello)
|
set(TARGET hello)
|
||||||
|
option(HAVE_NO_INIT_FINI "Enable NO_INIT_FINI" OFF)
|
||||||
|
|
||||||
|
if(HAVE_NO_INIT_FINI)
|
||||||
|
#if HAVE_NO_INIT_FINI is ON
|
||||||
|
add_definitions(-DHAVE_NO_INIT_FINI)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_executable(${TARGET} hello.c)
|
add_executable(${TARGET} hello.c)
|
||||||
|
target_compile_options(${TARGET} PRIVATE -mcmodel=medany)
|
||||||
|
#target_compile_options(${TARGET} PRIVATE -mcmodel=medany -fPIC)
|
||||||
|
|
||||||
|
|
||||||
set(BOARD "iss" CACHE STRING "Target board")
|
set(BOARD "iss" CACHE STRING "Target board")
|
||||||
|
message(STATUS, " board ${BOARD}")
|
||||||
add_subdirectory(../bare-metal-bsp bsp)
|
add_subdirectory(../bare-metal-bsp bsp)
|
||||||
target_link_libraries(${TARGET} PRIVATE bsp)
|
target_link_libraries(${TARGET} PRIVATE bsp)
|
||||||
|
target_link_options(${TARGET} PRIVATE -Wl,-Map=${TARGET}.map)
|
||||||
|
|
||||||
add_custom_command(TARGET ${TARGET} POST_BUILD
|
add_custom_command(TARGET ${TARGET} POST_BUILD
|
||||||
COMMAND ${CMAKE_OBJDUMP} -S ${TARGET}.elf > ${TARGET}.dis
|
COMMAND ${CMAKE_OBJDUMP} -S ${TARGET}.elf > ${TARGET}.dis
|
||||||
|
Reference in New Issue
Block a user