Skip to content

rustc fails to compile to asmjs on Windows #38489

Closed
@cramertj

Description

@cramertj

After following the steps in the "Compiling to the web with Rust and Emscripten" guide, running rustc --target=asmjs-unknown-emscripten hello.rs gives the following output:

λ rustc --target=asmjs-unknown-emscripten hello.rs | clip
error: could not exec the linker `emcc`: The system cannot find the file specified. (os error 2)
  |
  = note: "emcc" "-L" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib" "hello.0.o" "-o" "hello.js" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\libstd-17342542cc541012.rlib" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\librand-46ed9b788a6928f6.rlib" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\libpanic_unwind-f78756b576499725.rlib" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\libcollections-e32369d7fef31fbf.rlib" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\liballoc-24699c1ddb055eb0.rlib" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\liballoc_system-3e467e865c8fa572.rlib" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\libunwind-11f7709e0c71505b.rlib" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\liblibc-60365c932e50e382.rlib" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\librustc_unicode-844a33a197b559a5.rlib" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\libcore-d9873b515905cac5.rlib" "C:\\Users\\crame\\.rustup\\toolchains\\nightly-i686-pc-windows-gnu\\lib\\rustlib\\asmjs-unknown-emscripten\\lib\\libcompiler_builtins-e428224f6caf212a.rlib" "-l" "c" "-s" "ERROR_ON_UNDEFINED_SYMBOLS=1"

error: aborting due to previous error

See emscripten-core/emscripten#4741 for discussion. @juj believes it to be an issue with rustc invoking emcc without enabling shell expansion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-asmjsTarget: asm.js - http://asmjs.org/O-emscriptenTarget: 50% off wasm32-unknown-musl. the savings come out of stdio.h, but hey, you get SDL!O-wasmTarget: WASM (WebAssembly), http://webassembly.org/

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions