Skip to content

Commit be14b91

Browse files
committed
provide c and c++ compilers for nvptx targets
1 parent 5488007 commit be14b91

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/ci/docker/host-x86_64/test-various/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_T
6060
tests/assembly \
6161
library/core
6262

63-
ENV NVPTX_TARGETS=nvptx64-nvidia-cuda
63+
ENV NVPTX_TARGETS=nvptx64-nvidia-cuda \
64+
CC_nvptx64_nvidia_cuda=clang-11 \
65+
CXX_nvptx64_nvidia_cuda=clang++-11 \
66+
CFLAGS_nvptx64_nvidia_cuda=-flto \
67+
CXXFLAGS_nvptx64_nvidia_cuda=-flto \
6468
ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $NVPTX_TARGETS \
6569
tests/run-make \
6670
tests/assembly

tests/auxiliary/rust_test_helpers.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ float get_c_exhaust_sysv64_ints(
268268
return h.c;
269269
}
270270

271+
// Variadic arguments are broken when using clang to compile nvptx-nvidia-cuda,
272+
// causing clang to ICE. As no test run on CI currently relies on these
273+
// functions, we don't compile them when building for nvptx-nvidia-cuda.
274+
#ifdef __CUDA_ARCH__
275+
271276
// Calculates the average of `(x + y) / n` where x: i64, y: f64. There must be exactly n pairs
272277
// passed as variadic arguments. There are two versions of this function: the
273278
// variadic one, and the one that takes a `va_list`.
@@ -290,6 +295,8 @@ double rust_interesting_average(uint64_t n, ...) {
290295
return sum;
291296
}
292297

298+
#endif
299+
293300
int32_t rust_int8_to_int32(int8_t x) {
294301
return (int32_t)x;
295302
}

0 commit comments

Comments
 (0)