diff --git a/README.md b/README.md index 5f59b44..a0e2a29 100644 --- a/README.md +++ b/README.md @@ -306,7 +306,7 @@ These builtins are never called by LLVM. - ~~ctzdi2.c~~ - ~~ctzsi2.c~~ - ~~ctzti2.c~~ -- ~~ffsdi2.c~~ +- ~~ffsdi2.c~~ - this is [called by gcc][jemalloc-fail] though! - ~~ffsti2.c~~ - ~~mulvdi3.c~~ - ~~mulvsi3.c~~ @@ -333,6 +333,8 @@ These builtins are never called by LLVM. - ~~ucmpti2.c~~ - ~~udivmodti4.c~~ +[jemalloc-fail]: https://travis-ci.org/rust-lang/rust/jobs/249772758 + Rust only exposes atomic types on platforms that support them, and therefore does not need to fall back to software implementations. - ~~arm/sync_fetch_and_add_4.S~~ diff --git a/build.rs b/build.rs index 17df4b6..2219645 100644 --- a/build.rs +++ b/build.rs @@ -4095,6 +4095,16 @@ mod c { ], ); + // When compiling in rustbuild (the rust-lang/rust repo) this library + // also needs to satisfy intrinsics that jemalloc or C in general may + // need, so include a few more that aren't typically needed by + // LLVM/Rust. + if env::var_os("CARGO_FEATURE_RUSTBUILD").is_some() { + sources.exend(&[ + "ffsdi2.c", + ]); + } + if target_os != "ios" { sources.extend( &[