Closed
add loongarch64 support for bazel #44
zhangwenlong01Add on Apr 17, 2025Closed at May 6
add loongarch64 support for bazel #44
Closed
Merged fromrefs/pull/44/headintoopenEuler-24.03-LTS-SP2
Total: 2 files changed+363-1
| @@ -0,0 +1,355 @@ | |||
| 1 | +From 35dd50572d20e4e96c9e52284fea91003048f08a Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Wenlong Zhang <zhangwenlong@loongson.cn> | ||
| 3 | +Date: Thu, 17 Apr 2025 20:42:00 +0800 | ||
| 4 | +Subject: [PATCH] add loongarch64 support for bazel | ||
| 5 | + | ||
| 6 | +--- | ||
| 7 | + WORKSPACE | 9 +++++++++ | ||
| 8 | + distdir_deps.bzl | 20 +++++++++++++++---- | ||
| 9 | + platforms/cpu/BUILD | 5 +++++ | ||
| 10 | + src/conditions/BUILD | 9 +++++++++ | ||
| 11 | + src/conditions/BUILD.tools | 9 +++++++++ | ||
| 12 | + .../lib/analysis/config/AutoCpuConverter.java | 4 ++++ | ||
| 13 | + .../LocalConfigPlatformFunction.java | 2 ++ | ||
| 14 | + .../devtools/build/lib/bazel/rules/java/BUILD | 1 + | ||
| 15 | + .../build/lib/bazel/rules/java/jdk.WORKSPACE | 15 ++++++++++++++ | ||
| 16 | + .../lib/bazel/rules/java/jdk.WORKSPACE.tmpl | 16 +++++++++++++++ | ||
| 17 | + .../google/devtools/build/lib/util/CPU.java | 1 + | ||
| 18 | + tools/cpp/lib_cc_configure.bzl | 2 ++ | ||
| 19 | + tools/jdk/BUILD.tools | 3 +++ | ||
| 20 | + tools/platforms/BUILD | 7 +++++++ | ||
| 21 | + tools/platforms/BUILD.tools | 7 +++++++ | ||
| 22 | + 15 files changed, 106 insertions(+), 4 deletions(-) | ||
| 23 | + | ||
| 24 | +diff --git a/WORKSPACE b/WORKSPACE | ||
| 25 | +index 84b1ca1..8bcdb53 100755 | ||
| 26 | +--- a/WORKSPACE | ||
| 27 | ++++ b/WORKSPACE | ||
| 28 | +@@ -206,6 +206,15 @@ http_file( | ||
| 29 | + ], | ||
| 30 | + ) | ||
| 31 | + | ||
| 32 | ++http_file( | ||
| 33 | ++ name = "openjdk_linux_loongarch64_vanilla", | ||
| 34 | ++ downloaded_file_path = "openjdk-linux-loongarch64.tar.gz", | ||
| 35 | ++ sha256 = "4f27223a1f183c9523b21b042507ca80ab65b8cae26f64b30c1375dda39a45ad", | ||
| 36 | ++ urls = [ | ||
| 37 | ++ "https://ftp.loongnix.cn/Java/openjdk11/loongson11.10.0-fx-jdk11.0.23_9-linux-loongarch64.tar.gz" | ||
| 38 | ++ ], | ||
| 39 | ++ ) | ||
| 40 | ++ | ||
| 41 | + http_file( | ||
| 42 | + name = "openjdk_macos_x86_64", | ||
| 43 | + downloaded_file_path = "zulu-macos.tar.gz", | ||
| 44 | +diff --git a/distdir_deps.bzl b/distdir_deps.bzl | ||
| 45 | +index 2ca988e..0087783 100755 | ||
| 46 | +--- a/distdir_deps.bzl | ||
| 47 | ++++ b/distdir_deps.bzl | ||
| 48 | +@@ -20,11 +20,10 @@ DIST_DEPS = { | ||
| 49 | + # | ||
| 50 | + ######################################## | ||
| 51 | + "platforms": { | ||
| 52 | +- "archive": "platforms-0.0.4.tar.gz", | ||
| 53 | +- "sha256": "079945598e4b6cc075846f7fd6a9d0857c33a7afc0de868c2ccb96405225135d", | ||
| 54 | ++ "archive": "platforms-0.0.5.tar.gz", | ||
| 55 | ++ "sha256": "cc18d9ae5f2190f5288c37d6a4689b79ccb071efa93b56abc2d7904fbe156f2b", | ||
| 56 | + "urls": [ | ||
| 57 | +- "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.4/platforms-0.0.4.tar.gz", | ||
| 58 | +- "https://github.com/bazelbuild/platforms/releases/download/0.0.4/platforms-0.0.4.tar.gz", | ||
| 59 | ++ "https://github.com/Loongson-Cloud-Community/platforms/releases/download/0.0.5/platforms-0.0.5.tar.gz", | ||
| 60 | + ], | ||
| 61 | + "used_in": [ | ||
| 62 | + "additional_distfiles", | ||
| 63 | +@@ -370,6 +369,19 @@ DIST_DEPS = { | ||
| 64 | + ], | ||
| 65 | + "used_in": ["test_WORKSPACE_files"], | ||
| 66 | + }, | ||
| 67 | ++ "remotejdk11_linux_loongarch64": { | ||
| 68 | ++ "aliases": [ | ||
| 69 | ++ "remotejdk11_linux_loongarch64_for_testing", | ||
| 70 | ++ "openjdk_linux_loongarch64_vanilla", | ||
| 71 | ++ ], | ||
| 72 | ++ "archive": "loongson11.10.0-fx-jdk11.0.23_9-linux-loongarch64.tar.gz", | ||
| 73 | ++ "sha256": "4f27223a1f183c9523b21b042507ca80ab65b8cae26f64b30c1375dda39a45ad", | ||
| 74 | ++ "strip_prefix": "jdk-11.0.23", | ||
| 75 | ++ "urls": [ | ||
| 76 | ++ "http://ftp.loongnix.cn/Java/openjdk11/loongson11.10.0-fx-jdk11.0.23_9-linux-loongarch64.tar.gz", | ||
| 77 | ++ ], | ||
| 78 | ++ "used_in": [], | ||
| 79 | ++ }, | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + # Add aliased names | ||
| 83 | +diff --git a/platforms/cpu/BUILD b/platforms/cpu/BUILD | ||
| 84 | +index 51a968a..2f018f8 100755 | ||
| 85 | +--- a/platforms/cpu/BUILD | ||
| 86 | ++++ b/platforms/cpu/BUILD | ||
| 87 | +@@ -124,3 +124,8 @@ constraint_value( | ||
| 88 | + name = "riscv64", | ||
| 89 | + constraint_setting = ":cpu", | ||
| 90 | + ) | ||
| 91 | ++ | ||
| 92 | ++constraint_value( | ||
| 93 | ++ name = "loongarch64", | ||
| 94 | ++ constraint_setting = ":cpu", | ||
| 95 | ++ ) | ||
| 96 | +diff --git a/src/conditions/BUILD b/src/conditions/BUILD | ||
| 97 | +index d5bfac6..a952ee8 100755 | ||
| 98 | +--- a/src/conditions/BUILD | ||
| 99 | ++++ b/src/conditions/BUILD | ||
| 100 | +@@ -84,6 +84,15 @@ config_setting( | ||
| 101 | + visibility = ["//visibility:public"], | ||
| 102 | + ) | ||
| 103 | + | ||
| 104 | ++config_setting( | ||
| 105 | ++ name = "linux_loongarch64", | ||
| 106 | ++ constraint_values = [ | ||
| 107 | ++ "@platforms//os:linux", | ||
| 108 | ++ "@platforms//cpu:loongarch64", | ||
| 109 | ++ ], | ||
| 110 | ++ visibility = ["//visibility:public"], | ||
| 111 | ++ ) | ||
| 112 | ++ | ||
| 113 | + config_setting( | ||
| 114 | + name = "linux_x86_64", | ||
| 115 | + constraint_values = [ | ||
| 116 | +diff --git a/src/conditions/BUILD.tools b/src/conditions/BUILD.tools | ||
| 117 | +index aafdb4f..e95bbd5 100755 | ||
| 118 | +--- a/src/conditions/BUILD.tools | ||
| 119 | ++++ b/src/conditions/BUILD.tools | ||
| 120 | +@@ -69,6 +69,15 @@ config_setting( | ||
| 121 | + visibility = ["//visibility:public"], | ||
| 122 | + ) | ||
| 123 | + | ||
| 124 | ++config_setting( | ||
| 125 | ++ name = "linux_loongarch64", | ||
| 126 | ++ constraint_values = [ | ||
| 127 | ++ "@platforms//os:linux", | ||
| 128 | ++ "@platforms//cpu:loongarch64", | ||
| 129 | ++ ], | ||
| 130 | ++ visibility = ["//visibility:public"], | ||
| 131 | ++ ) | ||
| 132 | ++ | ||
| 133 | + config_setting( | ||
| 134 | + name = "linux_x86_64", | ||
| 135 | + constraint_values = [ | ||
| 136 | +diff --git 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 | ||
| 137 | +index 07b1352..a0c56bf 100755 | ||
| 138 | +--- a/src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java | ||
| 139 | ++++ b/src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java | ||
| 140 | +@@ -74,6 +74,8 @@ public class AutoCpuConverter implements Converter<String> { | ||
| 141 | + return "mips64"; | ||
| 142 | + case RISCV64: | ||
| 143 | + return "riscv64"; | ||
| 144 | ++ case LOONGARCH64: | ||
| 145 | ++ return "loongarch64"; | ||
| 146 | + default: | ||
| 147 | + return "unknown"; | ||
| 148 | + } | ||
| 149 | +@@ -118,6 +120,8 @@ public class AutoCpuConverter implements Converter<String> { | ||
| 150 | + return Pair.of(CPU.MIPS64, OS.LINUX); | ||
| 151 | + case "riscv64": | ||
| 152 | + return Pair.of(CPU.RISCV64, OS.LINUX); | ||
| 153 | ++ case "loongarch64": | ||
| 154 | ++ return Pair.of(CPU.LOONGARCH64, OS.LINUX); | ||
| 155 | + default: | ||
| 156 | + // fall through | ||
| 157 | + } | ||
| 158 | +diff --git 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 | ||
| 159 | +index c67b109..97d5346 100755 | ||
| 160 | +--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunction.java | ||
| 161 | ++++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunction.java | ||
| 162 | +@@ -120,6 +120,8 @@ public class LocalConfigPlatformFunction extends RepositoryFunction { | ||
| 163 | + return "@platforms//cpu:mips64"; | ||
| 164 | + case RISCV64: | ||
| 165 | + return "@platforms//cpu:riscv64"; | ||
| 166 | ++ case LOONGARCH64: | ||
| 167 | ++ return "@platforms//cpu:loongarch64"; | ||
| 168 | + default: | ||
| 169 | + // Unknown, so skip it. | ||
| 170 | + return null; | ||
| 171 | +diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BUILD b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BUILD | ||
| 172 | +index ebbadd8..5a88eca 100755 | ||
| 173 | +--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BUILD | ||
| 174 | ++++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BUILD | ||
| 175 | +@@ -86,6 +86,7 @@ gen_workspace_stanza( | ||
| 176 | + "remote_java_tools_darwin", | ||
| 177 | + "remotejdk11_win_arm64", | ||
| 178 | + "remotejdk17_win_arm64", | ||
| 179 | ++ "remotejdk11_linux_loongarch64", | ||
| 180 | + "rules_cc", | ||
| 181 | + "rules_java", | ||
| 182 | + "rules_proto", | ||
| 183 | +diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE | ||
| 184 | +index e7bca19..1a6a226 100755 | ||
| 185 | +--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE | ||
| 186 | ++++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE | ||
| 187 | +@@ -33,6 +33,21 @@ maybe( | ||
| 188 | + version = "11", | ||
| 189 | + ) | ||
| 190 | + | ||
| 191 | ++maybe( | ||
| 192 | ++ remote_java_repository, | ||
| 193 | ++ | ||
| 194 | ++ name = "remotejdk11_linux_loongarch64", | ||
| 195 | ++ exec_compatible_with = [ | ||
| 196 | ++ "@platforms//os:linux", | ||
| 197 | ++ "@platforms//cpu:loongarch64", | ||
| 198 | ++ ], | ||
| 199 | ++ sha256 = "4f27223a1f183c9523b21b042507ca80ab65b8cae26f64b30c1375dda39a45ad", | ||
| 200 | ++ strip_prefix = "jdk-11.0.23", | ||
| 201 | ++ urls = ["http://ftp.loongnix.cn/Java/openjdk11/loongson11.10.0-fx-jdk11.0.23_9-linux-loongarch64.tar.gz"], | ||
| 202 | ++ | ||
| 203 | ++ version = "11", | ||
| 204 | ++ ) | ||
| 205 | ++ | ||
| 206 | + # This must be kept in sync with the top-level WORKSPACE file. | ||
| 207 | + maybe( | ||
| 208 | + remote_java_repository, | ||
| 209 | +diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.tmpl b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.tmpl | ||
| 210 | +index 263c921..29564e3 100755 | ||
| 211 | +--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.tmpl | ||
| 212 | ++++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE.tmpl | ||
| 213 | +@@ -83,6 +83,22 @@ maybe( | ||
| 214 | + version = "11", | ||
| 215 | + ) | ||
| 216 | + | ||
| 217 | ++# This must be kept in sync with the top-level WORKSPACE file. | ||
| 218 | ++maybe( | ||
| 219 | ++ remote_java_repository, | ||
| 220 | ++ name = "remotejdk11_linux_loongarch64", | ||
| 221 | ++ exec_compatible_with = [ | ||
| 222 | ++ "@platforms//os:linux", | ||
| 223 | ++ "@platforms//cpu:loongarch64", | ||
| 224 | ++ ], | ||
| 225 | ++ sha256 = "4f27223a1f183c9523b21b042507ca80ab65b8cae26f64b30c1375dda39a45ad", | ||
| 226 | ++ strip_prefix = "jdk-11.0.23", | ||
| 227 | ++ urls = [ | ||
| 228 | ++ "https://ftp.loongnix.cn/Java/openjdk11/loongson11.10.0-fx-jdk11.0.23_9-linux-loongarch64.tar.gz", | ||
| 229 | ++ ], | ||
| 230 | ++ version = "11", | ||
| 231 | ++) | ||
| 232 | ++ | ||
| 233 | + # This must be kept in sync with the top-level WORKSPACE file. | ||
| 234 | + maybe( | ||
| 235 | + remote_java_repository, | ||
| 236 | +diff --git a/src/main/java/com/google/devtools/build/lib/util/CPU.java b/src/main/java/com/google/devtools/build/lib/util/CPU.java | ||
| 237 | +index 88ae4a3..87f7dde 100755 | ||
| 238 | +--- a/src/main/java/com/google/devtools/build/lib/util/CPU.java | ||
| 239 | ++++ b/src/main/java/com/google/devtools/build/lib/util/CPU.java | ||
| 240 | +@@ -29,6 +29,7 @@ public enum CPU { | ||
| 241 | + S390X("s390x", ImmutableSet.of("s390x", "s390")), | ||
| 242 | + MIPS64("mips64", ImmutableSet.of("mips64el", "mips64")), | ||
| 243 | + RISCV64("riscv64", ImmutableSet.of("riscv64")), | ||
| 244 | ++ LOONGARCH64("loongarch64", ImmutableSet.of("loong64", "loongarch64")), | ||
| 245 | + UNKNOWN("unknown", ImmutableSet.<String>of()); | ||
| 246 | + | ||
| 247 | + private final String canonicalName; | ||
| 248 | +diff --git a/tools/cpp/lib_cc_configure.bzl b/tools/cpp/lib_cc_configure.bzl | ||
| 249 | +index f8689fb..9ed3359 100755 | ||
| 250 | +--- a/tools/cpp/lib_cc_configure.bzl | ||
| 251 | ++++ b/tools/cpp/lib_cc_configure.bzl | ||
| 252 | +@@ -202,6 +202,8 @@ def get_cpu_value(repository_ctx): | ||
| 253 | + return "mips64" | ||
| 254 | + if arch in ["riscv64"]: | ||
| 255 | + return "riscv64" | ||
| 256 | ++ if arch in ["loong64", "loongarch64"]: | ||
| 257 | ++ return "loongarch64" | ||
| 258 | + if arch in ["arm", "armv7l"]: | ||
| 259 | + return "arm" | ||
| 260 | + if arch in ["aarch64"]: | ||
| 261 | +diff --git a/tools/jdk/BUILD.tools b/tools/jdk/BUILD.tools | ||
| 262 | +index bab066e..869f5d3 100755 | ||
| 263 | +--- a/tools/jdk/BUILD.tools | ||
| 264 | ++++ b/tools/jdk/BUILD.tools | ||
| 265 | +@@ -95,6 +95,7 @@ cc_library( | ||
| 266 | + "//src/conditions:linux_s390x": [":jni_md_header-linux"], | ||
| 267 | + "//src/conditions:linux_mips64": [":jni_md_header-linux"], | ||
| 268 | + "//src/conditions:linux_riscv64": [":jni_md_header-linux"], | ||
| 269 | ++ "//src/conditions:linux_loongarch64": [":jni_md_header-linux"], | ||
| 270 | + "//src/conditions:linux_x86_64": [":jni_md_header-linux"], | ||
| 271 | + "//src/conditions:darwin": [":jni_md_header-darwin"], | ||
| 272 | + "//src/conditions:freebsd": [":jni_md_header-freebsd"], | ||
| 273 | +@@ -108,6 +109,7 @@ cc_library( | ||
| 274 | + "//src/conditions:linux_s390x": ["include/linux"], | ||
| 275 | + "//src/conditions:linux_mips64": ["include/linux"], | ||
| 276 | + "//src/conditions:linux_riscv64": ["include/linux"], | ||
| 277 | ++ "//src/conditions:linux_loongarch64": ["include/linux"], | ||
| 278 | + "//src/conditions:linux_x86_64": ["include/linux"], | ||
| 279 | + "//src/conditions:darwin": ["include/darwin"], | ||
| 280 | + "//src/conditions:freebsd": ["include/freebsd"], | ||
| 281 | +@@ -451,6 +453,7 @@ _JDKS = [ | ||
| 282 | + "remotejdk11_linux", | ||
| 283 | + "remotejdk11_linux_ppc64le", | ||
| 284 | + "remotejdk11_linux_s390x", | ||
| 285 | ++ "remotejdk11_linux_loongarch64", | ||
| 286 | + "remotejdk15_macos", | ||
| 287 | + "remotejdk15_macos_aarch64", | ||
| 288 | + "remotejdk15_win", | ||
| 289 | +diff --git a/tools/platforms/BUILD b/tools/platforms/BUILD | ||
| 290 | +index 18ff33e..6571aa8 100755 | ||
| 291 | +--- a/tools/platforms/BUILD | ||
| 292 | ++++ b/tools/platforms/BUILD | ||
| 293 | +@@ -63,6 +63,11 @@ alias( | ||
| 294 | + actual = "@platforms//cpu:riscv64", | ||
| 295 | + ) | ||
| 296 | + | ||
| 297 | ++alias( | ||
| 298 | ++ name = "loongarch64", | ||
| 299 | ++ actual = "@platforms//cpu:loongarch64", | ||
| 300 | ++ ) | ||
| 301 | ++ | ||
| 302 | + alias( | ||
| 303 | + name = "os", | ||
| 304 | + actual = "@platforms//os:os", | ||
| 305 | +@@ -121,6 +126,7 @@ platform( | ||
| 306 | + "@platforms//cpu:s390x", | ||
| 307 | + "@platforms//cpu:mips64", | ||
| 308 | + "@platforms//cpu:riscv64", | ||
| 309 | ++ "@platforms//cpu:loongarch64", | ||
| 310 | + ], | ||
| 311 | + host_platform = True, | ||
| 312 | + os_constraints = [ | ||
| 313 | +@@ -145,6 +151,7 @@ platform( | ||
| 314 | + "@platforms//cpu:s390x", | ||
| 315 | + "@platforms//cpu:mips64", | ||
| 316 | + "@platforms//cpu:riscv64", | ||
| 317 | ++ "@platforms//cpu:loongarch64", | ||
| 318 | + ], | ||
| 319 | + os_constraints = [ | ||
| 320 | + "@platforms//os:osx", | ||
| 321 | +diff --git a/tools/platforms/BUILD.tools b/tools/platforms/BUILD.tools | ||
| 322 | +index 27a11ae..5b47f43 100755 | ||
| 323 | +--- a/tools/platforms/BUILD.tools | ||
| 324 | ++++ b/tools/platforms/BUILD.tools | ||
| 325 | +@@ -51,6 +51,11 @@ alias( | ||
| 326 | + actual = "@platforms//cpu:riscv64", | ||
| 327 | + ) | ||
| 328 | + | ||
| 329 | ++alias( | ||
| 330 | ++ name = "loongarch64", | ||
| 331 | ++ actual = "@platforms//cpu:loongarch64", | ||
| 332 | ++ ) | ||
| 333 | ++ | ||
| 334 | + alias( | ||
| 335 | + name = "os", | ||
| 336 | + actual = "@platforms//os:os", | ||
| 337 | +@@ -109,6 +114,7 @@ platform( | ||
| 338 | + "@platforms//cpu:s390x", | ||
| 339 | + "@platforms//cpu:mips64", | ||
| 340 | + "@platforms//cpu:riscv64", | ||
| 341 | ++ "@platforms//cpu:loongarch64", | ||
| 342 | + ], | ||
| 343 | + host_platform = True, | ||
| 344 | + os_constraints = [ | ||
| 345 | +@@ -133,6 +139,7 @@ platform( | ||
| 346 | + "@platforms//cpu:s390x", | ||
| 347 | + "@platforms//cpu:mips64", | ||
| 348 | + "@platforms//cpu:riscv64", | ||
| 349 | ++ "@platforms//cpu:loongarch64", | ||
| 350 | + ], | ||
| 351 | + os_constraints = [ | ||
| 352 | + "@platforms//os:osx", | ||
| 353 | +-- | ||
| 354 | +2.43.0 | ||
| 355 | + | ||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | Name: bazel | 3 | Name: bazel |
| 4 | Version: 5.3.0 | 4 | Version: 5.3.0 |
| 5 | -Release: 3 | 5 | +Release: 4 |
| 6 | Summary: Correct, reproducible, and fast builds for everyone. | 6 | Summary: Correct, reproducible, and fast builds for everyone. |
| 7 | License: Apache License 2.0 | 7 | License: Apache License 2.0 |
| 8 | URL: http://bazel.io/ | 8 | URL: http://bazel.io/ |
| @@ -12,6 +12,7 @@ Patch0: 01-fix-invalid-jni_md-select.patch | |||
| 12 | Patch2: 03-set-default-nojdk.patch | 12 | Patch2: 03-set-default-nojdk.patch |
| 13 | Patch3: linux-bazel-path-from-getauxval.patch | 13 | Patch3: linux-bazel-path-from-getauxval.patch |
| 14 | Patch4: 04-riscv-distdir_deps.patch | 14 | Patch4: 04-riscv-distdir_deps.patch |
| 15 | +Patch5: 0005-add-loongarch64-support-for-bazel.patch | ||
| 15 | # for folks with 'bazel' v1 package installed | 16 | # for folks with 'bazel' v1 package installed |
| 16 | Conflicts: bazel | 17 | Conflicts: bazel |
| 17 | Conflicts: bazel2 | 18 | Conflicts: bazel2 |
| @@ -38,6 +39,9 @@ Correct, reproducible, and fast builds for everyone. | |||
| 38 | mkdir third_party/abseil-cpp | 39 | mkdir third_party/abseil-cpp |
| 39 | cp %{SOURCE1} third_party/abseil-cpp | 40 | cp %{SOURCE1} third_party/abseil-cpp |
| 40 | %endif | 41 | %endif |
| 42 | +%ifarch loongarch64 | ||
| 43 | +%patch5 -p1 | ||
| 44 | +%endif | ||
| 41 | 45 | ||
| 42 | %build | 46 | %build |
| 43 | find . -type f -regextype posix-extended -iregex '.*(sh|txt|py|_stub|stub_.*|bazel|get_workspace_status|protobuf_support|_so)' -exec %{__sed} -i -e '1s|^#!/usr/bin/env python$|#!/usr/bin/env python3|' "{}" \; | 47 | find . -type f -regextype posix-extended -iregex '.*(sh|txt|py|_stub|stub_.*|bazel|get_workspace_status|protobuf_support|_so)' -exec %{__sed} -i -e '1s|^#!/usr/bin/env python$|#!/usr/bin/env python3|' "{}" \; |
| @@ -97,6 +101,9 @@ env ./scripts/generate_bash_completion.sh --bazel=output/bazel --output=output/b | |||
| 97 | %attr(0755,root,root) %{bashcompdir}/bazel | 101 | %attr(0755,root,root) %{bashcompdir}/bazel |
| 98 | 102 | ||
| 99 | %changelog | 103 | %changelog |
| 104 | +* Thu Apr 17 2025 Wenlong Zhang <zhangwenlong@loongson.cn> - 5.3.0-4 | ||
| 105 | +- add loongarch64 support for bazel | ||
| 106 | + | ||
| 100 | * Wed Feb 19 2025 laokz <zhangkai@iscas.ac.cn> - 5.3.0-3 | 107 | * Wed Feb 19 2025 laokz <zhangkai@iscas.ac.cn> - 5.3.0-3 |
| 101 | - remove unused patch1 | 108 | - remove unused patch1 |
| 102 | 109 | ||