代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/bazel 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Description: Add toolchain support for the riscv64 architecture
Based on the mips64el toolchain patch by Yun Peng
Author: Olek Wojnar <olek@debian.org>
Forwarded: not-needed
Last-Update: 2021-01-22
--- a/src/conditions/BUILD
+++ b/src/conditions/BUILD
@@ -53,6 +53,12 @@
)
config_setting(
+ name = "linux_riscv64",
+ values = {"cpu": "riscv64"},
+ visibility = ["//visibility:public"],
+)
+
+config_setting(
name = "darwin",
values = {"cpu": "darwin"},
visibility = ["//visibility:public"],
--- a/src/conditions/BUILD.tools
+++ b/src/conditions/BUILD.tools
@@ -41,6 +41,12 @@
)
config_setting(
+ name = "linux_riscv64",
+ values = {"cpu": "riscv64"},
+ visibility = ["//visibility:public"],
+)
+
+config_setting(
name = "linux_aarch64",
values = {"cpu": "aarch64"},
visibility = ["//visibility:public"],
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java
@@ -61,6 +61,8 @@
return "aarch64";
case S390X:
return "s390x";
+ case RISCV64:
+ return "riscv64";
default:
return "unknown";
}
@@ -102,4 +104,6 @@
return Pair.of(CPU.S390X, OS.LINUX);
+ } else if (input.equals("riscv64")) {
+ return Pair.of(CPU.RISCV64, OS.LINUX);
}
// Use the auto-detected values.
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunction.java
@@ -118,4 +118,6 @@
return "@platforms//cpu:s390x";
+ case RISCV64:
+ return "@platforms//cpu:riscv64";
default:
// Unknown, so skip it.
return null;
--- a/src/main/java/com/google/devtools/build/lib/util/CPU.java
+++ b/src/main/java/com/google/devtools/build/lib/util/CPU.java
@@ -28,5 +28,6 @@
AARCH64("aarch64", ImmutableSet.of("aarch64")),
S390X("s390x", ImmutableSet.of("s390x", "s390")),
+ RISCV64("riscv64", ImmutableSet.of("riscv64")),
UNKNOWN("unknown", ImmutableSet.<String>of());
private final String canonicalName;
--- a/third_party/BUILD
+++ b/third_party/BUILD
@@ -557,5 +557,6 @@
"//src/conditions:linux_ppc": "*.so *.jnilib *.dll",
"//src/conditions:linux_s390x": "*.so *.jnilib *.dll",
+ "//src/conditions:linux_riscv64": "*.so *.jnilib *.dll",
"//src/conditions:freebsd": "*.so *.jnilib *.dll",
"//src/conditions:openbsd": "*.so *.jnilib *.dll",
# Default is to play it safe -- better have a big binary than a slow binary
@@ -748,6 +749,11 @@
values = {"host_cpu": "s390x"},
)
+config_setting(
+ name = "riscv64",
+ values = {"host_cpu": "riscv64"},
+)
+
config_setting(
name = "ppc",
values = {"host_cpu": "ppc"},
--- a/tools/cpp/BUILD.tools
+++ b/tools/cpp/BUILD.tools
@@ -108,5 +108,6 @@
"s390x|compiler": ":cc-compiler-s390x",
"ppc|compiler": ":cc-compiler-ppc",
+ "riscv64|compiler": ":cc-compiler-riscv64",
"k8": ":cc-compiler-local",
"piii": ":cc-compiler-local",
"arm": ":cc-compiler-local",
@@ -115,5 +116,6 @@
"ppc": ":cc-compiler-local",
"ppc64": ":cc-compiler-local",
+ "riscv64": ":cc-compiler-local",
"darwin": ":cc-compiler-darwin",
"freebsd": ":cc-compiler-freebsd",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
@@ -238,6 +240,33 @@
toolchain_type = ":toolchain_type",
)
+cc_toolchain(
+ name = "cc-compiler-riscv64",
+ all_files = ":empty",
+ ar_files = ":empty",
+ as_files = ":empty",
+ compiler_files = ":empty",
+ dwp_files = ":empty",
+ linker_files = ":empty",
+ objcopy_files = ":empty",
+ strip_files = ":empty",
+ supports_param_files = 1,
+ toolchain_config = ":local_linux",
+ toolchain_identifier = "local_linux",
+)
+
+toolchain(
+ name = "cc-toolchain-riscv64",
+ exec_compatible_with = [
+ "@platforms//cpu:riscv64",
+ ],
+ target_compatible_with = [
+ "@platforms//cpu:riscv64",
+ ],
+ toolchain = ":cc-compiler-riscv64",
+ toolchain_type = ":toolchain_type",
+)
+
cc_toolchain(
name = "cc-compiler-k8",
all_files = ":empty",
--- a/tools/cpp/lib_cc_configure.bzl
+++ b/tools/cpp/lib_cc_configure.bzl
@@ -197,4 +197,6 @@
return "s390x"
+ if result.stdout.strip() in ["riscv64"]:
+ return "riscv64"
if result.stdout.strip() in ["arm", "armv7l"]:
return "arm"
if result.stdout.strip() in ["aarch64"]:
--- a/tools/jdk/BUILD
+++ b/tools/jdk/BUILD
@@ -137,6 +137,7 @@
"//src/conditions:linux_aarch64": [":jni_md_header-linux"],
"//src/conditions:linux_ppc64le": [":jni_md_header-linux"],
"//src/conditions:linux_s390x": [":jni_md_header-linux"],
+ "//src/conditions:linux_riscv64": [":jni_md_header-linux"],
"//src/conditions:linux_x86_64": [":jni_md_header-linux"],
"//src/conditions:darwin": [":jni_md_header-darwin"],
"//src/conditions:freebsd": [":jni_md_header-freebsd"],
@@ -148,6 +149,7 @@
"//src/conditions:linux_aarch64": ["include/linux"],
"//src/conditions:linux_ppc64le": ["include/linux"],
"//src/conditions:linux_s390x": ["include/linux"],
+ "//src/conditions:linux_riscv64": ["include/linux"],
"//src/conditions:linux_x86_64": ["include/linux"],
"//src/conditions:darwin": ["include/darwin"],
"//src/conditions:freebsd": ["include/freebsd"],
--- a/tools/platforms/BUILD
+++ b/tools/platforms/BUILD
@@ -59,6 +59,11 @@
)
alias(
+ name = "riscv64",
+ actual = "@platforms//cpu:riscv64",
+)
+
+alias(
name = "osx",
actual = "@platforms//os:osx",
)
@@ -110,5 +115,6 @@
"@platforms//cpu:aarch64",
"@platforms//cpu:s390x",
+ "@platforms//cpu:riscv64",
],
host_platform = True,
os_constraints = [
@@ -132,5 +138,6 @@
"@platforms//cpu:aarch64",
"@platforms//cpu:s390x",
+ "@platforms//cpu:riscv64",
],
os_constraints = [
"@platforms//os:osx",
--- a/tools/platforms/BUILD.tools
+++ b/tools/platforms/BUILD.tools
@@ -47,6 +47,11 @@
)
alias(
+ name = "riscv64",
+ actual = "@platforms//cpu:riscv64",
+)
+
+alias(
name = "osx",
actual = "@platforms//os:osx",
)
@@ -98,5 +103,6 @@
"@platforms//cpu:aarch64",
"@platforms//cpu:s390x",
+ "@platforms//cpu:riscv64",
],
host_platform = True,
os_constraints = [
@@ -120,5 +126,6 @@
"@platforms//cpu:aarch64",
"@platforms//cpu:s390x",
+ "@platforms//cpu:riscv64",
],
os_constraints = [
"@platforms//os:osx",
--- bazel3.7-3.7.2.orig/src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java
+++ bazel3.7-3.7.2/src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java
@@ -55,6 +55,10 @@ public class MockPlatformSupport {
"constraint_value(",
" name = 's390x',",
" constraint_setting = ':cpu',",
+ ")",
+ "constraint_value(",
+ " name = 'riscv64',",
+ " constraint_setting = ':cpu',",
")");
mockToolsConfig.create(
TestConstants.CONSTRAINTS_PATH + "/os/BUILD",
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。