Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Run format
run: |
bazel run //:buildifier
bazel run //tools/buildifier:buildifier
git diff --exit-code

example-small-world:
Expand All @@ -47,5 +47,6 @@ jobs:

- name: Run format
run: |
bazel run //:buildifier
cd examples/small_world
bazel run //tools/buildifier:buildifier
git diff --exit-code
5 changes: 0 additions & 5 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
load("@buildifier_prebuilt//:rules.bzl", "buildifier")

buildifier(
name = "buildifier",
)
12 changes: 6 additions & 6 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

module(
name = "rules_swiftnav",
version = "0.10.0",
version = "0.11.0",
compatibility_level = 1,
)

# Core Bazel dependencies
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_oci", version = "1.0.0")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "rules_oci", version = "1.8.0")

# Register module extensions
swift_cc_toolchain_ext = use_extension("@rules_swiftnav//cc:extensions.bzl", "swift_cc_toolchain_extension")
Expand Down
242 changes: 203 additions & 39 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cc/toolchains/llvm/x86_64-aarch64-linux/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ cc_toolchain_config(
"//conditions:default": [],
}),
host_system_name = X86_64_LINUX,
target_cpu = "k8",
target_cpu = "k8", # this should be aarch64?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be aarch64?
Would k8 be a placeholder for kubernetes often abbreviated to k8s? This is indeed strange

Copy link
Contributor Author

@martin4861 martin4861 Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming is unfortunate. k8 means amd64, whereas k8s stands for kubernetes. Thats for clang14, it is working as expected currently. Therefore I keep it as it is for now, but maybe I revisit it in a follow up PR.

target_libc = "glibc_unknown",
target_system_name = AARCH64_LINUX,
tool_paths = {
Expand All @@ -125,7 +125,7 @@ cc_toolchain_config(
"gcov": "wrappers/llvm-profdata",
"llvm-cov": "wrappers/llvm-cov",
"llvm-profdata": "wrappers/llvm-profdata",
"ld": "wrappers/ld.ldd",
"ld": "wrappers/ld.ldd", # This should be ld.lld?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ld.lld?

I question if it should be ld.lld since its not the operating system's default linker, but that discussion might lead to other issues, maybe this is okay for now since all the tools are coming from LLVM project

Copy link
Contributor Author

@martin4861 martin4861 Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, it should be ld.lld from the llvm project, because ld.ldd could be a typo. I think, that ld is not used, because the toolchain always uses clang for compiling and linking (which then calls the linker). I might revisit this in a follow up PR.

"nm": "wrappers/llvm-nm",
"objcopy": "wrappers/llvm-objcopy",
"objdump": "wrappers/llvm-objdump",
Expand Down
43 changes: 42 additions & 1 deletion cc/toolchains/llvm20/x86_64-aarch64-linux/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,18 @@ cc_toolchain_config(
abi_libc_version = "glibc_unknown",
abi_version = "clang",
builtin_sysroot = select({
# _use_libcpp case needs to be implemented properly here!
"@rules_swiftnav//cc:_use_libcpp": None,
"//conditions:default": "external/rules_swiftnav++swift_cc_toolchain_extension+aarch64-sysroot",
}),
compiler = "clang",
cxx_builtin_include_directories = [
"%sysroot%/usr/include",
],
extra_copts = select({
"@rules_swiftnav//cc/constraints:graviton2": ["-mcpu=neoverse-n1"],
"@rules_swiftnav//cc/constraints:graviton3": ["-mcpu=neoverse-512tvb"],
"//conditions:default": [],
}),
host_system_name = X86_64_LINUX,
target_cpu = "aarch64",
target_libc = "glibc_unknown",
Expand Down Expand Up @@ -158,3 +163,39 @@ toolchain(
toolchain = ":cc-clang-x86_64-aarch64-linux",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

toolchain(
name = "cc-toolchain-aarch64-bullseye-graviton2",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
target_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
"@rules_swiftnav//cc/constraints:glibc_2_31",
"@rules_swiftnav//cc/constraints:graviton2",
"@rules_swiftnav//cc/constraints:llvm20_toolchain",
],
target_settings = None,
toolchain = ":cc-clang-x86_64-aarch64-linux",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

toolchain(
name = "cc-toolchain-aarch64-bullseye-graviton3",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
target_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
"@rules_swiftnav//cc/constraints:glibc_2_31",
"@rules_swiftnav//cc/constraints:graviton3",
"@rules_swiftnav//cc/constraints:llvm20_toolchain",
],
target_settings = None,
toolchain = ":cc-clang-x86_64-aarch64-linux",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
5 changes: 0 additions & 5 deletions examples/small_world/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
load("@buildifier_prebuilt//:rules.bzl", "buildifier")

buildifier(
name = "buildifier",
)
2 changes: 1 addition & 1 deletion examples/small_world/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(name = "small_world")

bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_swiftnav")
local_path_override(
module_name = "rules_swiftnav",
Expand Down
Loading