-
Notifications
You must be signed in to change notification settings - Fork 11
arm64 support from prebuilt gcc packages #19
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
base: main
Are you sure you want to change the base?
Changes from all commits
ac32f33
1ac2ff1
ad5d4b8
9431de7
1b04c71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| ## Using aarch64/arm64 toolchain | ||
|
|
||
| ### In your MODULE.bazel: | ||
|
|
||
| ```python | ||
| bazel_dep(name = "score_toolchains_gcc", version = "0.0.7") | ||
|
|
||
| gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc") | ||
| # Default toolchains for x86_64 and aarch64 are automatically configured | ||
|
|
||
| use_repo(gcc, "gcc_toolchain_x86_64", "gcc_toolchain_aarch64") | ||
| register_toolchains( | ||
| "@gcc_toolchain_x86_64//:host_gcc_12", | ||
| "@gcc_toolchain_aarch64//:host_gcc_12", | ||
| ) | ||
| ``` | ||
|
|
||
| ### Building for arm64: | ||
|
|
||
| Add to your project's `.bazelrc`: | ||
| ``` | ||
| # ARM64 build configuration | ||
| build:arm64 --platforms=@score_toolchains_gcc//platforms:aarch64-linux | ||
| build:aarch64 --platforms=@score_toolchains_gcc//platforms:aarch64-linux | ||
| ``` | ||
|
|
||
| Then build with: | ||
| ```bash | ||
| # Using the config | ||
| bazel build --config=arm64 //your:target | ||
| # or | ||
| bazel build --config=aarch64 //your:target | ||
|
|
||
| # Direct platform specification (without .bazelrc) | ||
| bazel build --platforms=@score_toolchains_gcc//platforms:aarch64-linux //your:target | ||
| ``` | ||
|
|
||
| ## Example | ||
|
|
||
| See the `test/` directory for a complete working example that supports both x86_64 and aarch64 builds. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,3 +19,12 @@ platform( | |
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have platform repository which we need to reuse for platform definitions. It's still not released, but that's just matter of adding it to S-CORE Bazel Registry. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @skarlsson Whats the state of that pull request? That would be really great to have it in. Can you please fix the comments especially the platforms. Release is already there bazel_dep(name = "score_bazel_platforms", version = "0.0.2")
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I took the earlier comment as a hint to wait until the you had a new implementation in place and I thought to give it a try again at a later time.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The pull request - at the time it was done worked and I had a working arm64 baselibs on top of that - but I found it inefficient to have so many local forks so I decided to wait |
||
| platform( | ||
| name = "aarch64-linux", | ||
| constraint_values = [ | ||
| "@platforms//cpu:aarch64", | ||
| "@platforms//os:linux", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,4 +19,5 @@ cc_binary( | |
| cc_binary( | ||
| name = "main_pthread_cpp", | ||
| srcs = ["main_pthread.cpp"], | ||
| features = ["use_pthread"], | ||
| ) | ||
Uh oh!
There was an error while loading. Please reload this page.