Skip to content

[UR] Support conditional symbols in linker scripts #18629

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

Merged

Conversation

kbenzie
Copy link
Contributor

@kbenzie kbenzie commented May 22, 2025

Combined the following changes enable adding guards around sections in linker script files which do not support conditional inclusion in their syntax. This is done by pre-processing the linker scripts as part of build configuration.

  • Cleanup template helper.py and add typing hints
  • Use dict for functions in loader script templates
    • The get_loader_functions() template helper now returns list[dict] instead of list[str], this enables passing additional information into the loader script templates
  • Add script to strip guarded lines from file
    • In order to pre-process files which don't support conditional inclusion of line blocks, such as linker scripts, we can use this script to remove lines which should not be included unless specified
  • Hook up strip-guarded-lines.py
    • Actually use the strip-guarded-lines.py script when using configure_file() on linker scripts

@kbenzie kbenzie requested a review from a team as a code owner May 22, 2025 14:24
@kbenzie kbenzie temporarily deployed to WindowsCILock May 22, 2025 14:24 — with GitHub Actions Inactive
@kbenzie kbenzie temporarily deployed to WindowsCILock May 22, 2025 15:07 — with GitHub Actions Inactive
@kbenzie kbenzie temporarily deployed to WindowsCILock May 22, 2025 15:07 — with GitHub Actions Inactive
@kbenzie kbenzie force-pushed the benie/ur-linker-script-conditional-symbols branch from c81041b to 466c42d Compare May 23, 2025 08:34
@kbenzie kbenzie temporarily deployed to WindowsCILock May 23, 2025 08:34 — with GitHub Actions Inactive
@kbenzie kbenzie temporarily deployed to WindowsCILock May 23, 2025 08:56 — with GitHub Actions Inactive
@kbenzie kbenzie temporarily deployed to WindowsCILock May 23, 2025 08:56 — with GitHub Actions Inactive
kbenzie added 4 commits May 26, 2025 10:39
The `get_loader_functions()` template helper now returns `list[dict]`
instead of `list[str]`, this enables passing additional information into
the loader script templates.
In order to pre-process files which don't support conditional inclusion
of line blocks, such as linker scripts, we can use this script to remove
lines which should not be included unless specified.
Actually use the `strip-guarded-lines.py` script when using
`configure_file()` on linker scripts.
@kbenzie kbenzie force-pushed the benie/ur-linker-script-conditional-symbols branch from 466c42d to 0ca3e85 Compare May 26, 2025 09:40
@kbenzie kbenzie temporarily deployed to WindowsCILock May 26, 2025 09:40 — with GitHub Actions Inactive
@kbenzie kbenzie temporarily deployed to WindowsCILock May 26, 2025 10:01 — with GitHub Actions Inactive
@kbenzie kbenzie temporarily deployed to WindowsCILock May 26, 2025 10:01 — with GitHub Actions Inactive
@kbenzie kbenzie merged commit bc081ab into intel:sycl May 26, 2025
55 of 58 checks passed
@kbenzie kbenzie deleted the benie/ur-linker-script-conditional-symbols branch May 26, 2025 14:44
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.

2 participants