summaryrefslogtreecommitdiff
path: root/src/tools/wasm-emscripten-finalize.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-10-29 11:44:20 -0700
committerGitHub <noreply@github.com>2020-10-29 11:44:20 -0700
commit76f5b362bfc2665196048f8d811f259614db0072 (patch)
tree79f25c01419f8dc613f8c9ca6ebcc75b1838238a /src/tools/wasm-emscripten-finalize.cpp
parent8cd3ad23543b1e6d0c8e5f8a1563ca5f87960645 (diff)
downloadbinaryen-76f5b362bfc2665196048f8d811f259614db0072.tar.gz
binaryen-76f5b362bfc2665196048f8d811f259614db0072.tar.bz2
binaryen-76f5b362bfc2665196048f8d811f259614db0072.zip
Remove support for emscripten legacy PIC ABI (#3299)
Diffstat (limited to 'src/tools/wasm-emscripten-finalize.cpp')
-rw-r--r--src/tools/wasm-emscripten-finalize.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/tools/wasm-emscripten-finalize.cpp b/src/tools/wasm-emscripten-finalize.cpp
index ecf10119d..d76bd4fc9 100644
--- a/src/tools/wasm-emscripten-finalize.cpp
+++ b/src/tools/wasm-emscripten-finalize.cpp
@@ -51,7 +51,6 @@ int main(int argc, const char* argv[]) {
bool debugInfo = false;
bool DWARF = false;
bool sideModule = false;
- bool legacyPIC = true;
bool legalizeJavaScriptFFI = true;
bool bigInt = false;
bool checkStackOverflow = false;
@@ -114,9 +113,7 @@ int main(int argc, const char* argv[]) {
"",
"Use new/llvm PIC abi",
Options::Arguments::Zero,
- [&legacyPIC](Options* o, const std::string& argument) {
- legacyPIC = false;
- })
+ [&](Options* o, const std::string& argument) {})
.add("--input-source-map",
"-ism",
"Consume source map from the specified file",
@@ -281,14 +278,6 @@ int main(int argc, const char* argv[]) {
passRunner.add("stack-check");
}
- if (legacyPIC) {
- if (sideModule) {
- passRunner.add("emscripten-pic");
- } else {
- passRunner.add("emscripten-pic-main-module");
- }
- }
-
if (!noDynCalls && !standaloneWasm) {
// If not standalone wasm then JS is relevant and we need dynCalls.
if (onlyI64DynCalls) {
@@ -318,20 +307,13 @@ int main(int argc, const char* argv[]) {
if (sideModule) {
BYN_TRACE("finalizing as side module\n");
- generator.generatePostInstantiateFunction();
+ // The emscripten PIC ABI still expects a function named
+ // __post_instantiate to be exported by side module.
+ if (auto* e = wasm.getExportOrNull(WASM_CALL_CTORS)) {
+ e->name = "__post_instantiate";
+ }
} else {
BYN_TRACE("finalizing as regular module\n");
- if (legacyPIC) {
- // For side modules these gets called via __post_instantiate
- if (Function* F = wasm.getFunctionOrNull(ASSIGN_GOT_ENTRIES)) {
- auto* ex = new Export();
- ex->value = F->name;
- ex->name = F->name;
- ex->kind = ExternalKind::Function;
- wasm.addExport(ex);
- initializerFunctions.push_back(F->name);
- }
- }
// Costructors get called from crt1 in wasm standalone mode.
// Unless there is no entry point.
if (!standaloneWasm || !wasm.getExportOrNull("_start")) {