tshort / LLVMBuilder

BinaryBuilder repository for LLVM
MIT License
0 stars 0 forks source link

WebAssembly version of LLVM #1

Open tshort opened 5 years ago

tshort commented 5 years ago

@keno, @SimonDanisch, @staticfloat,

I've compiled base LLVM libraries with Emscripten to WebAssembly-compatible libraries. See here for the tgz release.

It was built using a WebAssembly platform within BinaryBuilder. Here's the build script. Be warned that the build script is a pretty hacked-up version of Elliot's original. I needed one small path to compile the base libraries. make didn't produce a libLLVM.so--I'm not sure why. The main library files look like they are there.

These results may help get Julia (with codegen) running in the browser.

tshort commented 5 years ago

This issue is really just a placeholder for discussion related to WebAssembly / LLVM / codegen.

Keno commented 5 years ago

FWIW, was able to successfully link to the tarballs above. Do you think you could also look into adjusting the julia base build scripts for LLVM to allow cross compiling for wasm?

tshort commented 5 years ago

I'll look into the Julia base build scripts, @Keno.

tshort commented 5 years ago

@Keno, I think the best way to handle the Julia build scripts is to use USE_BINARYBUILDER_LLVM=1. With the following in Make.user, make -C deps install-llvm seems to work.

USE_BINARYBUILDER_LLVM=1
BINARYBUILDER_TRIPLET=wasm32-unknown-emscripten
override LLVM_BB_URL_BASE := https://github.com/tshort/LLVMBuilder/releases/download
override LLVM_BB_REL = 0-wasm

I think this approach fits in with Elliot's world domination plans :). Eventually, we'll want to get the wasm build of LLVM integrated into Elliot's main repo.

tshort commented 5 years ago

For a BLAS in WebAssembly, BLIS looks like a decent option. It's easy to build with Emscripten. See BlisBuilder for a version compiled to WebAssembly IR with BinaryBuilder. (I don't know if the compiled library works.)