From a8372d6414cd025c5a1c4bc32a7b4c1744b7ee5a Mon Sep 17 00:00:00 2001 From: Petr Bokoc Date: Apr 14 2020 14:44:08 +0000 Subject: Issue 386 - switch mingw32 to dwarf-2 --- diff --git a/modules/release-notes/pages/developers/Development_Tools.adoc b/modules/release-notes/pages/developers/Development_Tools.adoc index 96a73e6..ce273ab 100644 --- a/modules/release-notes/pages/developers/Development_Tools.adoc +++ b/modules/release-notes/pages/developers/Development_Tools.adoc @@ -11,3 +11,20 @@ A new lab called Comp-NeuroFedora has been added to the suite. This change provi For more information about Comp-NeuroFedora, see the link:https://neuro.fedoraproject.org[upstream documentation]. For a list of Fedora labs, see the link:https://labs.fedoraproject.org/[Functional bundles for Fedora] page. + +== Switch mingw32 toolchain to dwarf-2 exceptions + +The `mingw32` toolchain in Fedora 32 uses the `dwarf-2` exception model instead of the previously used `SJLJ`. +Notable differences include: + +* `SJLJ` (`setjmp`/`longjmp`): +** Not "zero-cost": even if an exception isn't thrown, it incurs a minor performance penalty (~15% in exception heavy code). +** Allows exceptions to traverse through e.g. windows callbacks. + +* `DWARF` (`DW2`, `dwarf-2`) +** No permanent runtime overhead. +** needs whole call stack to be `dwarf`-enabled, which means exceptions cannot be thrown over e.g. Windows system DLLs (i.e. throwing an exception in a system DLL callback and attempting to catch it won't work) +** DW2 potentially generates bigger libraries. The overhead however is not big (< 10%) for typical applications. + +The main reason for switching to `dwarf-2` is that Rust can only be compiled to a link:https://github.com/rust-lang/rust/issues/12859#issuecomment-185081071[MinGW toolchain targeting dwarf exceptions on 32-bit], and Rust usage is starting to appear in some packages (i.e. `librsvg2`). +Switching to `dwarf-2` on `mingw32` would hence allow to keep the same consistent package offering between `mingw32` and `mingw64`, whereas otherwise one would need to either freeze the `mingw32` variants at older versions, or remove them altogether.