Skip to content

WasmSDK is a toolchain for WebAssembly (WASM) with EOSIO specific optimizations

License

Notifications You must be signed in to change notification settings

EOS-Mainnet/eosio.wasmsdk

 
 

Repository files navigation

WasmSDK

Version : 1.0.0

WasmSDK is a toolchain for WebAssembly (WASM). In addition to being a general purpose WebAssembly toolchain, EOSIO specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around Clang 7, which means that the SDK has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete.

New Features from EOSIO

  • Compile (-c) option flag will compile to a WASM-elf object file
  • ranlib and ar support for static libraries for WASM
  • __FILE__ and __BASE_FILE__ will now only return the file name and not the fullpath. This eliminates any non-determinism from location of the compiled binary
  • Global constructors and global destructors are now supported
  • eosio-cpp, eosio-cc, eosio-ld, and eosio-pp are set the core set of tools that you will interact with.
    • These are the C++ compiler, C compiler, linker and postpass tools.
  • A simple CMake interface to build EOSIO smart contracts against WasmSDK
  • ABI generator (Coming Soon)

Guided Installation

First clone

$ git clone --recursive https://github.com/eosio/eosio.wasmsdk
$ cd eosio.wasmsdk

Now run build.sh and give the core symbol for the EOSIO blockchain that intend to deploy to. *build.sh will install any dependencies that are needed.

$ ./build.sh <CORE_SYMBOL>

Finally, install the build *This install will install the core to /usr/local/eosio.wasmsdk and symlinks to the top level tools (compiler, ld, etc.) to /usr/local/bin

$ cd build
$ sudo make install

Manual Installation

WasmSDK requires CMake v3.5+ and Boost 1.67.0 to run.

First clone the repo and create a build directory

$ git clone --recursive https://github.com/eosio/wasmsdk
$ cd wasmsdk
$ mkdir build && cd build

Then configure with cmake to install to /usr/local/eosio.wasmsdk

$ cmake ..

or configure cmake to install to a specific path

$ cmake -DCMAKE_INSTALL_PREFIX=<install path> ..

Then to install, simply

$ make && make install

Installed Tools


  • eosio-cpp
  • eosio-cc
  • eosio-ld
  • eosio-pp (only strips all zeroed initialized data segments for now, currently runs automatically with cpp/cc and ld)
  • eosio-ranlib
  • eosio-ar
  • eosio-objdump
  • eosio-readelf

Usage