Skip to content

Commit cad8ee7

Browse files
committed
ghc: generate relocatable libraries and rts with PIC
1 parent 5333dd8 commit cad8ee7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/ghc/default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ let
139139
'' + lib.optionalString enableRelocatedStaticLibs ''
140140
GhcLibHcOpts += -fPIC
141141
GhcRtsHcOpts += -fPIC
142+
GhcRtsCcOpts += -fPIC
143+
'' + lib.optionalString (enableRelocatedStaticLibs && targetPlatform.isx86_64) ''
144+
GhcLibHcOpts += -fexternal-dynamic-refs
145+
GhcRtsHcOpts += -fexternal-dynamic-refs
142146
'' + lib.optionalString enableDWARF ''
143147
GhcLibHcOpts += -g3
144148
GhcRtsHcOpts += -g3

0 commit comments

Comments
 (0)