-
Notifications
You must be signed in to change notification settings - Fork 795
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
[multitop] Add better support for linker scripts #25785
Open
pamaury
wants to merge
5
commits into
lowRISC:master
Choose a base branch
from
pamaury:multitop_linker_scripts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jwnrt
approved these changes
Jan 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rule changes LGTM, thanks
pamaury
force-pushed
the
multitop_linker_scripts
branch
from
January 7, 2025 12:19
62c9259
to
233173e
Compare
Razer6
reviewed
Jan 8, 2025
Razer6
approved these changes
Jan 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
pamaury
force-pushed
the
multitop_linker_scripts
branch
from
January 8, 2025 11:23
233173e
to
31e79ff
Compare
Signed-off-by: Amaury Pouly <[email protected]>
Linker files are not preprocessed, which makes it hard to support several tops. In particular, including different files based on the top, or using a different region is very difficult. The `ld_library` rule is modified to take a new substitution dictionary as input which is subject to location expansion. This allows for example to do in the linker script: ``` INCLUDE @@myfile@@ ``` and then in the BUILD file: ``` ld_library( ..., substitutions = { "@@myfile@@": "$(location //path/to/my/file)", }, ) ``` Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
Signed-off-by: Amaury Pouly <[email protected]>
pamaury
force-pushed
the
multitop_linker_scripts
branch
from
January 10, 2025 14:04
31e79ff
to
6a3a2d6
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linker files are not preprocessed, which makes it hard to support several tops. In particular, including different files based on the top, or using a different region is very difficult. We currently have a semi-hack where we automatically include the directory of any
include
-ed file but it still requires that files have the same name which is not always the case.The
ld_library
rule is modified to take a new substitution dictionary as input which is subject to location expansion. This allows for example to do in the linker script:and then in the BUILD file:
The rest of the commits add some substitutions for the ottf and test_rom, plus a final commit specifically for darjeeling.
Review commit by commit, skip the first which is a squashed version of #25580