Generic-SDCC-C.cmake contains wrong settings for creating a library
Generic-SDCC-C.cmake contains wrong settings for creating a library. It is defined like this:
set(CMAKE_C_CREATE_STATIC_LIBRARY ""${CMAKE_COMMAND}" -E remove " "<CMAKE_AR> -a <LINK_FLAGS> ")
this is incorrect, it should be like this:
set(CMAKE_C_CREATE_STATIC_LIBRARY ""${CMAKE_COMMAND}" -E remove " "<CMAKE_AR> -rc <LINK_FLAGS> ")
See SDCC documentation here (check page 27, last sentence of page): https://usermanual.wiki/Document/sdcc20manual.1813032903/html#pf18