Closed moritzstoetter closed 7 months ago
Never mind, found the bit in the documentation that explains this.
Linking to a fully specd target device e.g. CMSIS::STM32::L4R9AI will create and include the default linker script. Linking to the general type e.g. CMSIS::STM32::L4R9xx won't.
Describe the bug When specifying a custom linker script through
target_link_options(my_target PRIVATE -T ${CMAKE_SOURCE_DIR}/custom.ld)
orstm32_add_linker_script(my_target PRIVATE custom.ld)
the default linker script is still created and configured through the cmake functioncmsis_generate_default_linker_script
. When linking, both scripts are configured and interfere with on another.Sources to reproduce Clone this https://github.com/moritzstoetter/stm32-cmake_custom_linker_script.git
Steps to reproduce
produces
These warnings are in themselves not the issue. They are indicative of the underlying problem though.
Expected behavior When specifying a custom linker script, the default linker script should not interfere. Probably it shouldn't even get produced.
Environment (please complete the following information):