brson / miri

An experimental compiler from Rust to WebAssembly (inactive - do not use)
Apache License 2.0
209 stars 15 forks source link

Update code to work with nightly 2016-06-04 #8

Closed badboy closed 8 years ago

badboy commented 8 years ago

I tested this with nightly 2016-06-04. It currently does not work with the latest nightly. Too much changed and some structs are now private. Need to find a way around that (besides ugly transmuting).

I also had to change binaryen to compile to static:

diff --git i/CMakeLists.txt w/CMakeLists.txt
index f3f11d1..28e33e4 100644
--- i/CMakeLists.txt
+++ w/CMakeLists.txt
@@ -98,7 +98,7 @@ SET(binaryen_SOURCES
   src/cfg/Relooper.cpp
   src/wasm.cpp
 )
-ADD_LIBRARY(binaryen SHARED ${binaryen_SOURCES})
+ADD_LIBRARY(binaryen STATIC ${binaryen_SOURCES})
 TARGET_LINK_LIBRARIES(binaryen asmjs ${all_passes} support)

 SET(binaryen-shell_SOURCES
badboy commented 8 years ago

cc @eholk

brson commented 8 years ago

Thanks! cc @kripken

eholk commented 8 years ago

Is there a way to set rustup to fetch a specific nightly version? It'd be nice if rustup udpate just automatically got the right one.

lqd commented 8 years ago

Besides modifying binaryen to compile to a static lib, it also works by changing mir2wasm's build.rs to link dynamically to it, with "dylib=binaryen" instead of "static=binaryen"

badboy commented 8 years ago

@eholk: rustup toolchain install nightly-2016-05-04

brson commented 8 years ago

@eholk There's not yet a way to encode that information in the project's source like with rbenv.