diff options
| author | Joachim Breitner <mail@joachim-breitner.de> | 2014-12-08 20:47:07 +0300 |
|---|---|---|
| committer | Joachim Breitner <mail@joachim-breitner.de> | 2014-12-08 20:47:07 +0300 |
| commit | 0635a35e3e15023758b23bf577cb3eeae6c2cd87 (patch) | |
| tree | 0882bf3c36f82e9912fae475577d0b8b937d5329 /p/ghc | |
| parent | c7a80e23413ac6a8d27cfd677ca86315fc419e38 (diff) | |
| download | DHG_packages-0635a35e3e15023758b23bf577cb3eeae6c2cd87.tar.gz | |
ghc: * Apply patches taken from GHC HEAD that help building on ARM
- always_build_arm_spinlocks.patch
- dll-split-fix.patch
- linker-detection-fix
Diffstat (limited to 'p/ghc')
| -rw-r--r-- | p/ghc/debian/changelog | 9 | ||||
| -rw-r--r-- | p/ghc/debian/patches/always_build_arm_spinlocks.patch | 69 | ||||
| -rw-r--r-- | p/ghc/debian/patches/dll-split-fix.patch | 192 | ||||
| -rw-r--r-- | p/ghc/debian/patches/linker-detection-fix | 40 | ||||
| -rw-r--r-- | p/ghc/debian/patches/series | 3 |
5 files changed, 313 insertions, 0 deletions
diff --git a/p/ghc/debian/changelog b/p/ghc/debian/changelog index 125ab5062..0e7d9bb48 100644 --- a/p/ghc/debian/changelog +++ b/p/ghc/debian/changelog @@ -1,3 +1,12 @@ +ghc (7.8.20141119-7) UNRELEASED; urgency=medium + + * Apply patches taken from GHC HEAD that help building on ARM + - always_build_arm_spinlocks.patch + - dll-split-fix.patch + - linker-detection-fix + + -- Joachim Breitner <nomeata@debian.org> Mon, 08 Dec 2014 18:46:19 +0100 + ghc (7.8.20141119-6) experimental; urgency=medium * According to Ben Gamari, the flag is -optl-B..., not -optc-B... diff --git a/p/ghc/debian/patches/always_build_arm_spinlocks.patch b/p/ghc/debian/patches/always_build_arm_spinlocks.patch new file mode 100644 index 000000000..31acb911d --- /dev/null +++ b/p/ghc/debian/patches/always_build_arm_spinlocks.patch @@ -0,0 +1,69 @@ +commit e42f158ddc7b4d1d2ca41bd62fc9432030889ac7 +Author: Joachim Breitner <mail@joachim-breitner.de> +Date: Mon Dec 8 18:37:52 2014 +0100 + + Link pre-ARMv6 spinlocks into all RTS variants + + Summary: + For compatibility with ARM machines from pre v6, the RTS provides + implementations of certain atomic operations. Previously, these + were only included in the threaded RTS. + + But ghc (the library) contains the code in compiler/cbits/genSym.c, which + uses these operations if there is more than one capability. But there is only + one libHSghc, so the linker wants to resolve these symbols in every case. + + By providing these operations in all RTSs, the linker is happy. The only + downside is a small amount of dead code in the non-threaded RTS on old ARM + machines. + + Test Plan: It helped here. + + Reviewers: bgamari, austin + + Subscribers: carter, thomie + + Differential Revision: https://phabricator.haskell.org/D564 + + GHC Trac Issues: #8951 + +Index: ghc-7.8.3.20141119/includes/stg/SMP.h +=================================================================== +--- ghc-7.8.3.20141119.orig/includes/stg/SMP.h 2014-12-08 18:44:25.438412602 +0100 ++++ ghc-7.8.3.20141119/includes/stg/SMP.h 2014-12-08 18:44:25.434412386 +0100 +@@ -14,13 +14,13 @@ + #ifndef SMP_H + #define SMP_H + +-#if defined(THREADED_RTS) +- + #if arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv6) + void arm_atomic_spin_lock(void); + void arm_atomic_spin_unlock(void); + #endif + ++#if defined(THREADED_RTS) ++ + /* ---------------------------------------------------------------------------- + Atomic operations + ------------------------------------------------------------------------- */ +Index: ghc-7.8.3.20141119/rts/OldARMAtomic.c +=================================================================== +--- ghc-7.8.3.20141119.orig/rts/OldARMAtomic.c 2014-12-08 18:44:25.438412602 +0100 ++++ ghc-7.8.3.20141119/rts/OldARMAtomic.c 2014-12-08 18:44:32.678806807 +0100 +@@ -14,8 +14,6 @@ + #include <sched.h> + #endif + +-#if defined(THREADED_RTS) +- + #if arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv6) + + static volatile int atomic_spin = 0; +@@ -51,6 +49,3 @@ + } + + #endif /* arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv6) */ +- +-#endif /* defined(THREADED_RTS) */ +- diff --git a/p/ghc/debian/patches/dll-split-fix.patch b/p/ghc/debian/patches/dll-split-fix.patch new file mode 100644 index 000000000..6e33dffde --- /dev/null +++ b/p/ghc/debian/patches/dll-split-fix.patch @@ -0,0 +1,192 @@ +commit 2a8ea4745d6ff79d6ce17961a64d9013243fc3c6 +Author: Sergei Trofimovich <slyfox@gentoo.org> +Date: Sat Oct 4 20:48:22 2014 +0100 + + ghc.mk: fix list for dll-split on GHCi-less builds + + To reproduce build failure it's enough to try + to build GHC on amd64 with the following setup: + + $ cat mk/build.mk + # for #9552 + GhcWithInterpreter = NO + + It gives: + + Reachable modules from DynFlags out of date + Please fix compiler/ghc.mk, or building DLLs on Windows may break (#7780) + Redundant modules: Bitmap BlockId ... <list of 42 modules> + <make error> + + dll-split among other things makes sure + all mentioned modules are used by DynFlags. + '#ifdef GHCI' keeps is from happening. + + Patch moves those 42 modules under + 'GhcWithInterpreter' guard. + + Fixes Issue #9552 + + Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> + +Index: ghc-7.8.3.20141119/compiler/ghc.mk +=================================================================== +--- ghc-7.8.3.20141119.orig/compiler/ghc.mk 2014-12-08 18:45:43.683249077 +0100 ++++ ghc-7.8.3.20141119/compiler/ghc.mk 2014-12-08 18:45:43.683249077 +0100 +@@ -461,36 +461,15 @@ + BasicTypes \ + BinIface \ + Binary \ +- Bitmap \ +- BlockId \ + BooleanFormula \ + BreakArray \ + BufWrite \ + BuildTyCl \ +- ByteCodeAsm \ +- ByteCodeInstr \ +- ByteCodeItbls \ +- CLabel \ + Class \ + CmdLineParser \ +- Cmm \ +- CmmCallConv \ +- CmmExpr \ +- CmmInfo \ +- CmmMachOp \ +- CmmNode \ + CmmType \ +- CmmUtils \ + CoAxiom \ + ConLike \ +- CodeGen.Platform \ +- CodeGen.Platform.ARM \ +- CodeGen.Platform.NoRegs \ +- CodeGen.Platform.PPC \ +- CodeGen.Platform.PPC_Darwin \ +- CodeGen.Platform.SPARC \ +- CodeGen.Platform.X86 \ +- CodeGen.Platform.X86_64 \ + Coercion \ + Config \ + Constants \ +@@ -514,7 +493,6 @@ + Exception \ + ExtsCompat46 \ + FamInstEnv \ +- FastBool \ + FastFunctions \ + FastMutInt \ + FastString \ +@@ -524,8 +502,6 @@ + FiniteMap \ + ForeignCall \ + Hooks \ +- Hoopl \ +- Hoopl.Dataflow \ + HsBinds \ + HsDecls \ + HsDoc \ +@@ -544,14 +520,12 @@ + IfaceSyn \ + IfaceType \ + InstEnv \ +- InteractiveEvalTypes \ + Kind \ + ListSetOps \ + Literal \ + LoadIface \ + Maybes \ + MkCore \ +- MkGraph \ + MkId \ + Module \ + MonadUtils \ +@@ -571,9 +545,6 @@ + PipelineMonad \ + Platform \ + PlatformConstants \ +- PprCmm \ +- PprCmmDecl \ +- PprCmmExpr \ + PprCore \ + PrelInfo \ + PrelNames \ +@@ -581,23 +552,10 @@ + Pretty \ + PrimOp \ + RdrName \ +- Reg \ +- RegClass \ + Rules \ +- SMRep \ + Serialized \ + SrcLoc \ + StaticFlags \ +- StgCmmArgRep \ +- StgCmmClosure \ +- StgCmmEnv \ +- StgCmmLayout \ +- StgCmmMonad \ +- StgCmmProf \ +- StgCmmTicky \ +- StgCmmUtils \ +- StgSyn \ +- Stream \ + StringBuffer \ + TcEvidence \ + TcIface \ +@@ -621,6 +579,54 @@ + VarEnv \ + VarSet + ++ifeq "$(GhcWithInterpreter)" "YES" ++# These files are reacheable from DynFlags ++# only by GHCi-enabled code (see #9552) ++compiler_stage2_dll0_MODULES += \ ++ Bitmap \ ++ BlockId \ ++ ByteCodeAsm \ ++ ByteCodeInstr \ ++ ByteCodeItbls \ ++ CLabel \ ++ Cmm \ ++ CmmCallConv \ ++ CmmExpr \ ++ CmmInfo \ ++ CmmMachOp \ ++ CmmNode \ ++ CmmUtils \ ++ CodeGen.Platform \ ++ CodeGen.Platform.ARM \ ++ CodeGen.Platform.NoRegs \ ++ CodeGen.Platform.PPC \ ++ CodeGen.Platform.PPC_Darwin \ ++ CodeGen.Platform.SPARC \ ++ CodeGen.Platform.X86 \ ++ CodeGen.Platform.X86_64 \ ++ FastBool \ ++ Hoopl \ ++ Hoopl.Dataflow \ ++ InteractiveEvalTypes \ ++ MkGraph \ ++ PprCmm \ ++ PprCmmDecl \ ++ PprCmmExpr \ ++ Reg \ ++ RegClass \ ++ SMRep \ ++ StgCmmArgRep \ ++ StgCmmClosure \ ++ StgCmmEnv \ ++ StgCmmLayout \ ++ StgCmmMonad \ ++ StgCmmProf \ ++ StgCmmTicky \ ++ StgCmmUtils \ ++ StgSyn \ ++ Stream ++endif ++ + compiler_stage2_dll0_HS_OBJS = \ + $(patsubst %,compiler/stage2/build/%.$(dyn_osuf),$(subst .,/,$(compiler_stage2_dll0_MODULES))) diff --git a/p/ghc/debian/patches/linker-detection-fix b/p/ghc/debian/patches/linker-detection-fix new file mode 100644 index 000000000..7cb5c639c --- /dev/null +++ b/p/ghc/debian/patches/linker-detection-fix @@ -0,0 +1,40 @@ +commit e7b414a3cc0e27049f2608f5e0a00c47146cc46d +Author: Sebastian Dröge <sebastian@centricular.com> +Date: Tue Nov 18 12:40:20 2014 -0600 + + Fix detection of GNU gold linker if invoked via gcc with parameters + + Previously the linker was called without any commandline parameters to + detect whether bfd or gold is used. However the -fuse-ld parameter can + be used to switch between gold and bfd and should be taken into account + here. + + Trac #9336 + + Signed-off-by: Austin Seipp <austin@well-typed.com> + +Index: ghc-7.8.3.20141119/compiler/main/SysTools.lhs +=================================================================== +--- ghc-7.8.3.20141119.orig/compiler/main/SysTools.lhs 2014-12-08 18:45:13.829021078 +0100 ++++ ghc-7.8.3.20141119/compiler/main/SysTools.lhs 2014-12-08 18:45:13.829021078 +0100 +@@ -739,7 +739,10 @@ + getLinkerInfo' dflags = do + let platform = targetPlatform dflags + os = platformOS platform +- (pgm,_) = pgm_l dflags ++ (pgm,args0) = pgm_l dflags ++ args1 = map Option (getOpts dflags opt_l) ++ args2 = args0 ++ args1 ++ args3 = filter notNull (map showOpt args2) + + -- Try to grab the info from the process output. + parseLinkerInfo stdo _stde _exitc +@@ -790,7 +793,7 @@ + -- In practice, we use the compiler as the linker here. Pass + -- -Wl,--version to get linker version info. + (exitc, stdo, stde) <- readProcessEnvWithExitCode pgm +- ["-Wl,--version"] ++ (["-Wl,--version"] ++ args3) + en_locale_env + -- Split the output by lines to make certain kinds + -- of processing easier. In particular, 'clang' and 'gcc' diff --git a/p/ghc/debian/patches/series b/p/ghc/debian/patches/series index bcd00a7a9..06c381aec 100644 --- a/p/ghc/debian/patches/series +++ b/p/ghc/debian/patches/series @@ -5,3 +5,6 @@ haddock-hardcode-ghc-paths Fix-documentation-build-failure-without-GHCi.patch arm64.patch mips-support.patch +always_build_arm_spinlocks.patch +linker-detection-fix +dll-split-fix.patch |
