From 62c3443e9659be2bf0ae53df1421c846ceaca904 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 18 Oct 2019 14:47:54 -0700 Subject: 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. --- src/librustc_codegen_ssa/back/symbol_export.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/librustc_codegen_ssa') diff --git a/src/librustc_codegen_ssa/back/symbol_export.rs b/src/librustc_codegen_ssa/back/symbol_export.rs index d866a10f069..333af4cd1d7 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(..), .. -- cgit 1.4.1-3-g733a5