summaryrefslogtreecommitdiff
path: root/src/s2wasm-main.cpp
diff options
context:
space:
mode:
authorJF Bastien <jfb@chromium.org>2016-01-27 18:35:11 -0800
committerJF Bastien <jfb@chromium.org>2016-01-27 20:48:45 -0800
commit9ced7de31c9317f2c9ad579bb6c7ff466741b968 (patch)
tree39b3100fc08cb627d262695e150352d159bf12ed /src/s2wasm-main.cpp
parentdbe29fc629356ca5abdfeeaf0da573b1208eb3de (diff)
downloadbinaryen-9ced7de31c9317f2c9ad579bb6c7ff466741b968.tar.gz
binaryen-9ced7de31c9317f2c9ad579bb6c7ff466741b968.tar.bz2
binaryen-9ced7de31c9317f2c9ad579bb6c7ff466741b968.zip
Add s2wasm option to ignore unknown symbols
This is useful for bringup.
Diffstat (limited to 'src/s2wasm-main.cpp')
-rw-r--r--src/s2wasm-main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/s2wasm-main.cpp b/src/s2wasm-main.cpp
index 2ef8060ac..c3f3d0a2f 100644
--- a/src/s2wasm-main.cpp
+++ b/src/s2wasm-main.cpp
@@ -27,6 +27,7 @@ using namespace cashew;
using namespace wasm;
int main(int argc, const char *argv[]) {
+ bool ignoreUnknownSymbols = false;
Options options("s2wasm", "Link .s file into .wast");
options
.add("--output", "-o", "Output file (stdout if not specified)",
@@ -35,6 +36,11 @@ int main(int argc, const char *argv[]) {
o->extra["output"] = argument;
Colors::disable();
})
+ .add("--ignore-unknown", "", "Ignore unknown symbols",
+ Options::Arguments::Zero,
+ [&ignoreUnknownSymbols](Options *, const std::string &) {
+ ignoreUnknownSymbols = true;
+ })
.add("--global-base", "-g", "Where to start to place globals",
Options::Arguments::One,
[](Options *o, const std::string &argument) {
@@ -54,7 +60,8 @@ int main(int argc, const char *argv[]) {
? std::stoull(options.extra["global-base"])
: 1;
if (options.debug) std::cerr << "Global base " << globalBase << '\n';
- S2WasmBuilder s2wasm(wasm, input.c_str(), options.debug, globalBase);
+ S2WasmBuilder s2wasm(wasm, input.c_str(), options.debug, globalBase,
+ ignoreUnknownSymbols);
if (options.debug) std::cerr << "Emscripten gluing..." << std::endl;
std::stringstream meta;