-
Notifications
You must be signed in to change notification settings - Fork 15
Add aarch64 support #42
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
Conversation
|
This relates to lowRISC/lowrisc-toolchains#85. |
|
We're no longer using this repo. OT now uses rules_cc and in-repo rules instead |
|
CRT is still used by the I haven’t done anything per-platform like this before so I’m no help, sorry. |
|
Yes @jwnrt I was trying these changes for the earlgrey branches. |
|
This should be ready for review now. Before merging we should have this point to a new release of the lowrisc toolchains |
|
I think this should be using Bazel toolchains and constraints instead of using a driver shell script with |
I suspect there is a better way of doing this to avoid downloading both toolchains but I need to look at the bazel documentation. |
|
After a bit of searching, I suspect the proper way of doing this is to change compiler.bzl so that native.toolchain(
name = "cc_toolchain_" + name,
exec_compatible_with = [
"@platforms//cpu:x86_64",
],
target_compatible_with = constraints,
toolchain = ":" + name,
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)Therefore I would suggest to try to add an argument to |
|
Ok great! Thanks for the feedback @pamaury. As I just realized my concern regarding downloading both toolchains was unfounded. |
|
@nbdd0121 Instead of using one driver shell script with |
I think using |
pamaury
left a comment
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.
I can't test it but the code looks good to me.
|
I have cut a release of the toolchain, feel free to update the URL https://github.com/lowRISC/lowrisc-toolchains/releases/tag/20250303-1 |
This registers both the x86 and the aarch64 toolchain. Bazel then decides which one to use as part of the automatic toolchain resolution.
👍 Using of |
I could not find a way to read out the host architecture in lowrisc_rv32imcb_repos.
Using load("@local_config_platform//:constraints.bzl", "HOST_CONSTRAINTS")
at that stage leads to cycles in the workspace file.
Instead I now download both the ARM and X86 toolchains.
Next I register both and finally I let Bazel decide which one to use
as part of the automatic toolchain resolution.