[GHC] #7056: Relax static-PE linker object checks

GHC ghc-devs at haskell.org
Mon Feb 23 09:40:16 UTC 2015


#7056: Relax static-PE linker object checks
-------------------------------------+-------------------------------------
        Reporter:  songpp            |         Owner:  thoughtpolice
            Type:  bug               |        Status:  new
        Priority:  normal            |     Milestone:  7.12.1
       Component:  GHCi              |       Version:  7.4.1
      Resolution:                    |      Keywords:  loadArchive Unknown
Operating System:  Windows           |  PEi386
 Type of failure:  None/Unknown      |  Architecture:  x86
      Blocked By:                    |     Test Case:
 Related Tickets:  #2487, #7103,     |      Blocking:
  #7889                              |
-------------------------------------+-------------------------------------

Comment (by Austin Seipp <austin@…>):

 In [changeset:"a293925d810229fbea77d95f2b3068e78f8380cc/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="a293925d810229fbea77d95f2b3068e78f8380cc"
 rts/linker: ignore unknown PE sections

 Summary: Currently the linker tries to see if it understands/knows every
 section in the PE file before it continues. If it encounters a section it
 doesn't know about it errors out. Every time there's a change in MinGW
 compiler that adds a new section to the PE file this will break the ghc
 linker. The new sections don't need to be understood by `ghc` to continue
 so instead of erroring out the section is just ignored. When running with
 `-debug` the sections that are ignored will be printed.

 Test Plan:
 See the file `ghcilinkerbug.zip` in #9907.

  1) unzip file content.
  2) open examplecpp.cabal and change base <4.8 to <4.9.
  3) execute cabal file with cabal repl.

 Applying the patch makes `cabal repl` in step 3) work.

 Note that the file will fail on a `___mingw_vprintf` not being found. This
 is because of the `cc-options` specifying `-std=c++0x`, which will also
 require `libmingwex.a` to be linked in but wasn't specified in the cabal
 file. To fix this, remove the `cc-options` which defaults to c99.

 Reviewers: austin

 Reviewed By: austin

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D671

 GHC Trac Issues: #9907, #7103, #10051, #7056, #8546
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7056#comment:26>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list