Fix: wrong clang path in Bazel toolchain (#699) (#700)

This commit is contained in:
Sébastien Jalliffier Verne
2021-02-07 20:51:36 +01:00
committed by GitHub
parent cfdcf1315b
commit 45cd9dfc0f
4 changed files with 23 additions and 2 deletions

View File

@@ -899,7 +899,7 @@ def _impl(ctx):
"-iwithsysroot" + "/include/c++/v1", "-iwithsysroot" + "/include/c++/v1",
"-iwithsysroot" + "/include/compat", "-iwithsysroot" + "/include/compat",
"-iwithsysroot" + "/include", "-iwithsysroot" + "/include",
"-isystem", "external/emscripten/lib/clang/12.0.0/include", "-isystem", "external/emscripten/lib/clang/13.0.0/include",
], ],
), ),
# Inputs and outputs # Inputs and outputs
@@ -1045,7 +1045,7 @@ def _impl(ctx):
"external/emscripten/emscripten/cache/sysroot/include/c++/v1", "external/emscripten/emscripten/cache/sysroot/include/c++/v1",
"external/emscripten/emscripten/cache/sysroot/include/compat", "external/emscripten/emscripten/cache/sysroot/include/compat",
"external/emscripten/emscripten/cache/sysroot/include", "external/emscripten/emscripten/cache/sysroot/include",
"external/emscripten/lib/clang/12.0.0/include", "external/emscripten/lib/clang/13.0.0/include",
] ]
artifact_name_patterns = [] artifact_name_patterns = []

View File

@@ -6,7 +6,17 @@ cc_binary(
srcs = ["hello-world.cc"], srcs = ["hello-world.cc"],
) )
cc_binary(
name = "hello-world-simd",
srcs = ["hello-world-simd.cc"],
)
wasm_cc_binary( wasm_cc_binary(
name = "hello-world-wasm", name = "hello-world-wasm",
cc_target = ":hello-world", cc_target = ":hello-world",
) )
wasm_cc_binary(
name = "hello-world-wasm-simd",
cc_target = ":hello-world-simd",
)

View File

@@ -0,0 +1,10 @@
#include <wasm_simd128.h>
void multiply_arrays(int* out, int* in_a, int* in_b, int size) {
for (int i = 0; i < size; i += 4) {
v128_t a = wasm_v128_load(&in_a[i]);
v128_t b = wasm_v128_load(&in_b[i]);
v128_t prod = wasm_i32x4_mul(a, b);
wasm_v128_store(&out[i], prod);
}
}

View File

@@ -22,3 +22,4 @@ grep ${HASH} bazel/WORKSPACE || (echo ${FAILMSG} && false)
cd bazel cd bazel
bazel build //hello-world:hello-world-wasm bazel build //hello-world:hello-world-wasm
bazel build --copt="-msimd128" //hello-world:hello-world-wasm-simd