Closed
Description
It looks like the CI of stdarch started failing recently. Bisection shows that this is caused by #76896. That PR looks relatively innocuous on the surface, however, so this may be a longstanding bug in wasm simd just uncovered by that. I wanted to open this to track the regression nonetheless.
The regression can be reproduced with:
#![feature(wasm_simd)]
use std::arch::wasm32::*;
fn main() {
unsafe {
i8x16_splat(3);
}
}
compiled as:
$ rustc +937f629535f38c655267f1ed21ce6830f592f5df foo.rs --target wasm32-wasi
$ rustc +ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09 foo.rs --target wasm32-wasi
error: linking with `rust-lld` failed: exit code: 1
|
= note: "rust-lld" "-flavor" "wasm" "--rsp-quoting=posix" "-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--fatal-warnings" "--no-demangle" "--export-dynamic" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/self-contained/crt1.o" "-L" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib" "-L" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/self-contained" "foo.foo.7rcbfp3g-cgu.0.rcgu.o" "foo.foo.7rcbfp3g-cgu.1.rcgu.o" "foo.foo.7rcbfp3g-cgu.2.rcgu.o" "foo.foo.7rcbfp3g-cgu.3.rcgu.o" "foo.foo.7rcbfp3g-cgu.4.rcgu.o" "foo.foo.7rcbfp3g-cgu.5.rcgu.o" "foo.foo.7rcbfp3g-cgu.6.rcgu.o" "foo.foo.7rcbfp3g-cgu.7.rcgu.o" "-o" "foo.wasm" "--export" "main" "--export=__heap_base" "--export=__data_end" "foo.belfx9afw9cmv8.rcgu.o" "--gc-sections" "-O0" "-L" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/libstd-2010bfb86c99e0e4.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/libpanic_abort-7348bc04167f63d3.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/libwasi-b975e015f92454fb.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/librustc_demangle-2b4cf7f6f61445f6.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/libhashbrown-8206246a130f07b8.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/librustc_std_workspace_alloc-28243a9ec9a229cb.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/libunwind-621a353e76ed269f.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/libcfg_if-d5b91ddbada25475.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/liblibc-f4106e9d51b181bb.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/liballoc-2c1504d1aff4027c.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/librustc_std_workspace_core-efa7ae18cfea5213.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/libcore-d162792e302a9836.rlib" "/Users/acrichton/.rustup/toolchains/ddf2cc7f8eb34f1a63b491d6a52e3e8208393c09/lib/rustlib/wasm32-wasi/lib/libcompiler_builtins-000d51a42ac2122c.rlib"
= note: rust-lld: error: function signature mismatch: _ZN4core9core_arch4simd5i8x165splat17h1e05c24c8cf9897dE
>>> defined as (i32) -> v128 in foo.foo.7rcbfp3g-cgu.2.rcgu.o
>>> defined as (i32, i32) -> void in foo.foo.7rcbfp3g-cgu.7.rcgu.o
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
alexcrichton commentedon Jan 11, 2021
Ok after some more debugging I think #76896 is indeed at fault. After reading that PR more closely it looks like it only changes the behavior of
inline(always)
in debug mode, which indeed has been known to break SIMD-related things in the past.Rollup merge of rust-lang#80922 - spastorino:revert-inline-always-in-…
alexcrichton commentedon Feb 17, 2021
I think the relevant PR was reverted so closing.