Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
Support Bazel 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
koenvervloesem committed Jan 21, 2021
1 parent 93c31e4 commit f8d74ca
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion BAZEL_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.2
4.0.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ I recommend you to build Bazel yourself, but if you really don't want to do it,
When I was searching for a Bazel build for Raspberry Pi, I encountered the following projects, which I didn't use for various reasons but they gave some helpful background information about building Bazel on ARM:

* [ochafik/rpi-raspbian-bazel](https://github.com/ochafik/rpi-raspbian-bazel): Seems to be unmaintained since end-2017.
* [PINTO0309/Bazel_bin](https://github.com/PINTO0309/Bazel_bin): Has an impressive list of pre-built binaries for armhf, aarch64 and x86_64 as well as build instructions, but no releases more recent than 2.0.0.
* [PINTO0309/Bazel_bin](https://github.com/PINTO0309/Bazel_bin): Has an impressive list of pre-built binaries for armhf, aarch64 and x86_64 as well as build instructions, but no recent releases when I started this project.
* [This fix](https://github.com/bazelbuild/bazel/issues/11643#issuecomment-650573425) by [@redsigma](https://github.com/redsigma) was the key to solve my initial issue with building Bazel on ARM.

## License
Expand Down
33 changes: 33 additions & 0 deletions patches/bazel-4.0.0-arm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff -ruN bazel/tools/cpp/unix_cc_configure.bzl bazel-2/tools/cpp/unix_cc_configure.bzl
--- bazel/tools/cpp/unix_cc_configure.bzl 1980-01-01 00:00:00.000000000 +0000
+++ bazel-2/tools/cpp/unix_cc_configure.bzl 2021-01-21 08:34:29.980980647 +0000
@@ -388,7 +388,7 @@
False,
), ":")

- bazel_linkopts = "-lstdc++:-lm"
+ bazel_linkopts = "-lstdc++:-lm -latomic"
bazel_linklibs = ""
if repository_ctx.flag_enabled("incompatible_linkopts_to_linklibs"):
bazel_linkopts, bazel_linklibs = bazel_linklibs, bazel_linkopts
diff -ruN bazel/tools/jdk/BUILD bazel-2/tools/jdk/BUILD
--- bazel/tools/jdk/BUILD 1980-01-01 00:00:00.000000000 +0000
+++ bazel-2/tools/jdk/BUILD 2021-01-21 08:35:35.219698682 +0000
@@ -145,7 +145,7 @@
"//src/conditions:freebsd": [":jni_md_header-freebsd"],
"//src/conditions:openbsd": [":jni_md_header-openbsd"],
"//src/conditions:windows": [":jni_md_header-windows"],
- "//conditions:default": [],
+ "//conditions:default": [":jni_md_header-linux"],
}),
includes = ["include"] + select({
"//src/conditions:linux_aarch64": ["include/linux"],
@@ -156,7 +156,7 @@
"//src/conditions:freebsd": ["include/freebsd"],
"//src/conditions:openbsd": ["include/openbsd"],
"//src/conditions:windows": ["include/win32"],
- "//conditions:default": [],
+ "//conditions:default": ["include/linux"],
}),
)

0 comments on commit f8d74ca

Please sign in to comment.