commercialhaskell / commercialhaskell/stack
split-sections break some packages on windows
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
### General summary/comments
Some packages (e.g. `vulkan` and, previously, `singletons`) fail to build on Windows with split-sections enabled.
Linux builds are okay, and so are split-section-enabled builds with cabal-install.
### Steps to reproduce
1. Clone https://github.com/expipiplus1/vulkan
2. Add flags:
```
ghc-options:
"$everything": -split-sections
```
3. Run `stack build` and wait....
### Expected
Everything is fine and the resulting executables are neatly trimmed.
### Actual
> ld.exe: .stack-work\dist\29cc6475\build\HSvulkan-3.6.7-5HYKA70pwxM7AwbcdTtmo5.o: too many sections (132599)
```
vulkan > [671 of 671] Compiling Vulkan
vulkan > C:\Users\aenor\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.4\lib\../mingw/bin\ld.exe: .stack-work\dist\29cc6475\build\HSvulkan-3.6.7-5HYKA70pwxM7AwbcdTtmo5.o: too many sections (132599)
vulkan > C:\Users\aenor\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.4\lib\../mingw/bin\ld.exe: final link failed: File too big
Progress 72/75
-- While building package vulkan-3.6.7 (scroll up to its section to see the error) using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.4.exe --builddir=.stack-work\dist\29cc6475 build lib:vulkan --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
-- While building package sdl2-2.5.2.0 (scroll up to its section to see the error) using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.4.exe --builddir=.stack-work\dist\29cc6475 build --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
PS C:\src\vulkan>
```
### Stack version
2.5.1, stack upgrade says it's the latest.
### Method of installation
* Official binary, downloaded from stackage.org or fpcomplete's package repository
Contributor guide
Assessment
This issue has not been assessed yet.