Skip to content

Conversation

@tejlmand
Copy link
Contributor

@tejlmand tejlmand commented Jan 5, 2022

Fixes: #41435

This PR contains two commits fixing issues on Windows hosts for the linker script generator:

  • cmake: linker generator replace % with @ for symbol referencing
  • cmake: remove platform / build file specific escaping and use VERBATIM flag for add_custom_command() instead.

Fixes: zephyrproject-rtos#41435

The use of %<symbol>% works well in Linux and MacOS but when passed
to the linker script generator in Windows the %<symbol>% is processed
by the windows shell causing the value to disappear and thus an empty
value inside the generated ld linker script or scatter file.

This is fixed by using the @ character instead of the % character.

Signed-off-by: Torsten Rasmussen <[email protected]>
Fixes: zephyrproject-rtos#41435

Remove build host specific escaping of start symbol command argument.
The start symbol for armlink is: Image$$device$$Base
and were escaped as: Image\\$$\\$$device\\$$\\$$Base

However, the $ must only be escaped in Linux and MacOS, not on windows
hosts.

Instead of escaping the start symbol in the CMake code then it is better
to use the VERBATIM flag on `add_custom_command()` which ensures correct
escaping for the build host.

Signed-off-by: Torsten Rasmussen <[email protected]>
@tejlmand tejlmand added the bug The issue is a bug, or the PR is fixing a bug label Jan 5, 2022
@tejlmand tejlmand requested a review from nashif as a code owner January 5, 2022 10:42
@tejlmand
Copy link
Contributor Author

tejlmand commented Jan 5, 2022

@hongshui3000 feel free to test this and provide feedback.

@tejlmand tejlmand added the Backport Backport PR and backport failure issues label Jan 5, 2022
@hongshui3000
Copy link
Contributor

hongshui3000 commented Jan 7, 2022

@hongshui3000 feel free to test this and provide feedback.

#41435

@carlescufi carlescufi merged commit 6d72d91 into zephyrproject-rtos:main Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Build System Backport Backport PR and backport failure issues bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants