Skip to content

Commit 1ee0ead

Browse files
authored
add toolchain for aarch64 (#3460)
1 parent 28ffa52 commit 1ee0ead

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

src/WORKSPACE

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ register_toolchains("//py_toolchain:py_toolchain")
3131

3232
register_toolchains(
3333
"//py_toolchain:k8_jetson_nano_cross_compile_py_cc_toolchain",
34-
"//py_toolchain:py_cc_toolchain_for_host_x86_64",
34+
"//py_toolchain:py_cc_toolchain_host_x86_64",
35+
"//py_toolchain:py_cc_toolchain_host_aarch64",
3536
)
3637

3738
load("@rules_python//python:pip.bzl", "pip_parse")
@@ -417,7 +418,7 @@ register_toolchains(
417418
)
418419

419420
new_local_repository(
420-
name = "py_cc_toolchain_for_host_x86_64",
421+
name = "py_cc_toolchain_host",
421422
build_file = "@//extlibs:py_cc_toolchain.BUILD",
422423
path = "/usr/include/python3.12/",
423424
)

src/py_toolchain/BUILD

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ toolchain(
2222
)
2323

2424
toolchain(
25-
name = "py_cc_toolchain_for_host_x86_64",
25+
name = "py_cc_toolchain_host_x86_64",
2626
exec_compatible_with = [
2727
"@platforms//cpu:x86_64",
2828
"@platforms//os:linux",
@@ -31,13 +31,27 @@ toolchain(
3131
"@platforms//cpu:x86_64",
3232
"@platforms//os:linux",
3333
],
34-
toolchain = ":py_cc_toolchain_for_host_x86_64_data",
34+
toolchain = ":py_cc_toolchain_host_data",
35+
toolchain_type = "@rules_python//python/cc:toolchain_type",
36+
)
37+
38+
toolchain(
39+
name = "py_cc_toolchain_host_aarch64",
40+
exec_compatible_with = [
41+
"@platforms//cpu:aarch64",
42+
"@platforms//os:linux",
43+
],
44+
target_compatible_with = [
45+
"@platforms//cpu:aarch64",
46+
"@platforms//os:linux",
47+
],
48+
toolchain = ":py_cc_toolchain_host_data",
3549
toolchain_type = "@rules_python//python/cc:toolchain_type",
3650
)
3751

3852
py_cc_toolchain(
39-
name = "py_cc_toolchain_for_host_x86_64_data",
40-
headers = "@py_cc_toolchain_for_host_x86_64//:headers",
53+
name = "py_cc_toolchain_host_data",
54+
headers = "@py_cc_toolchain_host//:headers",
4155
libs = ":empty",
4256
python_version = "3.12",
4357
)

0 commit comments

Comments
 (0)