[GHC] #13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)"

#13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)" -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Building current git head in the "BuildFlavour = perf-llvm", the build fails with: {{{ "inplace/bin/ghc-stage1" -o iserv/stage2_p/build/tmp/ghc-iserv-prof -hisuf \ p_hi -osuf p_o -hcsuf p_hc -static -prof -eventlog -O -H64m -fllvm -Wall \ -Werror -hide-all-packages -i -iiserv/src -iiserv/stage2_p/build \ -Iiserv/stage2_p/build -iiserv/stage2_p/build/iserv/autogen \ -Iiserv/stage2_p/build/iserv/autogen \ -optP-include -optPiserv/stage2_p/build/iserv/autogen/cabal_macros.h \ -package-id array-0.5.1.2 -package-id base-4.10.0.0 \ -package-id binary-0.8.4.1 -package-id bytestring-0.10.8.2 \ -package-id containers-0.5.7.1 -package-id deepseq-1.4.3.0 \ -package-id ghci-8.1 -package-id unix-2.7.2.1 -XHaskell2010 \ -threaded -optl-Wl,--export-dynamic -no-hs-main -no-user-package-db \ -rtsopts -Wnoncanonical-monad-instances -odir iserv/stage2_p/build \ -hidir iserv/stage2_p/build -stubdir iserv/stage2_p/build \ -static -prof -eventlog -O -H64m -fllvm -Wall -Werror -hide-all- packages \ -i -iiserv/src -iiserv/stage2_p/build \ -Iiserv/stage2_p/build -iiserv/stage2_p/build/iserv/autogen \ -Iiserv/stage2_p/build/iserv/autogen -optP-include \ -optPiserv/stage2_p/build/iserv/autogen/cabal_macros.h -package-id \ array-0.5.1.2 -package-id base-4.10.0.0 -package-id binary-0.8.4.1 \ -package-id bytestring-0.10.8.2 -package-id containers-0.5.7.1 \ -package-id deepseq-1.4.3.0 -package-id ghci-8.1 -package-id unix-2.7.2.1 \ -XHaskell2010 -threaded -optl-Wl,--export-dynamic -no-hs-main \ -no-user-package-db -rtsopts -Wnoncanonical-monad-instances \ iserv/stage2_p/build/Main.p_o iserv/stage2_p/build/GHCi/Utils.p_o \ iserv/stage2_p/build/cbits/iservmain.p_o Warning: -rtsopts and -with-rtsopts have no effect with -no-hs-main. Call hs_init_ghc() from your main() function to set these options. /usr/bin/ld: iserv/stage2_p/build/tmp/ghc-iserv-prof: Too many sections: 123418 (>= 65280) /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status `gcc' failed in phase `Linker'. (Exit code: 1) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13265 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)" -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by erikd): * failure: None/Unknown => Building GHC failed * version: 8.0.1 => 8.1 * milestone: => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13265#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)" -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by olsner): Which platform/OS was this on, and does it reproduce differently with/without `-fllvm`? If the platform binary format indeed doesn't support many sections we probably just need to tweak the conditions for the `SplitSections` default value. If it's happening on Linux or with ELF, it seems something less trivial is going on. The sections are supposed to get merged when linking an executable, so "support many sections" here is more about doing that merge in the default linker scripts than actually having binary format extensions for >64k sections. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13265#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)" -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by erikd): This is on x86_64/linux. This is specifically about the `BuildFlavour = perf-llvm` so `-fllvm` is not optional. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13265#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)" -------------------------------------+------------------------------------- Reporter: erikd | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler (LLVM) | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * priority: normal => highest * component: Compiler => Compiler (LLVM) Comment: Bumping priority since this utterly breaks the LLVM backend. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13265#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)" -------------------------------------+------------------------------------- Reporter: erikd | Owner: (none) Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler (LLVM) | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Well, for better or worse using gold (by adding `EXTRA_HC_OPTS=-optl--use- ld=gold` to the `make` command line) works fine. It looks like this is probably a BFD `ld` bug. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13265#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)" -------------------------------------+------------------------------------- Reporter: erikd | Owner: rwbarton Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler (LLVM) | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * owner: (none) => rwbarton -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13265#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)" -------------------------------------+------------------------------------- Reporter: erikd | Owner: rwbarton Type: bug | Status: new Priority: highest | Milestone: 8.2.1 Component: Compiler (LLVM) | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3282 Wiki Page: | -------------------------------------+------------------------------------- Changes (by rwbarton): * differential: => Phab:D3282 Comment: The problem is actually that string sections produced by the LLVM backend are not getting merged, and the number of resulting sections was too large for what is apparently an internal limit in `ld.bfd` (`ld.gold` was happy to produce an executable with ~120000 sections). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13265#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)"
-------------------------------------+-------------------------------------
Reporter: erikd | Owner: rwbarton
Type: bug | Status: new
Priority: highest | Milestone: 8.2.1
Component: Compiler (LLVM) | Version: 8.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Building GHC | Unknown/Multiple
failed | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3282
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13265: perf-llvm build fails with "Too many sections: 123418 (>= 65280)" -------------------------------------+------------------------------------- Reporter: erikd | Owner: rwbarton Type: bug | Status: closed Priority: highest | Milestone: 8.2.1 Component: Compiler (LLVM) | Version: 8.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3282 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed Comment: This is resolved by 90009cf62bcebf875e68af625dbdbfc3c2f71717. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13265#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC