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

llc crashes linking gfx-rs under emscripten #47023

Open
kvark opened this issue Dec 26, 2017 · 2 comments

Comments

@kvark
Copy link
Contributor

commented Dec 26, 2017

Looks very similar to #37952 (cc @alexcrichton @s3bk):

Compiling gfx_app v0.8.0 (file:///home/kvark/Code/gfx)
*** Error in /home/kvark/Code/ems/fastcomp/build/bin/llc': munmap_chunk(): invalid pointer: 0x0000000009984ab8 *** error: linking with emcc` failed: exit code: 1

Rust versions tested:

  • "rustc 1.22.1 (05e2e1c 2017-11-22)"
  • "rustc 1.24.0-nightly (edbd7d2 2017-12-20)"

Repro steps:

git clone https://github.com/kvark/gfx -b emscripten
cd gfx
cargo build --example cube --target wasm32-unknown-emscripten

Full log: https://gist.github.com/kvark/6a0189727e67dbc950c4a140eae9646d

@nstoddard

This comment has been minimized.

Copy link

commented Dec 28, 2017

Does this also happen if you enable -O2 or above? I've seen something similar which went away when I enabled optimization. This might let you work around this issue until it's fixed.

@kvark

This comment has been minimized.

Copy link
Contributor Author

commented Dec 29, 2017

@nstoddard you saved my day! Building with --release seems to work so far 👍 (as a workaround)

bors bot added a commit to gfx-rs/gfx that referenced this issue Dec 29, 2017

Merge #1706
1706: More Emscripten support r=msiglreith a=kvark

## Intro
This is a big follow-up to #1681 and #1685

After being blocked by rust-lang/rust#47023, I got stuff building in release, so continued porting the examples over. Note: there is a lot of shader code duplication, we need some (simple) templating/preprocessor there.

## Environment

OS: Linux + Firefox Nightly,

Emscripten: built from source with the following changes:
  - integrated emscripten-core/emscripten#5951
  - `USE_WEBGL2=1` is forcefully set in "settings.js"

## Status

🎉 Work 🎉 : triangle, cube, flowmap, blend, gamma, terrain, ubo_tilemap

Almost works: mipmap - see #1704

Not tested: deferred (too many shaders!), performance

Blocked by the lack of buffer mapping: instancing

Blocked by the lack of geometry/tessellation shader support: particle, render_target, terrain_tessellated

Fail to run: shadow, skybox - see #1705

## Proof
![gfx-emscripten-ubo_tilemap](https://user-images.githubusercontent.com/107301/34429974-5e6678d8-ec2d-11e7-91c7-2e4f3746e416.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.