forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combined Wasm stats + metadata implementations. (envoyproxy#48)
Stats and Metadata support for WASM.
- Loading branch information
Showing
63 changed files
with
578,651 additions
and
23,132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
all: proxy_wasm_intrinsics.pb.h proxy_wasm_intrinsics_lite.pb.h struct_lite.pb.h | ||
|
||
proxy_wasm_intrinsics.pb.h: proxy_wasm_intrinsics.proto | ||
protoc --cpp_out=. proxy_wasm_intrinsics.proto | ||
|
||
proxy_wasm_intrinsics_lite.pb.h struct_lite.pb.h: proxy_wasm_intrinsics_lite.proto | ||
protoc --cpp_out=. proxy_wasm_intrinsics_lite.proto | ||
protoc --cpp_out=. struct_lite.proto | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CPP_API:=$(shell git rev-parse --show-toplevel)/api/wasm/cpp | ||
|
||
ifdef NO_CONTEXT | ||
CPP_CONTEXT_LIB = | ||
else | ||
CPP_CONTEXT_LIB = ${CPP_API}/proxy_wasm_intrinsics.cc | ||
endif | ||
|
||
%.wasm %.wat: %.cc ${CPP_API}/proxy_wasm_intrinsics.h ${CPP_API}/proxy_wasm_intrinsics.js | ||
em++ -s WASM=1 -s LEGALIZE_JS_FFI=0 -s EMIT_EMSCRIPTEN_METADATA=1 --std=c++17 -O3 -g3 -DEMSCRIPTEN_PROTOBUF_LITE=1 -I${CPP_API} -I${CPP_API}/google/protobuf -I/usr/local/include --js-library ${CPP_API}/proxy_wasm_intrinsics.js $*.cc ${CPP_API}/proxy_wasm_intrinsics_lite.pb.cc ${CPP_API}/struct_lite.pb.cc ${CPP_CONTEXT_LIB} ${CPP_API}/libprotobuf-lite.bc -o $*.js | ||
wavm-disas $*.wasm $*.wat | ||
wavm-compile $*.wasm $*.wasm | ||
rm -f $*.js $*.wast | ||
chmod 644 $*.wat | ||
|
||
clean: | ||
rm *.wasm *.wat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Dependencies for building WASM modules: | ||
|
||
- You must install the version of protobuf on your build system that matches the libprotobuf.bc files (without any patches) so that the generated code matches the .bc library. | ||
Currently this is based on tag v3.6.1 of https://github.com/protocolbuffers/protobuf. | ||
|
||
- If want to rebuild the .bc files or use a different version see the instructions at https://github.com/kwonoj/protobuf-wasm (note: this is pinned to git tag v3.6.1) | ||
A pre-patched repo is available at https://github.com/jplevyak/protobuf branch envoy-wasm |
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.