about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/back/symbol_export.rs
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-10-29 12:01:38 -0700
committerGitHub <noreply@github.com>2019-10-29 12:01:38 -0700
commit8aa23125bb40f6949fcd2c4f48151c4d8a444419 (patch)
tree9078d6ef80abe9bd3f999b901bb8da7d0d8fc620 /src/librustc_codegen_ssa/back/symbol_export.rs
parentc4960c26027b6556aa5a63bc4a2c5697cf904e75 (diff)
parent92c049be583a559430f17f3364c616fc92c059a1 (diff)
downloadrust-8aa23125bb40f6949fcd2c4f48151c4d8a444419.tar.gz
rust-8aa23125bb40f6949fcd2c4f48151c4d8a444419.zip
Rollup merge of #65832 - tlively:emscripten-exception-handling, r=alexcrichton
Re-enable Emscripten's exception handling support

Passes LLVM codegen and Emscripten link-time flags for exception
handling if and only if the panic strategy is `unwind`. Sets the
default panic strategy for Emscripten targets to `unwind`. Re-enables
tests that depend on unwinding support for Emscripten, including
`should_panic` tests.

r? @alexcrichton
Diffstat (limited to 'src/librustc_codegen_ssa/back/symbol_export.rs')
-rw-r--r--src/librustc_codegen_ssa/back/symbol_export.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_codegen_ssa/back/symbol_export.rs b/src/librustc_codegen_ssa/back/symbol_export.rs
index 9443f225723..85a90459f5e 100644
--- a/src/librustc_codegen_ssa/back/symbol_export.rs
+++ b/src/librustc_codegen_ssa/back/symbol_export.rs
@@ -364,8 +364,9 @@ fn symbol_export_level(tcx: TyCtxt<'_>, sym_def_id: DefId) -> SymbolExportLevel
         codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL);
 
     if is_extern && !std_internal {
-        // Emscripten cannot export statics, so reduce their export level here
-        if tcx.sess.target.target.options.is_like_emscripten {
+        let target = &tcx.sess.target.target.llvm_target;
+        // WebAssembly cannot export data symbols, so reduce their export level
+        if target.contains("wasm32") || target.contains("emscripten") {
             if let Some(Node::Item(&hir::Item {
                 kind: hir::ItemKind::Static(..),
                 ..