[GHC] #15934: Building ghc with dwarf information and profiling libraries fails on windows.

#15934: Building ghc with dwarf information and profiling libraries fails on windows. ----------------------------------------+--------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.6.2 Keywords: | Operating System: Windows Architecture: Unknown/Multiple | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ----------------------------------------+--------------------------------- Seems like we create too many sections in a single file on windows. {{{ C://ghc//msys64//home//Andi//ghc_head//inplace//mingw//bin/as.exe: C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o: too many sections (32801) C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_1.s: Assembler messages: C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_1.s: Fatal error: can't write 4 bytes to section .rdata$c1w2b_str of C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o because: 'File too big' C://ghc//msys64//home//Andi//ghc_head//inplace//mingw//bin/as.exe: C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o: too many sections (32801) C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_1.s: Fatal error: can't close C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o: File too big `gcc.exe' failed in phase `Assembler'. (Exit code: 1) make[1]: *** [libraries/template-haskell/ghc.mk:4: libraries/template- haskell/dist-install/build/Language/Haskell/TH/Syntax.p_o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:128: all] Error 2 }}} build.mk {{{ ifneq "$(BuildFlavour)" "" include mk/flavours/$(BuildFlavour).mk endif GhcLibHcOpts += -g1 GhcRtsHcOpts += -g1 # GhcStage2HcOpts += -g3 BUILD_PROF_LIBS=YES # Don't strip debug and other unneeded symbols from libraries and executables. STRIP_CMD = : HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PDF = NO BUILD_MAN = NO }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15934 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15934: Building ghc with dwarf information and profiling libraries fails on windows. ---------------------------------+---------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by AndreasK): Not actively looking into this but there might be flags to make this work without big issues. See: * https://sourceware.org/ml/binutils/2014-03/msg00114.html * https://stackoverflow.com/questions/16596876/object-file-has-too-many- sections -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15934#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15934: Building ghc with profiling libraries fails on windows. ---------------------------------+---------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.3 Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by AndreasK): * priority: normal => high Old description:
Seems like we create too many sections in a single file on windows.
{{{ C://ghc//msys64//home//Andi//ghc_head//inplace//mingw//bin/as.exe: C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o: too many sections (32801) C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_1.s: Assembler messages: C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_1.s: Fatal error: can't write 4 bytes to section .rdata$c1w2b_str of C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o because: 'File too big' C://ghc//msys64//home//Andi//ghc_head//inplace//mingw//bin/as.exe: C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o: too many sections (32801) C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_1.s: Fatal error: can't close C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o: File too big `gcc.exe' failed in phase `Assembler'. (Exit code: 1) make[1]: *** [libraries/template-haskell/ghc.mk:4: libraries/template- haskell/dist-install/build/Language/Haskell/TH/Syntax.p_o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:128: all] Error 2 }}}
build.mk {{{ ifneq "$(BuildFlavour)" "" include mk/flavours/$(BuildFlavour).mk endif
GhcLibHcOpts += -g1 GhcRtsHcOpts += -g1 # GhcStage2HcOpts += -g3
BUILD_PROF_LIBS=YES
# Don't strip debug and other unneeded symbols from libraries and executables. STRIP_CMD = :
HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PDF = NO BUILD_MAN = NO
}}}
New description: I've initially only hit this when enabling -g, but now I've run into the same issue without a customized build.mk file. ---- Seems like we create too many sections in a single file on windows. {{{ C://ghc//msys64//home//Andi//ghc_head//inplace//mingw//bin/as.exe: C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o: too many sections (32801) C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_1.s: Assembler messages: C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_1.s: Fatal error: can't write 4 bytes to section .rdata$c1w2b_str of C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o because: 'File too big' C://ghc//msys64//home//Andi//ghc_head//inplace//mingw//bin/as.exe: C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o: too many sections (32801) C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_1.s: Fatal error: can't close C:\\ghc\\msys64\\tmp\\ghc6664_0\\ghc_6.p_o: File too big `gcc.exe' failed in phase `Assembler'. (Exit code: 1) make[1]: *** [libraries/template-haskell/ghc.mk:4: libraries/template- haskell/dist-install/build/Language/Haskell/TH/Syntax.p_o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:128: all] Error 2 }}} build.mk {{{ ifneq "$(BuildFlavour)" "" include mk/flavours/$(BuildFlavour).mk endif GhcLibHcOpts += -g1 GhcRtsHcOpts += -g1 # GhcStage2HcOpts += -g3 BUILD_PROF_LIBS=YES # Don't strip debug and other unneeded symbols from libraries and executables. STRIP_CMD = : HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO BUILD_SPHINX_PDF = NO BUILD_MAN = NO }}} -- Comment: Update: I've had this just happen even with debugging information disabled. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15934#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15934: Building ghc with profiling libraries fails on windows. ---------------------------------+---------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.3 Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by bgamari): * priority: high => highest Comment: Apparently full builds of `master` currently break on Windows due to this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15934#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15934: Building ghc with profiling libraries fails on windows. ---------------------------------+---------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.3 Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by bgamari): Andreas reports that, as suggested on StackOverflow, passing `-mbig-obj` to the assembler helps. However, things then fail at linking. I believe this will be fixed by passing `--oformat pe-bigobj-x86-64` to the linker, although this hasn't been confirmed yet. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15934#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15934: Building ghc with profiling libraries fails on windows. ---------------------------------+---------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.6.3 Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by bgamari): It sounds like the linker change worked as well. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15934#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15934: Building ghc with profiling libraries fails on windows. ---------------------------------+---------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: patch Priority: highest | Milestone: 8.6.3 Component: Compiler | Version: 8.6.2 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5383 Wiki Page: | ---------------------------------+---------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D5383 Comment: So it seems that the bigobj format isn't support on 32-bit Windows, so there isn't much we can do there. However, Phab:D5383 should fix the issue on amd64. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15934#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15934: Building ghc with profiling libraries fails on windows.
---------------------------------+----------------------------------------
Reporter: AndreasK | Owner: (none)
Type: bug | Status: patch
Priority: highest | Milestone: 8.6.3
Component: Compiler | Version: 8.6.2
Resolution: | Keywords:
Operating System: Windows | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5383
Wiki Page: |
---------------------------------+----------------------------------------
Comment (by Ben Gamari

#15934: Building ghc with profiling libraries fails on windows. ---------------------------------+---------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: closed Priority: highest | Milestone: 8.6.3 Component: Compiler | Version: 8.6.2 Resolution: fixed | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5383 Wiki Page: | ---------------------------------+---------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: Merged with ed86e3b531322f74d2c2d00d7ff8662b08fabde6. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15934#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC