Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emscripten linking with many dependencies broken on Windows #4862

Closed
Moxinilian opened this issue Dec 24, 2017 · 2 comments
Closed

emscripten linking with many dependencies broken on Windows #4862

Moxinilian opened this issue Dec 24, 2017 · 2 comments

Comments

@Moxinilian
Copy link

Moxinilian commented Dec 24, 2017

Hello.

I have been trying to compile a rather big project for wasm32-unknown-emscripten using cargo on Windows.
Unfortunately, the linking process fails when trying to run emcc.bat because the command line invoked is too long for Windows' limitations (about 8k characters).
error: linking with `emcc.bat` failed: exit code: 1
note: The command line is too long.

After manually counting, the command indeed is too big with in my case about 11k characters, as it includes the absolute path of every single .o and .rlib files. My project, while including piston as a dependency, does not have an incredibly large amount of them, which makes me believe this could be an important issue in the long run (this does not apply to Linux however as the maximum character limit is much higher).
After a little bit of digging, emscripten seems to provide a workaround for this problem by accepting parameters from files. However it has to be handled by the user, that is I believe cargo.

I'm not entirely sure if this issue belongs here as I'm quite new to cargo and how targets work. Sorry if I failed on that matter.

Thanks in advance for your help.

@alexcrichton
Copy link
Member

Thanks for the report! I think that this is a bug for upstream rust-lang/rust though as Cargo isn't invoking emcc.bat, could this be reopened over there?

@Moxinilian
Copy link
Author

Done!
rust-lang/rust#46999
Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants