GHC 8.0.2: use -split-sections
-split-sections replaced -split-objs with following upsides: 1) -split-objs adds considerable overhead to compile time 2) combined with stripping, it causes issues when cross-compiling For upstream see https://ghc.haskell.org/trac/ghc/ticket/8405 This is supported only for Linux/Windows using ld linker. GHC master also turns on -split-sections by default. Example using stack: Without splitting $ du /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2 4 /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2/share/bash-completion/completions 4 /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2/share/bash-completion 4 /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2/share 23416 /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2/bin 23420 /nix/store/5paayhibayr73zqfaj458g4k4mv108jn-stack-1.3.2 With -split-objs $ du /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2 20632 /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2/bin 4 /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2/share/bash-completion/completions 4 /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2/share/bash-completion 4 /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2/share 20636 /nix/store/fypymm529adpx71gdzm0851xz42wdbz0-stack-1.3.2 With -split-sections $ du /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2 4 /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2/share/bash-completion/completions 4 /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2/share/bash-completion 4 /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2/share 20672 /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2/bin 20676 /nix/store/40l6krinx1zx41lr87c4m12hxj4ldf3x-stack-1.3.2 Note: you currently need following overrides to build stack on 802: vector-algorithms = dontCheck super.vector-algorithms; path-io = doJailbreak super.path-io; stack = doJailbreak super.stack; Note: Should also work on GHC 8.0.1, but I'm being careful here. We could backport later on.
parent
83865b2c
Please register or sign in to comment