Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update board and SoC linker script handling #64544

Merged

Conversation

tejlmand
Copy link
Collaborator

@tejlmand tejlmand commented Oct 30, 2023

This PR cleanup and updates the handling of board and SoC linker scripts.

Several SoCs creates a linker.ld file which sole purpose is to include
another arch common linker script, often with content like this:

#include <arch>/linker.ld

instead of 100+ SoC specific linker.ld files containing just a single
include line of above structure, then this commit introduces two new
CMake variables, BOARD_LINKER_SCRIPT and SOC_LINKER_SCRIPT.

This allows the board and SoC CMake code to point directly to a common
linker script instead of creating a dummy linker.ld file doing this.

With this PR, 144 dummy linker.ld are removed and replaced with a single CMake line setting SOC_LINKER_SCRIPT.

The first commit provides the new variables, and then a commit for each soc/<arch> update.

@tejlmand tejlmand force-pushed the cmake_soc_linker_script_handling branch from 3da5c6e to ad197ff Compare November 1, 2023 10:32
This commit updates all riscv SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <[email protected]>
This commit updates all sparc SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <[email protected]>
This commit updates all xtensa SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <[email protected]>
This commit updates all x86 SoCs to set SOC_LINKER_SCRIPT CMake
variable to point to active linker script directly.

Signed-off-by: Torsten Rasmussen <[email protected]>
Update the ip_k66f board to use BOARD_LINKER_SCRIPT variable.

Signed-off-by: Torsten Rasmussen <[email protected]>
@tejlmand tejlmand force-pushed the cmake_soc_linker_script_handling branch from ad197ff to f5836a0 Compare November 1, 2023 10:34
@carlescufi
Copy link
Member

@ifyall @povergoing @fabiobaltieri @fkokosinski @ruuddw can you please take a look?

@fabiobaltieri fabiobaltieri assigned tejlmand and unassigned fkokosinski Nov 2, 2023
@carlescufi carlescufi merged commit d92ed66 into zephyrproject-rtos:main Nov 3, 2023
19 checks passed
golowanow added a commit to golowanow/zephyr that referenced this pull request Nov 3, 2023
Fix build issue with linker.id depreciated for
arduino_uno_r4_minima platform and observed on
samples/synchronization/sample.kernel.synchronization
after zephyrproject-rtos#64544.

Signed-off-by: Dmitrii Golovanov <[email protected]>
golowanow added a commit to golowanow/zephyr that referenced this pull request Nov 3, 2023
Fix build issue with linker.id depreciated for
arduino_uno_r4_minima platform and observed on
samples/synchronization/sample.kernel.synchronization
after zephyrproject-rtos#64544.

Signed-off-by: Dmitrii Golovanov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants