From 60681d7019b38a5648b5615001ffa55442a64b83 Mon Sep 17 00:00:00 2001 From: Johnnie Birch <45402135+jlb6740@users.noreply.github.com> Date: Thu, 2 Jul 2020 13:13:49 -0700 Subject: [PATCH] Add __dso_handle to exception list of deprecated export symbols When compiling C to WASM with clang-8, __dso_handle is a global that maybe exported but that currently is not whitelisted along with __heap_base and _data_end to be handled as allowable depricated exports. This PR adds the case for __dso_handle. --- crates/wasmtime/src/linker.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/wasmtime/src/linker.rs b/crates/wasmtime/src/linker.rs index 43332216ea..c22b89bf41 100644 --- a/crates/wasmtime/src/linker.rs +++ b/crates/wasmtime/src/linker.rs @@ -445,6 +445,11 @@ impl Linker { // which use --export-dynamic, which unfortunately doesn't work the way // we want it to. warn!("command module exporting '__heap_base' is deprecated"); + } else if export.name() == "__dso_handle" && export.ty().global().is_some() { + // Allow an exported "__dso_handle" memory for compatibility with toolchains + // which use --export-dynamic, which unfortunately doesn't work the way + // we want it to. + warn!("command module exporting '__dso_handle' is deprecated") } else if export.name() == "__rtti_base" && export.ty().global().is_some() { // Allow an exported "__rtti_base" memory for compatibility with // AssemblyScript.