fix samd linker with clang: cannot self-check defined symbol with lld e.g STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : 0x1000
--> STACK_SIZE = 0
This commit is contained in:
@@ -11,7 +11,7 @@ MEMORY {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x400;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x400;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x400;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x400;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x1000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x1000;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -17,16 +17,19 @@ set(OPENOCD_OPTION "-f interface/cmsis-dap.cfg -c \"transport select swd\" -f ta
|
|||||||
#------------------------------------
|
#------------------------------------
|
||||||
# only need to be built ONCE for all examples
|
# only need to be built ONCE for all examples
|
||||||
function(add_board_target BOARD_TARGET)
|
function(add_board_target BOARD_TARGET)
|
||||||
if (NOT TARGET ${BOARD_TARGET})
|
if (TARGET ${BOARD_TARGET})
|
||||||
|
return()
|
||||||
|
endif ()
|
||||||
|
|
||||||
set(LD_FILE_Clang ${LD_FILE_GNU})
|
set(LD_FILE_Clang ${LD_FILE_GNU})
|
||||||
if (NOT DEFINED LD_FILE_${CMAKE_C_COMPILER_ID})
|
if (NOT DEFINED LD_FILE_${CMAKE_C_COMPILER_ID})
|
||||||
message(FATAL_ERROR "LD_FILE_${CMAKE_C_COMPILER_ID} not defined")
|
message(FATAL_ERROR "LD_FILE_${CMAKE_C_COMPILER_ID} not defined")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT DEFINED STARTUP_FILE_${CMAKE_C_COMPILER_ID})
|
if (NOT DEFINED STARTUP_FILE_GNU)
|
||||||
set(STARTUP_FILE_GNU ${SDK_DIR}/gcc/gcc/startup_samd21.c)
|
set(STARTUP_FILE_GNU ${SDK_DIR}/gcc/gcc/startup_samd21.c)
|
||||||
set(STARTUP_FILE_Clang ${STARTUP_FILE_GNU})
|
|
||||||
endif ()
|
endif ()
|
||||||
|
set(STARTUP_FILE_Clang ${STARTUP_FILE_GNU})
|
||||||
|
|
||||||
add_library(${BOARD_TARGET} STATIC
|
add_library(${BOARD_TARGET} STATIC
|
||||||
${SDK_DIR}/gcc/system_samd21.c
|
${SDK_DIR}/gcc/system_samd21.c
|
||||||
@@ -66,7 +69,6 @@ function(add_board_target BOARD_TARGET)
|
|||||||
"LINKER:--config=${LD_FILE_IAR}"
|
"LINKER:--config=${LD_FILE_IAR}"
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
@@ -104,6 +106,7 @@ function(family_configure_example TARGET RTOS)
|
|||||||
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
|
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
|
||||||
|
|
||||||
# Flashing
|
# Flashing
|
||||||
|
family_add_bin_hex(${TARGET})
|
||||||
family_flash_jlink(${TARGET})
|
family_flash_jlink(${TARGET})
|
||||||
#family_flash_openocd(${TARGET} ${OPENOCD_OPTION})
|
#family_flash_openocd(${TARGET} ${OPENOCD_OPTION})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@@ -42,7 +42,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0xC000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -18,16 +18,19 @@ set(OPENOCD_OPTION "-f interface/cmsis-dap.cfg -c \"transport select swd\" -c \"
|
|||||||
#------------------------------------
|
#------------------------------------
|
||||||
# only need to be built ONCE for all examples
|
# only need to be built ONCE for all examples
|
||||||
function(add_board_target BOARD_TARGET)
|
function(add_board_target BOARD_TARGET)
|
||||||
if (NOT TARGET ${BOARD_TARGET})
|
if (TARGET ${BOARD_TARGET})
|
||||||
|
return()
|
||||||
|
endif ()
|
||||||
|
|
||||||
set(LD_FILE_Clang ${LD_FILE_GNU})
|
set(LD_FILE_Clang ${LD_FILE_GNU})
|
||||||
if (NOT DEFINED LD_FILE_${CMAKE_C_COMPILER_ID})
|
if (NOT DEFINED LD_FILE_${CMAKE_C_COMPILER_ID})
|
||||||
message(FATAL_ERROR "LD_FILE_${CMAKE_C_COMPILER_ID} not defined")
|
message(FATAL_ERROR "LD_FILE_${CMAKE_C_COMPILER_ID} not defined")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT DEFINED STARTUP_FILE_${CMAKE_C_COMPILER_ID})
|
if (NOT DEFINED STARTUP_FILE_GNU)
|
||||||
set(STARTUP_FILE_GNU ${SDK_DIR}/gcc/gcc/startup_samd51.c)
|
set(STARTUP_FILE_GNU ${SDK_DIR}/gcc/gcc/startup_samd51.c)
|
||||||
set(STARTUP_FILE_Clang ${STARTUP_FILE_GNU})
|
|
||||||
endif ()
|
endif ()
|
||||||
|
set(STARTUP_FILE_Clang ${STARTUP_FILE_GNU})
|
||||||
|
|
||||||
add_library(${BOARD_TARGET} STATIC
|
add_library(${BOARD_TARGET} STATIC
|
||||||
${SDK_DIR}/gcc/system_samd51.c
|
${SDK_DIR}/gcc/system_samd51.c
|
||||||
@@ -66,7 +69,6 @@ function(add_board_target BOARD_TARGET)
|
|||||||
"LINKER:--config=${LD_FILE_IAR}"
|
"LINKER:--config=${LD_FILE_IAR}"
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x1000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x1000;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@@ -42,7 +42,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@@ -41,7 +41,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x10000;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
|
||||||
|
|
||||||
/* The heapsize used by the application. NOTE: you need to adjust according to your application. */
|
/* The heapsize used by the application. NOTE: you need to adjust according to your application. */
|
||||||
HEAP_SIZE = DEFINED(HEAP_SIZE) ? HEAP_SIZE : DEFINED(__heap_size__) ? __heap_size__ : 0x0200;
|
HEAP_SIZE = DEFINED(HEAP_SIZE) ? HEAP_SIZE : DEFINED(__heap_size__) ? __heap_size__ : 0x0200;
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
/* Section Definitions */
|
/* Section Definitions */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@ MEMORY
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
|
||||||
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
|
||||||
|
|
||||||
ENTRY(Reset_Handler)
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user