diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-03-24 19:32:42 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-06 13:01:28 -0400 |
commit | 295c35c5cfda67c11222f99fb338d3cac52abac1 (patch) | |
tree | 291766a1cecec72e1db550a5c6eae6ba3726f0c5 /compiler/GHC/Cmm | |
parent | 3ac80a8609418f9f1e9aa025b182fb3445f14428 (diff) | |
download | haskell-295c35c5cfda67c11222f99fb338d3cac52abac1.tar.gz |
Add a Note describing lack of object merging on Windows
See #21068.
Diffstat (limited to 'compiler/GHC/Cmm')
-rw-r--r-- | compiler/GHC/Cmm/InitFini.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/GHC/Cmm/InitFini.hs b/compiler/GHC/Cmm/InitFini.hs index 2a4a12ed08..6f72d8c1f8 100644 --- a/compiler/GHC/Cmm/InitFini.hs +++ b/compiler/GHC/Cmm/InitFini.hs @@ -49,12 +49,12 @@ and turn them back into a list of CLabels. On Windows initializers/finalizers are a bit tricky due to the inability to merge objects (due to the lld linker's lack of `-r` support on Windows; see -#21068) since we instead must package foreign stubs into static archives. -However, the linker is free to not include any constituent objects of a static -library in the final object code if nothing depends upon them. Consequently, we -must ensure that the initializer list for a module is defined in the module's -object code, not its foreign stubs. This happens naturally with the plan laid -out above. +Note [Object merging] in GHC.Driver.Pipeline.Execute) since we instead must +package foreign stubs into static archives. However, the linker is free to not +include any constituent objects of a static library in the final object code if +nothing depends upon them. Consequently, we must ensure that the initializer +list for a module is defined in the module's object code, not its foreign +stubs. This happens naturally with the plan laid out above. Note that we maintain the invariant that at most one initializer and one finalizer CmmDecl will be emitted per module. |