Changes between Version 1 and Version 2 of Plugins/ReinitializeGlobals


Ignore:
Timestamp:
Jul 4, 2013 9:56:59 PM (2 years ago)
Author:
nfrisby
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Plugins/ReinitializeGlobals

    v1 v2  
    1919
    2020This mechanism is currently used for some !StaticFlags, some Linker state, and some !DynFlags. I just recently added (partial) support for the !FastString table.
     21
     22=== `DYNAMIC_GHC_PROGRAMS` ===
     23
     24If the ghc executable itself dynamically links against libHSghc, then the entire `reinitializeGlobals` mechanism is unnecessary! In that case, both the host compiler and its plugins link against the dynamic libHSghc, which contains the sole set of mutable global variables.
     25
     26As of commit b7126674 (~mid-March 2013), the ghc executable dynamically loads libHSghc by default. This snippet from `mk/config.mk` shows the default behavior as of 163de25813d12764aa5ded1666af7c06fee0d67e.
     27
     28{{{
     29# Use the dynamic way when building programs in the GHC tree. In
     30# particular, this means that GHCi will use DLLs rather than loading
     31# object files directly.
     32ifeq "$(TargetOS_CPP)" "mingw32"
     33# This doesn't work on Windows yet
     34DYNAMIC_GHC_PROGRAMS = NO
     35else ifeq "$(TargetOS_CPP)" "freebsd"
     36# FreeBSD cannot do proper resolution for $ORIGIN (due to a bug in
     37# rtld(1)), so disable it by default (see #7819).
     38DYNAMIC_GHC_PROGRAMS = NO
     39else ifeq "$(PlatformSupportsSharedLibs)" "NO"
     40DYNAMIC_GHC_PROGRAMS = NO
     41else
     42DYNAMIC_GHC_PROGRAMS = YES
     43endif
     44}}}
     45
     46NB also that the `*-llvm` presents in `build.mk` set `DYNAMIC_GHC_PROGRAMS = NO` as of 163de25813d12764aa5ded1666af7c06fee0d67e (~July 2013).
    2147
    2248=== `FastString.string_table` ===