Skip to content

Commit bf279fd

Browse files
committed
build: Allow building C compiler-rt fallbacks for wasm
1 parent 80ed5f8 commit bf279fd

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ jobs:
9090
- run: rustup component add llvm-tools-preview
9191
- name: Download compiler-rt reference sources
9292
run: |
93-
curl -L -o code.tar.gz https://github.com/rust-lang/llvm-project/archive/rustc/12.0-2021-04-15.tar.gz
94-
tar xzf code.tar.gz --strip-components 1 llvm-project-rustc-12.0-2021-04-15/compiler-rt
93+
curl -L -o code.tar.gz https://github.com/rust-lang/llvm-project/archive/rustc/13.0-2021-08-08.tar.gz
94+
tar xzf code.tar.gz --strip-components 1 llvm-project-rustc-13.0-2021-08-08/compiler-rt
9595
echo RUST_COMPILER_RT_ROOT=./compiler-rt >> $GITHUB_ENV
9696
shell: bash
9797

build.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,10 @@ fn main() {
5656
if !cfg!(feature = "mangled-names") && cfg!(feature = "c") {
5757
// Don't use a C compiler for these targets:
5858
//
59-
// * wasm - clang for wasm is somewhat hard to come by and it's
60-
// unlikely that the C is really that much better than our own Rust.
6159
// * nvptx - everything is bitcode, not compatible with mixed C/Rust
6260
// * riscv - the rust-lang/rust distribution container doesn't have a C
6361
// compiler.
64-
if !target.contains("wasm")
65-
&& !target.contains("nvptx")
66-
&& (!target.starts_with("riscv") || target.contains("xous"))
67-
{
62+
if !target.contains("nvptx") && (!target.starts_with("riscv") || target.contains("xous")) {
6863
#[cfg(feature = "c")]
6964
c::compile(&llvm_target, &target);
7065
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:20.04
22
RUN apt-get update && \
33
apt-get install -y --no-install-recommends \
4-
gcc libc6-dev ca-certificates
4+
gcc clang libc6-dev ca-certificates
55

66
ENV CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=true

ci/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ for rlib in $(echo $path); do
6666
grep -v __x86.get_pc_thunk | \
6767
grep -v __builtin_cl | \
6868
grep -v __builtin_ctz | \
69+
grep -v __builtin_sadd_overflow | \
6970
grep 'T __'
7071

7172
if test $? = 0; then

0 commit comments

Comments
 (0)