summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2014-09-04 20:30:42 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2014-09-04 20:30:42 +0000
commitb9353bad28956c6e899908c419439f70460de980 (patch)
tree738e26c68a50ce1a6841b2c9577916c984d3804b /dev-lang
parentguess at better libsdl dep as suggested by hasufell (diff)
downloadgentoo-2-b9353bad28956c6e899908c419439f70460de980.tar.gz
gentoo-2-b9353bad28956c6e899908c419439f70460de980.tar.bz2
gentoo-2-b9353bad28956c6e899908c419439f70460de980.zip
A bunch of UNREG backports (fixes sparc dynamic libraries, ia64 gmp support).
(Portage version: 2.2.12_p12/cvs/Linux x86_64, signed Manifest commit with key 611FF3AA)
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/ghc/ChangeLog10
-rw-r--r--dev-lang/ghc/files/ghc-7.8.2-ia64-no-shared.patch18
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-cc-lang.patch129
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-deRefStablePtr.patch38
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-ia64-prim.patch69
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch35
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-pic-asm.patch107
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch31
-rw-r--r--dev-lang/ghc/files/ghc-7.8.3-prim-lm.patch5
-rw-r--r--dev-lang/ghc/ghc-7.8.3.ebuild11
10 files changed, 428 insertions, 25 deletions
diff --git a/dev-lang/ghc/ChangeLog b/dev-lang/ghc/ChangeLog
index 1dd73edf0acb..7a591b4d63ed 100644
--- a/dev-lang/ghc/ChangeLog
+++ b/dev-lang/ghc/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for dev-lang/ghc
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.266 2014/08/23 13:47:55 slyfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.267 2014/09/04 20:30:42 slyfox Exp $
+
+ 04 Sep 2014; Sergei Trofimovich <slyfox@gentoo.org>
+ +files/ghc-7.8.3-cc-lang.patch, +files/ghc-7.8.3-deRefStablePtr.patch,
+ +files/ghc-7.8.3-ia64-prim.patch, +files/ghc-7.8.3-linker-warn.patch,
+ +files/ghc-7.8.3-pic-asm.patch, +files/ghc-7.8.3-pic-sparc.patch,
+ -files/ghc-7.8.2-ia64-no-shared.patch, files/ghc-7.8.3-prim-lm.patch,
+ ghc-7.8.3.ebuild:
+ A bunch of UNREG backports (fixes sparc dynamic libraries, ia64 gmp support).
23 Aug 2014; Sergei Trofimovich <slyfox@gentoo.org> metadata.xml:
Drop redundant maintainer in favour of herd.
diff --git a/dev-lang/ghc/files/ghc-7.8.2-ia64-no-shared.patch b/dev-lang/ghc/files/ghc-7.8.2-ia64-no-shared.patch
deleted file mode 100644
index 50a2346df910..000000000000
--- a/dev-lang/ghc/files/ghc-7.8.2-ia64-no-shared.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Attempt to disable dynamic libs.
-
-Crash in threaded runtime (and in -dynamic builds)
-looks very similar to sparc failures.
-diff --git a/mk/config.mk.in b/mk/config.mk.in
-index 7cc7aec..9f21256 100644
---- a/mk/config.mk.in
-+++ b/mk/config.mk.in
-@@ -99,7 +99,8 @@ NoSharedLibsPlatformList = powerpc-unknown-linux \
- x86_64-unknown-mingw32 \
- i386-unknown-mingw32 \
- sparc-sun-solaris2 \
-- sparc-unknown-linux
-+ sparc-unknown-linux \
-+ ia64-unknown-linux
-
- ifeq "$(SOLARIS_BROKEN_SHLD)" "YES"
- NoSharedLibsPlatformList += i386-unknown-solaris2
diff --git a/dev-lang/ghc/files/ghc-7.8.3-cc-lang.patch b/dev-lang/ghc/files/ghc-7.8.3-cc-lang.patch
new file mode 100644
index 000000000000..032dc9a67624
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.8.3-cc-lang.patch
@@ -0,0 +1,129 @@
+commit 4d4d07704ee78221607a18b8118294b0aea1bac4
+Author: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Tue Sep 2 00:06:56 2014 +0300
+
+ systools: fix gcc version detecton on non-english locale
+
+ Summary:
+ ghc runs 'gcc -v' to check if we run under vanilla gcc
+ or disaguised clang by checking for string
+
+ "gcc version <something>"
+
+ But this check does not always work as gcc has that string
+ localized via gettext mechanism:
+
+ (some gcc's locale strings)
+ be.po-msgstr "версія gcc %s\n"
+ da.po-msgstr "GCC version %s\n"
+ de.po-msgstr "gcc-Version %s %s\n"
+ el.po-msgstr "έκδοση gcc %s\n"
+ ...
+
+ To ping gcc to English locale we now override environment
+ variable with 'LANGUAGE=en' value.
+
+ Fixes Issue #8825
+
+ Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+
+ Test Plan: validate
+
+ Reviewers: austin
+
+ Reviewed By: austin
+
+ Subscribers: simonmar, ezyang, carter
+
+ Differential Revision: https://phabricator.haskell.org/D185
+
+ GHC Trac Issues: #8825
+
+diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
+index 72fa19b..67926f5 100644
+--- a/compiler/main/SysTools.lhs
++++ b/compiler/main/SysTools.lhs
+@@ -492,6 +492,51 @@ readCreateProcess proc = do
+
+ return (ex, output)
+
++readProcessEnvWithExitCode
++ :: String -- ^ program path
++ -> [String] -- ^ program args
++ -> [(String, String)] -- ^ environment to override
++ -> IO (ExitCode, String, String) -- ^ (exit_code, stdout, stderr)
++readProcessEnvWithExitCode prog args env_update = do
++ current_env <- getEnvironment
++ let new_env = env_update ++ [ (k, v)
++ | let overriden_keys = map fst env_update
++ , (k, v) <- current_env
++ , k `notElem` overriden_keys
++ ]
++ p = proc prog args
++
++ (_stdin, Just stdoh, Just stdeh, pid) <-
++ createProcess p{ std_out = CreatePipe
++ , std_err = CreatePipe
++ , env = Just new_env
++ }
++
++ outMVar <- newEmptyMVar
++ errMVar <- newEmptyMVar
++
++ _ <- forkIO $ do
++ stdo <- hGetContents stdoh
++ _ <- evaluate (length stdo)
++ putMVar outMVar stdo
++
++ _ <- forkIO $ do
++ stde <- hGetContents stdeh
++ _ <- evaluate (length stde)
++ putMVar errMVar stde
++
++ out <- takeMVar outMVar
++ hClose stdoh
++ err <- takeMVar errMVar
++ hClose stdeh
++
++ ex <- waitForProcess pid
++
++ return (ex, out, err)
++
++-- Don't let gcc localize version info string, #8825
++en_locale_env :: [(String, String)]
++en_locale_env = [("LANGUAGE", "en")]
+
+ -- If the -B<dir> option is set, add <dir> to PATH. This works around
+ -- a bug in gcc on Windows Vista where it can't find its auxiliary
+@@ -746,8 +791,9 @@ getLinkerInfo' dflags = do
+ _ -> do
+ -- In practice, we use the compiler as the linker here. Pass
+ -- -Wl,--version to get linker version info.
+- (exitc, stdo, stde) <- readProcessWithExitCode pgm
+- ["-Wl,--version"] ""
++ (exitc, stdo, stde) <- readProcessEnvWithExitCode pgm
++ ["-Wl,--version"]
++ en_locale_env
+ -- Split the output by lines to make certain kinds
+ -- of processing easier. In particular, 'clang' and 'gcc'
+ -- have slightly different outputs for '-Wl,--version', but
+@@ -802,7 +848,8 @@ getCompilerInfo' dflags = do
+
+ -- Process the executable call
+ info <- catchIO (do
+- (exitc, stdo, stde) <- readProcessWithExitCode pgm ["-v"] ""
++ (exitc, stdo, stde) <-
++ readProcessEnvWithExitCode pgm ["-v"] en_locale_env
+ -- Split the output by lines to make certain kinds
+ -- of processing easier.
+ parseCompilerInfo (lines stdo) (lines stde) exitc
+@@ -952,7 +999,8 @@ readElfSection _dflags section exe = do
+ prog = "readelf"
+ args = [Option "-p", Option section, FileOption "" exe]
+ --
+- r <- readProcessWithExitCode prog (filter notNull (map showOpt args)) ""
++ r <- readProcessEnvWithExitCode prog (filter notNull (map showOpt args))
++ en_locale_env
+ case r of
+ (ExitSuccess, out, _err) -> return (doFilter (lines out))
+ _ -> return Nothing
diff --git a/dev-lang/ghc/files/ghc-7.8.3-deRefStablePtr.patch b/dev-lang/ghc/files/ghc-7.8.3-deRefStablePtr.patch
new file mode 100644
index 000000000000..8deec21edc5c
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.8.3-deRefStablePtr.patch
@@ -0,0 +1,38 @@
+commit 104a66a461f4f89b8e5ad9c829923bb7ca8ceddb
+Author: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sat Aug 23 13:11:23 2014 +0300
+
+ rts/Linker.c: declare 'deRefStablePtr' as an exported 'rts' symbol
+
+ $ inplace/bin/ghc-stage2 -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -optc-fno-builtin -fno-ghci-history \
+ testsuite/tests/ffi/should_run/T4038.hs --interactive -v0 -ignore-dot-ghci +RTS -I0.1 -RTS
+
+ *Main> main
+ <interactive>: /tmp/ghc16668_0/ghc16668_5.o: unknown symbol `deRefStablePtr'
+
+ The reference to 'deRefStablePtr' is generated by 'compiler/deSugar/DsForeign.lhs':
+ the_cfun
+ = case maybe_target of
+ Nothing -> text "(StgClosure*)deRefStablePtr(the_stableptr)"
+ Just hs_fn -> char '&' <> ppr hs_fn <> text "_closure"
+
+ Patch fixes all broken tests using 'import wrapper':
+ TEST="ffi013 ffi010 ffi011 ffi005 ffi020 ffi006 ffi019 fed001 T1679 T4038"
+
+ Tests manifested as broken only in DYNAMIC_GHC_PROGRAMS=NO builds,
+ where GHCi's custom linker is used instead of system's linker.
+
+ Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+
+diff --git a/rts/Linker.c b/rts/Linker.c
+index e97580d..b24be58 100644
+--- a/rts/Linker.c
++++ b/rts/Linker.c
+@@ -1092,6 +1092,7 @@ typedef struct _RtsSymbolVal {
+ SymI_HasProto(__word_encodeFloat) \
+ SymI_HasProto(stg_atomicallyzh) \
+ SymI_HasProto(barf) \
++ SymI_HasProto(deRefStablePtr) \
+ SymI_HasProto(debugBelch) \
+ SymI_HasProto(errorBelch) \
+ SymI_HasProto(sysErrorBelch) \
diff --git a/dev-lang/ghc/files/ghc-7.8.3-ia64-prim.patch b/dev-lang/ghc/files/ghc-7.8.3-ia64-prim.patch
new file mode 100644
index 000000000000..9026ecfdf4b1
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.8.3-ia64-prim.patch
@@ -0,0 +1,69 @@
+commit e2a8801b9779949010f30db6f6ef66f3c3a70776
+Author: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Thu Sep 4 17:50:45 2014 +0300
+
+ pprC: declare extern cmm primitives as functions, not data
+
+ Summary:
+ The commit fixes incorrect code generation of
+ integer-gmp package on ia64 due to C prototype mismatch.
+ Before patch prototype was
+ StgWord poizh[];
+ After patch it became
+ StgFunPtr poizh();
+
+ Long story:
+
+ Consider the following simple example:
+
+ {-# LANGUAGE MagicHash, GHCForeignImportPrim, UnliftedFFITypes #-}
+ module M where
+ import GHC.Prim -- Int#
+ foreign import prim "poizh" poi# :: Int# -> Int#
+
+ Before the patch Unregisterised build generated the
+ following 'poizh' reference:
+ EI_(poizh); /* StgWord poizh[]; */
+ FN_(M_poizh_entry) {
+ // ...
+ JMP_((W_)&poizh);
+ }
+
+ After the patch it looks this way:
+ EF_(poizh); /* StgFunPtr poizh(); */
+ FN_(M_poizh_entry) {
+ // ...
+ JMP_((W_)&poizh);
+ }
+
+ On ia64 it leads to different relocation types being generated:
+ incorrect one:
+ addl r14 = @ltoffx(poizh#)
+ ld8.mov r14 = [r14], poizh#
+ correct one:
+ addl r14 = @ltoff(@fptr(poizh#)), gp
+ ld8 r14 = [r14]
+
+ '@fptr(poizh#)' basically instructs assembler to creates
+ another obect consisting of real address to 'poizh' instructions
+ and module address. That '@fptr' object is used as a function "address".
+ This object is different for every module referencing 'poizh' symbol.
+
+ All indirect function calls expect '@fptr' object. That way
+ call site can read real destination address and set destination
+ module address in 'gp' register.
+
+ Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+
+diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
+index 02ad026..0f2c0ae 100644
+--- a/compiler/cmm/CLabel.hs
++++ b/compiler/cmm/CLabel.hs
+@@ -813,6 +813,7 @@ labelType (CmmLabel _ _ CmmClosure) = GcPtrLabel
+ labelType (CmmLabel _ _ CmmCode) = CodeLabel
+ labelType (CmmLabel _ _ CmmInfo) = DataLabel
+ labelType (CmmLabel _ _ CmmEntry) = CodeLabel
++labelType (CmmLabel _ _ CmmPrimCall) = CodeLabel
+ labelType (CmmLabel _ _ CmmRetInfo) = DataLabel
+ labelType (CmmLabel _ _ CmmRet) = CodeLabel
+ labelType (RtsLabel (RtsSelectorInfoTable _ _)) = DataLabel
diff --git a/dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch b/dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch
new file mode 100644
index 000000000000..c8570c06940b
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.8.3-linker-warn.patch
@@ -0,0 +1,35 @@
+commit 326046739801a380c5457ef4c87bce8fb95497ba
+Author: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sun Aug 10 22:12:28 2014 +0300
+
+ systools info: fix warning about C compiler (message said about linker)
+
+ Summary: Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+
+ Test Plan: build-tested
+
+ Reviewers: austin
+
+ Reviewed By: austin
+
+ Subscribers: phaskell, simonmar, relrod, ezyang, carter
+
+ Differential Revision: https://phabricator.haskell.org/D132
+
+diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
+index 1c1c52c..72fa19b 100644
+--- a/compiler/main/SysTools.lhs
++++ b/compiler/main/SysTools.lhs
+@@ -809,10 +809,10 @@ getCompilerInfo' dflags = do
+ )
+ (\err -> do
+ debugTraceMsg dflags 2
+- (text "Error (figuring out compiler information):" <+>
++ (text "Error (figuring out C compiler information):" <+>
+ text (show err))
+ errorMsg dflags $ hang (text "Warning:") 9 $
+- text "Couldn't figure out linker information!" $$
++ text "Couldn't figure out C compiler information!" $$
+ text "Make sure you're using GNU gcc, or clang"
+ return UnknownCC)
+ return info
diff --git a/dev-lang/ghc/files/ghc-7.8.3-pic-asm.patch b/dev-lang/ghc/files/ghc-7.8.3-pic-asm.patch
new file mode 100644
index 000000000000..10c41d5b29f6
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.8.3-pic-asm.patch
@@ -0,0 +1,107 @@
+commit a93ab43ab5f40cadbedea2f6342b93c245e91434
+Author: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Wed Aug 27 22:19:52 2014 +0300
+
+ driver: pass '-fPIC' option to assembler as well
+
+ Summary:
+ Before the patch '-fPIC' was passed only to C compiler,
+ but not to assembler itself.
+
+ It led to runtime crash in GHC_DYNAMIC_PROGRAMS=YES mode
+ on sparc32.
+
+ Technical details are in 'Note [-fPIC for assembler]'.
+
+ Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+
+ Test Plan: validate on sparc
+
+ Reviewers: simonmar, austin, kgardas
+
+ Reviewed By: austin
+
+ Subscribers: simonmar, ezyang, carter
+
+ Differential Revision: https://phabricator.haskell.org/D177
+
+diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
+index 183f435..5a18e6e 100644
+--- a/compiler/main/DriverPipeline.hs
++++ b/compiler/main/DriverPipeline.hs
+@@ -1199,6 +1199,7 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags
+
+ as_prog <- whichAsProg
+ let cmdline_include_paths = includePaths dflags
++ let pic_c_flags = picCCOpts dflags
+
+ next_phase <- maybeMergeStub
+ output_fn <- phaseOutputFilename next_phase
+@@ -1212,6 +1213,9 @@ runPhase (RealPhase (As with_cpp)) input_fn dflags
+ = liftIO $ as_prog dflags
+ ([ SysTools.Option ("-I" ++ p) | p <- cmdline_include_paths ]
+
++ -- See Note [-fPIC for assembler]
++ ++ map SysTools.Option pic_c_flags
++
+ -- We only support SparcV9 and better because V8 lacks an atomic CAS
+ -- instruction so we have to make sure that the assembler accepts the
+ -- instruction set. Note that the user can still override this
+@@ -1253,6 +1257,8 @@ runPhase (RealPhase SplitAs) _input_fn dflags
+ osuf = objectSuf dflags
+ split_odir = base_o ++ "_" ++ osuf ++ "_split"
+
++ let pic_c_flags = picCCOpts dflags
++
+ -- this also creates the hierarchy
+ liftIO $ createDirectoryIfMissing True split_odir
+
+@@ -1286,6 +1292,9 @@ runPhase (RealPhase SplitAs) _input_fn dflags
+ then [SysTools.Option "-mcpu=v9"]
+ else []) ++
+
++ -- See Note [-fPIC for assembler]
++ map SysTools.Option pic_c_flags ++
++
+ [ SysTools.Option "-c"
+ , SysTools.Option "-o"
+ , SysTools.FileOption "" (split_obj n)
+@@ -2203,3 +2212,38 @@ haveRtsOptsFlags dflags =
+ isJust (rtsOpts dflags) || case rtsOptsEnabled dflags of
+ RtsOptsSafeOnly -> False
+ _ -> True
++
++-- Note [-fPIC for assembler]
++-- When compiling .c source file GHC's driver pipeline basically
++-- does the following two things:
++-- 1. ${CC} -S 'PIC_CFLAGS' source.c
++-- 2. ${CC} -x assembler -c 'PIC_CFLAGS' source.S
++--
++-- Why do we need to pass 'PIC_CFLAGS' both to C compiler and assembler?
++-- Because on some architectures (at least sparc32) assembler also choses
++-- relocation type!
++-- Consider the following C module:
++--
++-- /* pic-sample.c */
++-- int v;
++-- void set_v (int n) { v = n; }
++-- int get_v (void) { return v; }
++--
++-- $ gcc -S -fPIC pic-sample.c
++-- $ gcc -c pic-sample.s -o pic-sample.no-pic.o # incorrect binary
++-- $ gcc -c -fPIC pic-sample.s -o pic-sample.pic.o # correct binary
++--
++-- $ objdump -r -d pic-sample.pic.o > pic-sample.pic.o.od
++-- $ objdump -r -d pic-sample.no-pic.o > pic-sample.no-pic.o.od
++-- $ diff -u pic-sample.pic.o.od pic-sample.no-pic.o.od
++--
++-- Most of architectures won't show any difference in this test, but on sparc32
++-- the following assembly snippet:
++--
++-- sethi %hi(_GLOBAL_OFFSET_TABLE_-8), %l7
++--
++-- generates two kinds or relocations, only 'R_SPARC_PC22' is correct:
++--
++-- 3c: 2f 00 00 00 sethi %hi(0), %l7
++-- - 3c: R_SPARC_PC22 _GLOBAL_OFFSET_TABLE_-0x8
++-- + 3c: R_SPARC_HI22 _GLOBAL_OFFSET_TABLE_-0x8
diff --git a/dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch b/dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch
new file mode 100644
index 000000000000..16a552fdd4be
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-7.8.3-pic-sparc.patch
@@ -0,0 +1,31 @@
+commit 78863edbb0751f5c9694ea10c6132a87cfd0ee10
+Author: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Wed Aug 27 22:20:33 2014 +0300
+
+ Revert "disable shared libs on sparc (linux/solaris) (fixes #8857)"
+
+ This reverts commit 623883f1ed0ee11cc925c4590fb09565403fd231.
+
+ The commit a93ab43ab5f40cadbedea2f6342b93c245e91434
+ driver: pass '-fPIC' option to assembler as well
+ fixes shared libraries on sparc at least on linux.
+
+ Properly fixes Issue #8857
+
+ Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+
+diff --git a/mk/config.mk.in b/mk/config.mk.in
+index c210cd3..392237f 100644
+--- a/mk/config.mk.in
++++ b/mk/config.mk.in
+@@ -97,9 +97,7 @@ endif
+ # Some platforms don't support shared libraries
+ NoSharedLibsPlatformList = powerpc-unknown-linux \
+ x86_64-unknown-mingw32 \
+- i386-unknown-mingw32 \
+- sparc-sun-solaris2 \
+- sparc-unknown-linux
++ i386-unknown-mingw32
+
+ ifeq "$(SOLARIS_BROKEN_SHLD)" "YES"
+ NoSharedLibsPlatformList += i386-unknown-solaris2
diff --git a/dev-lang/ghc/files/ghc-7.8.3-prim-lm.patch b/dev-lang/ghc/files/ghc-7.8.3-prim-lm.patch
index 9b321f580498..3ef2313fcec1 100644
--- a/dev-lang/ghc/files/ghc-7.8.3-prim-lm.patch
+++ b/dev-lang/ghc/files/ghc-7.8.3-prim-lm.patch
@@ -5,10 +5,7 @@ diff --git a/libraries/ghc-prim/ghc-prim.cabal b/libraries/ghc-prim/ghc-prim.cab
index ffb32af..0431380 100644
--- a/libraries/ghc-prim/ghc-prim.cabal
+++ b/libraries/ghc-prim/ghc-prim.cabal
-@@ -65,3 +65,7 @@ Library
- -- We need to set the package name to ghc-prim (without a version number)
- -- as it's magic.
- ghc-options: -package-name ghc-prim
+@@ -68,0 +68,4 @@ Library
+
+ -- ghc 'sin' (and other) primops generate 'libm' calls,
+ -- but ghc itself does not add '-lm'
diff --git a/dev-lang/ghc/ghc-7.8.3.ebuild b/dev-lang/ghc/ghc-7.8.3.ebuild
index abec30854fd7..5271f8ba618d 100644
--- a/dev-lang/ghc/ghc-7.8.3.ebuild
+++ b/dev-lang/ghc/ghc-7.8.3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.8.3.ebuild,v 1.8 2014/08/23 13:46:43 slyfox Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-7.8.3.ebuild,v 1.9 2014/09/04 20:30:42 slyfox Exp $
EAPI=5
@@ -396,13 +396,20 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-7.8.1_rc1-libbfd.patch
- epatch "${FILESDIR}"/${PN}-7.8.2-ia64-no-shared.patch
epatch "${FILESDIR}"/${PN}-7.8.2-cgen-constify.patch
epatch "${FILESDIR}"/${PN}-7.8.3-prim-lm.patch
# bug 518734
epatch "${FILESDIR}"/${PN}-7.6.3-preserve-inplace-xattr.patch
epatch "${FILESDIR}"/${PN}-7.8.3-unreg-lit.patch
+ # upstream backports
+ epatch "${FILESDIR}"/${PN}-7.8.3-linker-warn.patch
+ epatch "${FILESDIR}"/${PN}-7.8.3-deRefStablePtr.patch
+ epatch "${FILESDIR}"/${PN}-7.8.3-pic-asm.patch
+ epatch "${FILESDIR}"/${PN}-7.8.3-pic-sparc.patch
+ epatch "${FILESDIR}"/${PN}-7.8.3-cc-lang.patch
+ epatch "${FILESDIR}"/${PN}-7.8.3-ia64-prim.patch
+
if use prefix; then
# Make configure find docbook-xsl-stylesheets from Prefix
sed -e '/^FP_DIR_DOCBOOK_XSL/s:\[.*\]:['"${EPREFIX}"'/usr/share/sgml/docbook/xsl-stylesheets/]:' \