linker: allow multi-step link recipe (c.combine
)
#2954
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.
This PR introduces the possibility of using multiple commands for the
c.combine
pattern, and infrastructure that will enable using the same logic on any build step, if so decided.Two changes in behavior are introduced:
When looking for multi-step recipes (e.g. hooks) in
RunRecipe()
, a key that exactly matchesprefix.suffix
is explicitly ignored if numbered entries are found, and only used as a fallback when no other entries are present.This change is consistent with current docs that require a
prefix.NNN.suffix
syntax for multi-step recipes. A property namedprefix.suffix
is undefined behavior, and is currently included among the numbered ones.Reuse the
RunRecipe
logic for therecipe.c.combine
step to allow multi-stage linking. The above change in this context means that numbered steps have priority over the single property, but both can be specified to maintain backwards compatibility (the new numbered properties are ignored by the current IDE).NO TESTS as I don't know where to add the test case... 😇 BUT I tried with a core that defined these rules and got the exact behavior I described here. If someone can give me pointers I can add the proper test case.
Feel free to cherry-pick and/or edit and/or shoot down at will 😅