File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,18 @@ build:clang --action_env=BAZEL_COMPILER=clang
8
8
build:clang --action_env=CC=clang
9
9
build:clang --action_env=CXX=clang++
10
10
11
+ # Use Zig C/C++ compiler.
12
+ build:zig-cc --incompatible_enable_cc_toolchain_resolution
13
+ build:zig-cc --extra_toolchains @zig_sdk//:aarch64-linux-gnu.2.28_toolchain
14
+ build:zig-cc --extra_toolchains @zig_sdk//:x86_64-linux-gnu.2.28_toolchain
15
+ build:zig-cc --host_copt=-fno-sanitize=undefined
16
+
17
+ # Use Zig C/C++ compiler (cross-compile to Linux/aarch64).
18
+ build:zig-cc-linux-aarch64 --config=zig-cc
19
+ build:zig-cc-linux-aarch64 --platforms @zig_sdk//:linux_aarch64_platform
20
+ build:zig-cc-linux-aarch64 --run_under=qemu-aarch64-static
21
+ build:zig-cc-linux-aarch64 --test_env=QEMU_LD_PREFIX=/usr/aarch64-linux-gnu/
22
+
11
23
build --enable_platform_specific_config
12
24
13
25
build:linux --cxxopt=-std=c++17
Original file line number Diff line number Diff line change @@ -121,6 +121,14 @@ jobs:
121
121
arch : x86_64
122
122
action : test
123
123
flags : --config=clang --define=crypto=system
124
+ - name : ' V8 on Linux/aarch64'
125
+ runtime : ' v8'
126
+ repo : ' v8'
127
+ os : ubuntu-20.04
128
+ arch : aarch64
129
+ action : test
130
+ flags : --config=zig-cc-linux-aarch64 --@v8//bazel/config:v8_target_cpu=arm64
131
+ deps : qemu-user-static libc6-arm64-cross
124
132
- name : ' V8 on macOS/x86_64'
125
133
runtime : ' v8'
126
134
repo : ' v8'
@@ -180,6 +188,10 @@ jobs:
180
188
steps :
181
189
- uses : actions/checkout@v2
182
190
191
+ - name : Install dependencies (Linux)
192
+ if : ${{ matrix.deps != '' && startsWith(matrix.os, 'ubuntu') }}
193
+ run : sudo apt-get install -y ${{ matrix.deps }}
194
+
183
195
- name : Activate Docker/QEMU
184
196
if : startsWith(matrix.run_under, 'docker')
185
197
run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ load ("@bazel-zig-cc//toolchain:defs.bzl" , zig_register_toolchains = "register_toolchains" )
15
16
load ("@com_google_protobuf//:protobuf_deps.bzl" , "protobuf_deps" )
16
17
load ("@proxy_wasm_cpp_host//bazel/cargo/wasmsign:crates.bzl" , "wasmsign_fetch_remote_crates" )
17
18
load ("@proxy_wasm_cpp_host//bazel/cargo/wasmtime:crates.bzl" , "wasmtime_fetch_remote_crates" )
@@ -32,6 +33,8 @@ def proxy_wasm_cpp_host_dependencies():
32
33
version = "1.58.1" ,
33
34
)
34
35
36
+ zig_register_toolchains ()
37
+
35
38
# Core dependencies.
36
39
37
40
protobuf_deps ()
Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ def proxy_wasm_cpp_host_repositories():
29
29
sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d" ,
30
30
)
31
31
32
+ maybe (
33
+ http_archive ,
34
+ name = "bazel-zig-cc" ,
35
+ sha256 = "ad6384b4d16ebb3e5047df6548a195e598346da84e5f320250beb9198705ac81" ,
36
+ strip_prefix = "bazel-zig-cc-v0.4.4" ,
37
+ url = "https://git.sr.ht/~motiejus/bazel-zig-cc/archive/v0.4.4.tar.gz" ,
38
+ )
39
+
32
40
maybe (
33
41
http_archive ,
34
42
name = "rules_foreign_cc" ,
You can’t perform that action at this time.
0 commit comments