Skip to content

Commit

Permalink
arch: arm, arm64: Remove zephyr prefix from linker includes
Browse files Browse the repository at this point in the history
This fix removes the zephyr/ prefix from linker included files.
With this prefix the build works only for Ninja and not for
other build tools.

Linking in Zephyr / CMake:
 - Ninja invokes linking directly from <build>.
 - Make invokes linking form <build>/zephyr.

The linker default uses cwd for looking up INCLUDE directives if not found
in list of includes.
Zephyr always adds <build>/zephyr as link include using CMake,
and this is passed to ld as -L<build>/zephyr therefore using
INCLUDE isr_tables_swi.ld ensures it will be correctly found in all cases.

Signed-off-by: Radosław Koppel <[email protected]>
  • Loading branch information
rakons committed Feb 5, 2024
1 parent cbceff7 commit bc1573a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arch/arm/core/swi_tables.ld
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
* SPDX-License-Identifier: Apache-2.0
*/
#if LINKER_ZEPHYR_FINAL && defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION)
INCLUDE zephyr/isr_tables_swi.ld
INCLUDE isr_tables_swi.ld
#endif
2 changes: 1 addition & 1 deletion arch/arm/core/vector_table.ld
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ KEEP(*(.exc_vector_table))
KEEP(*(".exc_vector_table.*"))

#if LINKER_ZEPHYR_FINAL && defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION)
INCLUDE zephyr/isr_tables_vt.ld
INCLUDE isr_tables_vt.ld
#else
KEEP(*(.vectors))
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/core/swi_tables.ld
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
* SPDX-License-Identifier: Apache-2.0
*/
#if LINKER_ZEPHYR_FINAL && defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION)
INCLUDE zephyr/isr_tables_swi.ld
INCLUDE isr_tables_swi.ld
#endif
2 changes: 1 addition & 1 deletion include/zephyr/arch/arm64/scripts/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ SECTIONS
KEEP(*(".exc_vector_table.*"))

#if LINKER_ZEPHYR_FINAL && defined(CONFIG_ISR_TABLES_LOCAL_DECLARATION)
INCLUDE zephyr/isr_tables_vt.ld
INCLUDE isr_tables_vt.ld
#else
KEEP(*(.vectors))
#endif
Expand Down

0 comments on commit bc1573a

Please sign in to comment.