forked from wavewave/nix-build-ghc-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enable-fPIC.patch
28 lines (28 loc) · 1.63 KB
/
enable-fPIC.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff -rupN a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
--- a/compiler/main/DynFlags.hs 2015-07-21 13:52:57.000000000 +0000
+++ b/compiler/main/DynFlags.hs 2015-09-19 10:12:13.314277103 +0000
@@ -4138,15 +4138,15 @@ makeDynFlagsConsistent dflags
= let dflags' = dflags { hscTarget = HscLlvm }
warn = "No native code generator, so using LLVM"
in loop dflags' warn
- | hscTarget dflags == HscLlvm &&
- not ((arch == ArchX86_64) && (os == OSLinux || os == OSDarwin || os == OSFreeBSD)) &&
- not ((isARM arch) && (os == OSLinux)) &&
- (not (gopt Opt_Static dflags) || gopt Opt_PIC dflags)
- = if cGhcWithNativeCodeGen == "YES"
- then let dflags' = dflags { hscTarget = HscAsm }
- warn = "Using native code generator rather than LLVM, as LLVM is incompatible with -fPIC and -dynamic on this platform"
- in loop dflags' warn
- else throwGhcException $ CmdLineError "Can't use -fPIC or -dynamic on this platform"
+--- | hscTarget dflags == HscLlvm &&
+-- not ((arch == ArchX86_64) && (os == OSLinux || os == OSDarwin || os == OSFreeBSD)) &&
+-- not ((isARM arch) && (os == OSLinux)) &&
+-- (not (gopt Opt_Static dflags) || gopt Opt_PIC dflags)
+-- = if cGhcWithNativeCodeGen == "YES"
+-- then let dflags' = dflags { hscTarget = HscAsm }
+-- warn = "Using native code generator rather than LLVM, as LLVM is incompatible with -fPIC and -dynamic on this platform"
+-- in loop dflags' warn
+-- else throwGhcException $ CmdLineError "Can't use -fPIC or -dynamic on this platform"
| os == OSDarwin &&
arch == ArchX86_64 &&
not (gopt Opt_PIC dflags)