Skip to content

Commit db96000

Browse files
authored
add xcompile support for ppc64le for autotools and cmake (#1373)
ppc64le support was added to [bazel_platforms](https://github.com/bazelbuild/platforms/blob/dd28c190c563531c06ba3bd64eca1cc9ca3e667f/cpu/BUILD#L148) in 0.0.8, and rfcc has an [explicit dep on 0.0.11 now](https://github.com/bazel-contrib/rules_foreign_cc/blob/dfc81310cb56793242b521f10492bbb8ebf1f312/MODULE.bazel#L11) so it's probably safe to add it
1 parent a5ce392 commit db96000

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

examples/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use_repo(
1212
"meson_src",
1313
)
1414

15-
bazel_dep(name = "platforms", version = "0.0.6")
15+
bazel_dep(name = "platforms", version = "0.0.11")
1616
bazel_dep(name = "rules_rust", version = "0.56.0")
1717
bazel_dep(name = "rules_swift", version = "1.6.0", repo_name = "build_bazel_rules_swift")
1818
bazel_dep(name = "rules_apple", version = "3.4.0", repo_name = "build_bazel_rules_apple")

foreign_cc/private/cmake_script.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ _TARGET_ARCH_PARAMS = {
3131
"aarch64": {
3232
"CMAKE_SYSTEM_PROCESSOR": "aarch64",
3333
},
34+
"ppc64le": {
35+
"CMAKE_SYSTEM_PROCESSOR": "ppc64le",
36+
},
3437
"s390x": {
3538
"CMAKE_SYSTEM_PROCESSOR": "s390x",
3639
},

foreign_cc/private/framework/platform.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
SUPPORTED_CPU = [
44
"aarch64",
5+
"ppc64le",
56
"s390x",
67
"x86_64",
78
]
@@ -183,6 +184,8 @@ def triplet_name(os, arch):
183184
# consistently, I don't think this will break alpine.
184185
if arch == "aarch64":
185186
return "aarch64-unknown-linux-gnu"
187+
elif arch == "ppc64le":
188+
return "powerpc64le-unknown-linux-gnu"
186189
elif arch == "s390x":
187190
return "s390x-ibm-linux-gnu"
188191
elif arch == "x86_64":

foreign_cc/repositories.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ def rules_foreign_cc_dependencies(
9191
if not register_repos:
9292
return
9393

94+
maybe(
95+
http_archive,
96+
name = "platforms",
97+
urls = [
98+
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz",
99+
"https://github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz",
100+
],
101+
sha256 = "29742e87275809b5e598dc2f04d86960cc7a55b3067d97221c9abbc9926bff0f",
102+
)
103+
94104
maybe(
95105
http_archive,
96106
name = "bazel_features",

0 commit comments

Comments
 (0)