diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2016-12-28 22:20:50 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2016-12-28 22:37:38 +0000 |
commit | ce2c3248dff78e70172969b90055f439936be773 (patch) | |
tree | 3a595eb6d91b673ab0e9524bdc59431a3392a6e7 /dev-lang/ghc/files | |
parent | dev-haskell/cabal: drop old (diff) | |
download | gentoo-ce2c3248dff78e70172969b90055f439936be773.tar.gz gentoo-ce2c3248dff78e70172969b90055f439936be773.tar.bz2 gentoo-ce2c3248dff78e70172969b90055f439936be773.zip |
dev-lang/ghc: drop old
Package-Manager: Portage-2.3.3, Repoman-2.3.1
Diffstat (limited to 'dev-lang/ghc/files')
16 files changed, 0 insertions, 1292 deletions
diff --git a/dev-lang/ghc/files/ghc-7.0.4-darwin8.patch b/dev-lang/ghc/files/ghc-7.0.4-darwin8.patch deleted file mode 100644 index bfbee41b4f93..000000000000 --- a/dev-lang/ghc/files/ghc-7.0.4-darwin8.patch +++ /dev/null @@ -1,18 +0,0 @@ -Workaround headers problem in Darwin 8 as well. - ---- rts/PosixSource.h -+++ rts/PosixSource.h -@@ -11,6 +11,13 @@ - - #include <ghcplatform.h> - -+#if defined(darwin_HOST_OS) -+/* unfortunately the hack below only works for Darwin 9 and -+ * above, so as hack include sys/types early (before setting -+ * _POSIX_C_SOURCE) (this obviously obsoletes the hack below) */ -+#include <sys/types.h> -+#endif -+ - #if defined(freebsd_HOST_OS) - #define _POSIX_C_SOURCE 200112L - #define _XOPEN_SOURCE 600 diff --git a/dev-lang/ghc/files/ghc-7.10.1-T10590-dequeue.patch b/dev-lang/ghc/files/ghc-7.10.1-T10590-dequeue.patch deleted file mode 100644 index be0f7a05b1e3..000000000000 --- a/dev-lang/ghc/files/ghc-7.10.1-T10590-dequeue.patch +++ /dev/null @@ -1,89 +0,0 @@ -diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c -index 3b206ff..08c031c 100644 ---- a/rts/RaiseAsync.c -+++ b/rts/RaiseAsync.c -@@ -56,7 +56,8 @@ static void throwToSendMsg (Capability *cap USED_IF_THREADS, - - static void - throwToSingleThreaded__ (Capability *cap, StgTSO *tso, StgClosure *exception, -- rtsBool stop_at_atomically, StgUpdateFrame *stop_here) -+ rtsBool stop_at_atomically, StgUpdateFrame *stop_here, -+ rtsBool dequeue) - { - // Thread already dead? - if (tso->what_next == ThreadComplete || tso->what_next == ThreadKilled) { -@@ -64,7 +65,9 @@ throwToSingleThreaded__ (Capability *cap, StgTSO *tso, StgClosure *exception, - } - - // Remove it from any blocking queues -- removeFromQueues(cap,tso); -+ if (dequeue) { -+ removeFromQueues(cap,tso); -+ } - - raiseAsync(cap, tso, exception, stop_at_atomically, stop_here); - } -@@ -72,20 +75,26 @@ throwToSingleThreaded__ (Capability *cap, StgTSO *tso, StgClosure *exception, - void - throwToSingleThreaded (Capability *cap, StgTSO *tso, StgClosure *exception) - { -- throwToSingleThreaded__(cap, tso, exception, rtsFalse, NULL); -+ throwToSingleThreaded__(cap, tso, exception, rtsFalse, NULL, rtsTrue); -+} -+ -+void -+throwToSingleThreadedNoDequeue (Capability *cap, StgTSO *tso, StgClosure *exception) -+{ -+ throwToSingleThreaded__(cap, tso, exception, rtsFalse, NULL, rtsFalse); - } - - void - throwToSingleThreaded_ (Capability *cap, StgTSO *tso, StgClosure *exception, - rtsBool stop_at_atomically) - { -- throwToSingleThreaded__ (cap, tso, exception, stop_at_atomically, NULL); -+ throwToSingleThreaded__ (cap, tso, exception, stop_at_atomically, NULL, rtsTrue); - } - - void // cannot return a different TSO - suspendComputation (Capability *cap, StgTSO *tso, StgUpdateFrame *stop_here) - { -- throwToSingleThreaded__ (cap, tso, NULL, rtsFalse, stop_here); -+ throwToSingleThreaded__ (cap, tso, NULL, rtsFalse, stop_here, rtsTrue); - } - - /* ----------------------------------------------------------------------------- -diff --git a/rts/RaiseAsync.h b/rts/RaiseAsync.h -index 6bfed8d..2e8a7a3 100644 ---- a/rts/RaiseAsync.h -+++ b/rts/RaiseAsync.h -@@ -23,6 +23,10 @@ void throwToSingleThreaded (Capability *cap, - StgTSO *tso, - StgClosure *exception); - -+void throwToSingleThreadedNoDequeue (Capability *cap, -+ StgTSO *tso, -+ StgClosure *exception); -+ - void throwToSingleThreaded_ (Capability *cap, - StgTSO *tso, - StgClosure *exception, -diff --git a/rts/posix/Select.c b/rts/posix/Select.c -index 4b19235..6889499 100644 ---- a/rts/posix/Select.c -+++ b/rts/posix/Select.c -@@ -412,8 +412,12 @@ awaitEvent(rtsBool wait) - IF_DEBUG(scheduler, - debugBelch("Killing blocked thread %lu on bad fd=%i\n", - (unsigned long)tso->id, fd)); -- throwToSingleThreaded(&MainCapability, tso, -- (StgClosure *)blockedOnBadFD_closure); -+ /* -+ * We can't use throwToSingleThreaded() here -+ * as 'RTS_FD_IS_READY' breaks blocked_queue_hd list -+ */ -+ throwToSingleThreadedNoDequeue(&MainCapability, tso, -+ (StgClosure *)blockedOnBadFD_closure); - break; - case RTS_FD_IS_READY: - IF_DEBUG(scheduler, diff --git a/dev-lang/ghc/files/ghc-7.2.1-freebsd-CHOST.patch b/dev-lang/ghc/files/ghc-7.2.1-freebsd-CHOST.patch deleted file mode 100644 index da59cd789f99..000000000000 --- a/dev-lang/ghc/files/ghc-7.2.1-freebsd-CHOST.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/aclocal.m4 b/aclocal.m4 -index 11bb003..52df243 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -1545,7 +1545,7 @@ case "$1" in - freebsd|netbsd|openbsd|dragonfly|osf1|osf3|hpux|linuxaout|kfreebsdgnu|freebsd2|solaris2|cygwin32|mingw32|darwin|gnu|nextstep2|nextstep3|sunos4|ultrix|irix|aix|haiku) - $2="$1" - ;; -- freebsd8) # like i686-gentoo-freebsd8 -+ freebsd*) # like i686-gentoo-freebsd8 or i686-gentoo-freebsd8.2 - $2="freebsd" - ;; - darwin*) diff --git a/dev-lang/ghc/files/ghc-7.4-rc2-macos-prefix-respect-gcc.patch b/dev-lang/ghc/files/ghc-7.4-rc2-macos-prefix-respect-gcc.patch deleted file mode 100644 index 770fd650606b..000000000000 --- a/dev-lang/ghc/files/ghc-7.4-rc2-macos-prefix-respect-gcc.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/aclocal.m4 b/aclocal.m4 -index a377cb9..4f8fd69 100644 ---- a/aclocal.m4 -+++ b/aclocal.m4 -@@ -1950,17 +1950,7 @@ AC_DEFUN([XCODE_VERSION],[ - # -------------------------------- - # Finds where gcc is - AC_DEFUN([FIND_GCC],[ -- if test "$TargetOS_CPP" = "darwin" && -- test "$XCodeVersion1" -eq 4 && -- test "$XCodeVersion2" -lt 2 -- then -- # In Xcode 4.1, 'gcc-4.2' is the gcc legacy backend (rather -- # than the LLVM backend). We prefer the legacy gcc, but in -- # Xcode 4.2 'gcc-4.2' was removed. -- FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc-4.2]) -- else -- FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc]) -- fi -+ FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc]) - export CC - WhatGccIsCalled="$CC" - AC_SUBST(WhatGccIsCalled) diff --git a/dev-lang/ghc/files/ghc-7.4.1-darwin-CHOST.patch b/dev-lang/ghc/files/ghc-7.4.1-darwin-CHOST.patch deleted file mode 100644 index 348158882aaf..000000000000 --- a/dev-lang/ghc/files/ghc-7.4.1-darwin-CHOST.patch +++ /dev/null @@ -1,18 +0,0 @@ -like the other CHOST patches, but this one catches another case where -$host is used (instead of the cannonicalised variables) - ---- aclocal.m4 -+++ aclocal.m4 -@@ -93,10 +93,10 @@ - exeext='.exe' - soext='.dll' - ;; -- i386-apple-darwin|powerpc-apple-darwin) -+ i386-apple-darwin*|powerpc-apple-darwin*) - soext='.dylib' - ;; -- x86_64-apple-darwin) -+ x86_64-apple-darwin*) - soext='.dylib' - ;; - esac diff --git a/dev-lang/ghc/files/ghc-7.4.1-ticket-7339-fix-unaligned-unreg.patch b/dev-lang/ghc/files/ghc-7.4.1-ticket-7339-fix-unaligned-unreg.patch deleted file mode 100644 index f2f19f1bbab4..000000000000 --- a/dev-lang/ghc/files/ghc-7.4.1-ticket-7339-fix-unaligned-unreg.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 26f8466507bd9383e0a7d1e62e397eca4a13822a Mon Sep 17 00:00:00 2001 -From: Sergei Trofimovich <slyfox@gentoo.org> -Date: Tue, 13 Nov 2012 01:39:14 +0300 -Subject: [PATCH] Fix unaligned access on alpha and friends (ticket #7339) - -Assume unknown arch (alpha and mips) an alignment sensitive target. -Otherwise on alpha it causes ghc-7.4.1 to generate invalud lexers. - -Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> ---- - compiler/cmm/PprC.hs | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs -index 21826f8..8cdcde6 100644 ---- a/compiler/cmm/PprC.hs -+++ b/compiler/cmm/PprC.hs -@@ -963,6 +963,7 @@ cLoad platform expr rep - | otherwise - = char '*' <> parens (cCast platform (machRepPtrCType rep) expr) - where -- On these platforms, unaligned loads are known to cause problems -+ bewareLoadStoreAlignment ArchUnknown = True -- like alpha or mips - bewareLoadStoreAlignment (ArchARM {}) = True - bewareLoadStoreAlignment _ = False - --- -1.8.0 - diff --git a/dev-lang/ghc/files/ghc-7.4.2-system-libffi.patch b/dev-lang/ghc/files/ghc-7.4.2-system-libffi.patch deleted file mode 100644 index 73c4aa278dd8..000000000000 --- a/dev-lang/ghc/files/ghc-7.4.2-system-libffi.patch +++ /dev/null @@ -1,119 +0,0 @@ -Make ghc use the libffi installed on the system instead of the bundled one. - -This patch is based on the one used by Debian and Fedora, but was -augmented by additional lines to identify the libffi include directory -using pkg-config, as libffi on Gentoo installs into a subdirectory of -the system include directory. - -2012-04-24 Martin von Gagern - -References: -https://bugs.gentoo.org/411925 -http://hackage.haskell.org/trac/ghc/ticket/5743 - -Index: ghc-7.4.1/ghc.mk -=================================================================== ---- ghc-7.4.1.orig/ghc.mk -+++ ghc-7.4.1/ghc.mk -@@ -579,7 +579,6 @@ BUILD_DIRS += \ - driver/ghci \ - driver/ghc \ - driver/haddock \ -- libffi \ - includes \ - rts - -Index: ghc-7.4.1/rts/ghc.mk -=================================================================== ---- ghc-7.4.1.orig/rts/ghc.mk -+++ ghc-7.4.1/rts/ghc.mk -@@ -86,8 +86,7 @@ - ALL_RTS_DEF_LIBNAMES = base ghc-prim - ALL_RTS_DEF_LIBS = \ - rts/dist/build/win32/libHSbase.dll.a \ -- rts/dist/build/win32/libHSghc-prim.dll.a \ -- libffi/build/inst/lib/libffi.dll.a -+ rts/dist/build/win32/libHSghc-prim.dll.a - - # -- import libs for the regular Haskell libraries - define make-importlib-def # args $1 = lib name -@@ -172,12 +171,12 @@ - # Making a shared library for the RTS. - ifneq "$$(findstring dyn, $1)" "" - ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32" --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/libffi-5.dll -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend - "$$(RM)" $$(RM_OPTS) $$@ - "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \ - -no-auto-link-packages -Lrts/dist/build -lffi-5 `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@ - else --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext) -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend - "$$(RM)" $$(RM_OPTS) $$@ - "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \ - -no-auto-link-packages -Lrts/dist/build -lffi `cat rts/libs.depend` $$(rts_$1_OBJS) \ -@@ -188,9 +187,9 @@ - endif - endif - else --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) $$(rts_ffi_objs_stamp) -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) - "$$(RM)" $$(RM_OPTS) $$@ -- echo $$(rts_ffi_objs) $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \ -+ echo $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \ - $$(AR_OPTS_STAGE1) $$(EXTRA_AR_ARGS_STAGE1) $$@ - endif - -@@ -403,6 +402,12 @@ - rts/dist/build/sm/Evac_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm - rts/dist/build/sm/Scav_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm - -+# Use system libffi -+libffi_include_flags:=$(shell pkg-config --cflags-only-I libffi) -+rts/Adjustor_CC_OPTS += $(libffi_include_flags) -+rts/Interpreter_CC_OPTS += $(libffi_include_flags) -+rts/sm/Storage_CC_OPTS += $(libffi_include_flags) -+ - #----------------------------------------------------------------------------- - # Add PAPI library if needed - -@@ -504,10 +509,8 @@ - # installing - - INSTALL_LIBS += $(ALL_RTS_LIBS) --INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*) --INSTALL_LIBS += $(wildcard rts/dist/build/libffi-5.dll) - --install: install_libffi_headers -+install: - - .PHONY: install_libffi_headers - install_libffi_headers : -Index: ghc-7.4.1/rts/package.conf.in -=================================================================== ---- ghc-7.4.1.orig/rts/package.conf.in -+++ ghc-7.4.1/rts/package.conf.in -@@ -24,8 +24,9 @@ - hs-libraries: "HSrts" - - extra-libraries: -+ "ffi" - #ifdef HAVE_LIBM -- "m" /* for ldexp() */ -+ , "m" /* for ldexp() */ - #endif - #ifdef HAVE_LIBRT - , "rt" -Index: ghc-7.4.1/compiler/ghc.mk -=================================================================== ---- ghc-7.4.1.orig/compiler/ghc.mk -+++ ghc-7.4.1/compiler/ghc.mk -@@ -260,6 +260,8 @@ - - compiler_CPP_OPTS += -I$(GHC_INCLUDE_DIR) - compiler_CPP_OPTS += ${GhcCppOpts} -+libffi_include_flags := $(shell pkg-config --cflags-only-I libffi) -+compiler/ghci/LibFFI_HSC2HS_OPTS += $(addprefix --cflag=,$(libffi_include_flags)) - - $(PRIMOPS_TXT) compiler/parser/Parser.y: %: %.pp compiler/stage1/$(PLATFORM_H) - $(CPP) $(RAWCPP_FLAGS) -P $(compiler_CPP_OPTS) -x c $< | grep -v '^#pragma GCC' > $@ diff --git a/dev-lang/ghc/files/ghc-7.5.20120505-system-libffi.patch b/dev-lang/ghc/files/ghc-7.5.20120505-system-libffi.patch deleted file mode 100644 index f3b0c71c5454..000000000000 --- a/dev-lang/ghc/files/ghc-7.5.20120505-system-libffi.patch +++ /dev/null @@ -1,88 +0,0 @@ ---- ghc-7.5.20120505-orig/ghc.mk 2012-05-06 03:01:29.000000000 +1000 -+++ ghc-7.5.20120505/ghc.mk 2012-05-06 17:22:01.023416003 +1000 -@@ -584,7 +584,6 @@ - $(MAYBE_GHCI) \ - driver/ghc \ - driver/haddock \ -- libffi \ - includes \ - rts - ---- ghc-7.5.20120505-orig/rts/ghc.mk 2012-05-06 03:01:30.000000000 +1000 -+++ ghc-7.5.20120505/rts/ghc.mk 2012-05-06 17:28:31.925897226 +1000 -@@ -171,12 +171,12 @@ - # Making a shared library for the RTS. - ifneq "$$(findstring dyn, $1)" "" - ifeq "$$(HostOS_CPP)" "mingw32" --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/$$(LIBFFI_DLL) -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend - "$$(RM)" $$(RM_OPTS) $$@ - "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \ - -no-auto-link-packages -Lrts/dist/build -l$(LIBFFI_WINDOWS_LIB) `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@ - else --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext) -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend - "$$(RM)" $$(RM_OPTS) $$@ - "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \ - -no-auto-link-packages -Lrts/dist/build -lffi `cat rts/libs.depend` $$(rts_$1_OBJS) \ -@@ -187,9 +187,9 @@ - endif - endif - else --$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) $$(rts_ffi_objs_stamp) -+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) - "$$(RM)" $$(RM_OPTS) $$@ -- echo $$(rts_ffi_objs) $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \ -+ echo $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \ - $$(AR_OPTS_STAGE1) $$(EXTRA_AR_ARGS_STAGE1) $$@ - endif - -@@ -407,6 +407,12 @@ - rts/dist/build/sm/Evac_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm - rts/dist/build/sm/Scav_thr_CC_OPTS += -DPARALLEL_GC -Irts/sm - -+# Use system libffi -+libffi_include_flags:=$(shell pkg-config --cflags-only-I libffi) -+rts/Adjustor_CC_OPTS += $(libffi_include_flags) -+rts/Interpreter_CC_OPTS += $(libffi_include_flags) -+rts/sm/Storage_CC_OPTS += $(libffi_include_flags) -+ - #----------------------------------------------------------------------------- - # Add PAPI library if needed - -@@ -508,10 +514,8 @@ - # installing - - INSTALL_LIBS += $(ALL_RTS_LIBS) --INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*) --INSTALL_LIBS += $(wildcard rts/dist/build/$(LIBFFI_DLL)) - --install: install_libffi_headers -+install: - - .PHONY: install_libffi_headers - install_libffi_headers : ---- ghc-7.5.20120505-orig/rts/package.conf.in 2012-05-06 03:01:30.000000000 +1000 -+++ ghc-7.5.20120505/rts/package.conf.in 2012-05-06 17:22:01.025416056 +1000 -@@ -24,8 +24,9 @@ - hs-libraries: "HSrts" - - extra-libraries: -+ "ffi" - #ifdef HAVE_LIBM -- "m" /* for ldexp() */ -+ , "m" /* for ldexp() */ - #endif - #ifdef HAVE_LIBRT - , "rt" ---- ghc-7.5.20120505-orig/compiler/ghc.mk 2012-05-06 03:01:29.000000000 +1000 -+++ ghc-7.5.20120505/compiler/ghc.mk 2012-05-06 17:22:01.026416083 +1000 -@@ -260,6 +260,8 @@ - - compiler_CPP_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS)) - compiler_CPP_OPTS += ${GhcCppOpts} -+libffi_include_flags := $(shell pkg-config --cflags-only-I libffi) -+compiler/ghci/LibFFI_HSC2HS_OPTS += $(addprefix --cflag=,$(libffi_include_flags)) - - $(PRIMOPS_TXT) compiler/parser/Parser.y: %: %.pp compiler/stage1/$(PLATFORM_H) - $(CPP) $(RAWCPP_FLAGS) -P $(compiler_CPP_OPTS) -x c $< | grep -v '^#pragma GCC' > $@ diff --git a/dev-lang/ghc/files/ghc-7.6.2-integer-simple-div-mod.patch b/dev-lang/ghc/files/ghc-7.6.2-integer-simple-div-mod.patch deleted file mode 100644 index 0dc5391678f2..000000000000 --- a/dev-lang/ghc/files/ghc-7.6.2-integer-simple-div-mod.patch +++ /dev/null @@ -1,57 +0,0 @@ -commit de13417726b90b0945aaaf0b9cfbaf8ab975d8b5 -Author: Gabor Greif <ggreif@gmail.com> -Date: Tue Jul 24 14:31:36 2012 +0200 - - track integer-gmp and add 'divInteger', 'modInteger' - -diff --git a/libraries/integer-simple/GHC/Integer.hs b/libraries/integer-simple/GHC/Integer.hs -index c9b50a7..4122d38 100644 ---- a/libraries/integer-simple/GHC/Integer.hs -+++ b/libraries/integer-simple/GHC/Integer.hs -@@ -4,7 +4,7 @@ - ----------------------------------------------------------------------------- - -- | - -- Module : GHC.Integer ---- Copyright : (c) Ian Lynagh 2007-2008 -+-- Copyright : (c) Ian Lynagh 2007-2012 - -- License : BSD3 - -- - -- Maintainer : igloo@earth.li -@@ -27,6 +27,7 @@ module GHC.Integer ( - plusInteger, minusInteger, timesInteger, negateInteger, - eqInteger, neqInteger, absInteger, signumInteger, - leInteger, gtInteger, ltInteger, geInteger, compareInteger, -+ divInteger, modInteger, - divModInteger, quotRemInteger, quotInteger, remInteger, - encodeFloatInteger, decodeFloatInteger, floatFromInteger, - encodeDoubleInteger, decodeDoubleInteger, doubleFromInteger, -diff --git a/libraries/integer-simple/GHC/Integer/Type.hs b/libraries/integer-simple/GHC/Integer/Type.hs -index c3d812c..67ed19c 100644 ---- a/libraries/integer-simple/GHC/Integer/Type.hs -+++ b/libraries/integer-simple/GHC/Integer/Type.hs -@@ -7,7 +7,7 @@ - ----------------------------------------------------------------------------- - -- | - -- Module : GHC.Integer.Type ---- Copyright : (c) Ian Lynagh 2007-2008 -+-- Copyright : (c) Ian Lynagh 2007-2012 - -- License : BSD3 - -- - -- Maintainer : igloo@earth.li -@@ -370,6 +370,16 @@ n `divModInteger` d = - then (# q `minusInteger` oneInteger, r `plusInteger` d #) - else (# q, r #) - -+{-# NOINLINE divInteger #-} -+divInteger :: Integer -> Integer -> Integer -+n `divInteger` d = quotient -+ where (# quotient, _ #) = n `divModInteger` d -+ -+{-# NOINLINE modInteger #-} -+modInteger :: Integer -> Integer -> Integer -+n `modInteger` d = modulus -+ where (# _, modulus #) = n `divModInteger` d -+ - {-# NOINLINE quotRemInteger #-} - quotRemInteger :: Integer -> Integer -> (# Integer, Integer #) - Naught `quotRemInteger` (!_) = (# Naught, Naught #) diff --git a/dev-lang/ghc/files/ghc-7.6.3-trac-3333-weak-syms.patch b/dev-lang/ghc/files/ghc-7.6.3-trac-3333-weak-syms.patch deleted file mode 100644 index c3184a68c1e7..000000000000 --- a/dev-lang/ghc/files/ghc-7.6.3-trac-3333-weak-syms.patch +++ /dev/null @@ -1,387 +0,0 @@ -The patch set adds support for weak symbols to ghci. - -For gentoo it fixes nonworking ghci / template haskell -for package base. - -Steps to reproduce: - 1. CFLAGS=-Os emerge ghc - 2. ghci -package base - Loading package base ... linking ... ghc: /usr/lib64/ghc-7.6.3/base-4.6.0.1/HSbase-4.6.0.1.o: unknown symbol `stat' - -When built with -O2 weak 'stat' resolved to '__xstat' and we don't see any errors. -But on olwer optimization levels 'stat' remains. - -Patches-by: akio -Gentoo-bug: http://bugs.gentoo.org/452442 -Upstream-bug: http://ghc.haskell.org/trac/ghc/ticket/3333 - -From 500d57d3a18412c78cab5abc4d91f1564edc964d Mon Sep 17 00:00:00 2001 -From: Takano Akio <aljee@hyper.cx> -Date: Sat, 29 Dec 2012 11:47:22 +0900 -Subject: [PATCH 1/3] Linker.c: remove stablehash, which is no longer used - ---- - includes/rts/Linker.h | 3 --- - rts/Linker.c | 31 ++----------------------------- - 2 files changed, 2 insertions(+), 32 deletions(-) - -diff --git a/includes/rts/Linker.h b/includes/rts/Linker.h -index e900e85..d20ebc2 100644 ---- a/includes/rts/Linker.h -+++ b/includes/rts/Linker.h -@@ -23,9 +23,6 @@ typedef char pathchar; - /* initialize the object linker */ - void initLinker( void ); - --/* insert a stable symbol in the hash table */ --void insertStableSymbol(pathchar* obj_name, char* key, StgPtr data); -- - /* insert a symbol in the hash table */ - void insertSymbol(pathchar* obj_name, char* key, void* data); - -diff --git a/rts/Linker.c b/rts/Linker.c -index fa1de89..513fe3f 100644 ---- a/rts/Linker.c -+++ b/rts/Linker.c -@@ -30,1 +30,0 @@ --#include "Stable.h" -@@ -150,9 +149,6 @@ int dynamicByDefault = 0; - /* Hash table mapping symbol names to Symbol */ - static /*Str*/HashTable *symhash; - --/* Hash table mapping symbol names to StgStablePtr */ --static /*Str*/HashTable *stablehash; -- - /* List of currently loaded objects */ - ObjectCode *objects = NULL; /* initially empty */ - -@@ -1126,1 +1126,0 @@ typedef struct _RtsSymbolVal { -- SymI_HasProto(insertStableSymbol) \ -@@ -1488,7 +1483,6 @@ initLinker( void ) - #if defined(THREADED_RTS) && (defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO)) - initMutex(&dl_mutex); - #endif -- stablehash = allocStrHashTable(); - symhash = allocStrHashTable(); - - /* populate the symbol table with stuff from the RTS */ -@@ -1817,17 +1811,6 @@ error: - } - - /* ----------------------------------------------------------------------------- -- * insert a stable symbol in the hash table -- */ -- --void --insertStableSymbol(pathchar* obj_name, char* key, StgPtr p) --{ -- ghciInsertStrHashTable(obj_name, stablehash, key, getStablePtr(p)); --} -- -- --/* ----------------------------------------------------------------------------- - * insert a symbol in the hash table - */ - void -@@ -4749,8 +4732,6 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, - #ifdef i386_HOST_ARCH - Elf_Addr value; - #endif -- StgStablePtr stablePtr; -- StgPtr stableVal; - #ifdef arm_HOST_ARCH - int is_target_thm=0, T=0; - #endif -@@ -4773,16 +4754,8 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, - - } else { - symbol = strtab + sym.st_name; -- stablePtr = (StgStablePtr)lookupHashTable(stablehash, (StgWord)symbol); -- if (NULL == stablePtr) { -- /* No, so look up the name in our global table. */ -- S_tmp = lookupSymbol( symbol ); -- S = (Elf_Addr)S_tmp; -- } else { -- stableVal = deRefStablePtr( stablePtr ); -- S_tmp = stableVal; -- S = (Elf_Addr)S_tmp; -- } -+ S_tmp = lookupSymbol( symbol ); -+ S = (Elf_Addr)S_tmp; - } - if (!S) { - errorBelch("%s: unknown symbol `%s'", oc->fileName, symbol); --- -1.7.9.5 - -From 2e5e0f7a90dd390adc5ae5fb2a3bc6e879aa42d6 Mon Sep 17 00:00:00 2001 -From: Takano Akio <aljee@hyper.cx> -Date: Sat, 29 Dec 2012 11:59:34 +0900 -Subject: [PATCH 2/3] ghci: add support for ELF weak symbols - ---- - rts/Linker.c | 102 ++++++++++++++++++++++++++++++++++++++++++++-------------- - 1 file changed, 78 insertions(+), 24 deletions(-) - -diff --git a/rts/Linker.c b/rts/Linker.c -index 513fe3f..5105085 100644 ---- a/rts/Linker.c -+++ b/rts/Linker.c -@@ -146,7 +146,13 @@ int dynamicByDefault = 1; - int dynamicByDefault = 0; - #endif - --/* Hash table mapping symbol names to Symbol */ -+typedef struct _RtsSymbolInfo { -+ void *value; -+ const ObjectCode *owner; -+ HsBool weak; -+} RtsSymbolInfo; -+ -+/* Hash table mapping symbol names to RtsSymbolInfo */ - static /*Str*/HashTable *symhash; - - /* List of currently loaded objects */ -@@ -1415,15 +1421,31 @@ static RtsSymbolVal rtsSyms[] = { - * Insert symbols into hash tables, checking for duplicates. - */ - --static void ghciInsertStrHashTable ( pathchar* obj_name, -- HashTable *table, -- char* key, -- void *data -- ) -+static void ghciInsertSymbolTable( -+ pathchar* obj_name, -+ HashTable *table, -+ char* key, -+ void *data, -+ HsBool weak, -+ ObjectCode *owner) - { -- if (lookupHashTable(table, (StgWord)key) == NULL) -+ RtsSymbolInfo *pinfo = lookupStrHashTable(table, key); -+ if (!pinfo) /* new entry */ -+ { -+ pinfo = stgMallocBytes(sizeof (*pinfo), "ghciInsertToSymbolTable"); -+ pinfo->value = data; -+ pinfo->owner = owner; -+ pinfo->weak = weak; -+ insertStrHashTable(table, key, pinfo); -+ return; -+ } else if ((!pinfo->weak || pinfo->value) && weak) { -+ return; /* duplicate weak symbol, throw it away */ -+ } else if (pinfo->weak) /* weak symbol is in the table */ - { -- insertStrHashTable(table, (StgWord)key, data); -+ /* override the weak definition with the non-weak one */ -+ pinfo->value = data; -+ pinfo->owner = owner; -+ pinfo->weak = HS_BOOL_FALSE; - return; - } - debugBelch( -@@ -1444,6 +1466,32 @@ static void ghciInsertStrHashTable ( pathchar* obj_name, - ); - stg_exit(1); - } -+ -+static HsBool ghciLookupSymbolTable(HashTable *table, -+ const char *key, void **result) -+{ -+ RtsSymbolInfo *pinfo = lookupStrHashTable(table, key); -+ if (!pinfo) { -+ *result = NULL; -+ return HS_BOOL_FALSE; -+ } -+ if (pinfo->weak) -+ IF_DEBUG(linker, debugBelch("lookup: promoting %s\n", key)); -+ /* Once it's looked up, it can no longer be overridden */ -+ pinfo->weak = HS_BOOL_FALSE; -+ -+ *result = pinfo->value; -+ return HS_BOOL_TRUE; -+} -+ -+static void ghciRemoveSymbolTable(HashTable *table, const char *key, -+ ObjectCode *owner) -+{ -+ RtsSymbolInfo *pinfo = lookupStrHashTable(table, key); -+ if (!pinfo || owner != pinfo->owner) return; -+ removeStrHashTable(table, key, NULL); -+ stgFree(pinfo); -+} - /* ----------------------------------------------------------------------------- - * initialize the object linker - */ -@@ -1487,8 +1535,8 @@ initLinker( void ) - - /* populate the symbol table with stuff from the RTS */ - for (sym = rtsSyms; sym->lbl != NULL; sym++) { -- ghciInsertStrHashTable(WSTR("(GHCi built-in symbols)"), -- symhash, sym->lbl, sym->addr); -+ ghciInsertSymbolTable(WSTR("(GHCi built-in symbols)"), -+ symhash, sym->lbl, sym->addr, HS_BOOL_FALSE, NULL); - IF_DEBUG(linker, debugBelch("initLinker: inserting rts symbol %s, %p\n", sym->lbl, sym->addr)); - } - # if defined(OBJFORMAT_MACHO) && defined(powerpc_HOST_ARCH) -@@ -1816,7 +1864,7 @@ error: - void - insertSymbol(pathchar* obj_name, char* key, void* data) - { -- ghciInsertStrHashTable(obj_name, symhash, key, data); -+ ghciInsertSymbolTable(obj_name, symhash, key, data, HS_BOOL_FALSE, NULL); - } - - /* ----------------------------------------------------------------------------- -@@ -1829,9 +1877,8 @@ lookupSymbol( char *lbl ) - IF_DEBUG(linker, debugBelch("lookupSymbol: looking up %s\n", lbl)); - initLinker() ; - ASSERT(symhash != NULL); -- val = lookupStrHashTable(symhash, lbl); - -- if (val == NULL) { -+ if (!ghciLookupSymbolTable(symhash, lbl, &val)) { - IF_DEBUG(linker, debugBelch("lookupSymbol: symbol not found\n")); - # if defined(OBJFORMAT_ELF) - return internal_dlsym(dl_prog_handle, lbl); -@@ -1903,7 +1950,7 @@ void ghci_enquire ( char* addr ) - if (sym == NULL) continue; - a = NULL; - if (a == NULL) { -- a = lookupStrHashTable(symhash, sym); -+ ghciLookupSymbolTable(symhash, sym, (void **)&a); - } - if (a == NULL) { - // debugBelch("ghci_enquire: can't find %s\n", sym); -@@ -2715,7 +2762,7 @@ unloadObj( pathchar *path ) - int i; - for (i = 0; i < oc->n_symbols; i++) { - if (oc->symbols[i] != NULL) { -- removeStrHashTable(symhash, oc->symbols[i], NULL); -+ ghciRemoveSymbolTable(symhash, oc->symbols[i], oc); - } - } - } -@@ -3802,7 +3849,8 @@ ocGetNames_PEi386 ( ObjectCode* oc ) - ASSERT(i >= 0 && i < oc->n_symbols); - /* cstring_from_COFF_symbol_name always succeeds. */ - oc->symbols[i] = (char*)sname; -- ghciInsertStrHashTable(oc->fileName, symhash, (char*)sname, addr); -+ ghciInsertSymbolTable(oc->fileName, symhash, (char*)sname, addr, -+ HS_BOOL_FALSE, oc); - } else { - # if 0 - debugBelch( -@@ -4595,6 +4643,7 @@ ocGetNames_ELF ( ObjectCode* oc ) - for (j = 0; j < nent; j++) { - - char isLocal = FALSE; /* avoids uninit-var warning */ -+ HsBool isWeak = HS_BOOL_FALSE; - char* ad = NULL; - char* nm = strtab + stab[j].st_name; - int secno = stab[j].st_shndx; -@@ -4615,6 +4664,7 @@ ocGetNames_ELF ( ObjectCode* oc ) - else - if ( ( ELF_ST_BIND(stab[j].st_info)==STB_GLOBAL - || ELF_ST_BIND(stab[j].st_info)==STB_LOCAL -+ || ELF_ST_BIND(stab[j].st_info)==STB_WEAK - ) - /* and not an undefined symbol */ - && stab[j].st_shndx != SHN_UNDEF -@@ -4638,7 +4688,8 @@ ocGetNames_ELF ( ObjectCode* oc ) - ad = ehdrC + shdr[ secno ].sh_offset + stab[j].st_value; - if (ELF_ST_BIND(stab[j].st_info)==STB_LOCAL) { - isLocal = TRUE; -- } else { -+ isWeak = FALSE; -+ } else { /* STB_GLOBAL or STB_WEAK */ - #ifdef ELF_FUNCTION_DESC - /* dlsym() and the initialisation table both give us function - * descriptors, so to be consistent we store function descriptors -@@ -4649,6 +4700,7 @@ ocGetNames_ELF ( ObjectCode* oc ) - IF_DEBUG(linker,debugBelch( "addOTabName(GLOB): %10p %s %s\n", - ad, oc->fileName, nm )); - isLocal = FALSE; -+ isWeak = (ELF_ST_BIND(stab[j].st_info)==STB_WEAK); - } - } - -@@ -4661,7 +4713,7 @@ ocGetNames_ELF ( ObjectCode* oc ) - if (isLocal) { - /* Ignore entirely. */ - } else { -- ghciInsertStrHashTable(oc->fileName, symhash, nm, ad); -+ ghciInsertSymbolTable(oc->fileName, symhash, nm, ad, isWeak, oc); - } - } else { - /* Skip. */ -@@ -6306,11 +6358,13 @@ ocGetNames_MachO(ObjectCode* oc) - else - { - IF_DEBUG(linker, debugBelch("ocGetNames_MachO: inserting %s\n", nm)); -- ghciInsertStrHashTable(oc->fileName, symhash, nm, -+ ghciInsertSymbolTable(oc->fileName, symhash, nm, - image - + sections[nlist[i].n_sect-1].offset - - sections[nlist[i].n_sect-1].addr -- + nlist[i].n_value); -+ + nlist[i].n_value, -+ HS_BOOL_FALSE, -+ oc); - oc->symbols[curSymbol++] = nm; - } - } -@@ -6341,8 +6395,8 @@ ocGetNames_MachO(ObjectCode* oc) - nlist[i].n_value = commonCounter; - - IF_DEBUG(linker, debugBelch("ocGetNames_MachO: inserting common symbol: %s\n", nm)); -- ghciInsertStrHashTable(oc->fileName, symhash, nm, -- (void*)commonCounter); -+ ghciInsertSymbolTable(oc->fileName, symhash, nm, -+ (void*)commonCounter, HS_BOOL_FALSE, oc); - oc->symbols[curSymbol++] = nm; - - commonCounter += sz; -@@ -6466,7 +6520,7 @@ machoInitSymbolsWithoutUnderscore(void) - - #undef SymI_NeedsProto - #define SymI_NeedsProto(x) \ -- ghciInsertStrHashTable("(GHCi built-in symbols)", symhash, #x, *p++); -+ ghciInsertSymbolTable("(GHCi built-in symbols)", symhash, #x, *p++, HS_BOOL_FALSE, NULL); - - RTS_MACHO_NOUNDERLINE_SYMBOLS - --- -1.7.9.5 - -From 916d7713b34b529ae7ec24eaa836a4eaca7724fc Mon Sep 17 00:00:00 2001 -From: Takano Akio <aljee@hyper.cx> -Date: Sun, 6 Jan 2013 17:51:19 +0900 -Subject: [PATCH 3/3] Linker.c: add dso_handle to the symbol table - ---- - rts/Linker.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/rts/Linker.c b/rts/Linker.c -index 5105085..0b2bf63 100644 ---- a/rts/Linker.c -+++ b/rts/Linker.c -@@ -1542,6 +1542,13 @@ initLinker( void ) - # if defined(OBJFORMAT_MACHO) && defined(powerpc_HOST_ARCH) - machoInitSymbolsWithoutUnderscore(); - # endif -+ /* GCC defines a special symbol __dso_handle which is resolved to NULL if -+ referenced from a statically linked module. We need to mimic this, but -+ we cannot use NULL because we use it to mean nonexistent symbols. So we -+ use an arbitrary (hopefully unique) address here. -+ */ -+ ghciInsertSymbolTable(WSTR("(GHCi special symbols)"), -+ symhash, "__dso_handle", (void *)0x12345687, HS_BOOL_FALSE, NULL); - - # if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO) - # if defined(RTLD_DEFAULT) --- -1.7.9.5 - 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 deleted file mode 100644 index 032dc9a67624..000000000000 --- a/dev-lang/ghc/files/ghc-7.8.3-cc-lang.patch +++ /dev/null @@ -1,129 +0,0 @@ -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 deleted file mode 100644 index 8deec21edc5c..000000000000 --- a/dev-lang/ghc/files/ghc-7.8.3-deRefStablePtr.patch +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100644 index 9026ecfdf4b1..000000000000 --- a/dev-lang/ghc/files/ghc-7.8.3-ia64-prim.patch +++ /dev/null @@ -1,69 +0,0 @@ -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-pic-asm.patch b/dev-lang/ghc/files/ghc-7.8.3-pic-asm.patch deleted file mode 100644 index 10c41d5b29f6..000000000000 --- a/dev-lang/ghc/files/ghc-7.8.3-pic-asm.patch +++ /dev/null @@ -1,107 +0,0 @@ -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-unreg-lit.patch b/dev-lang/ghc/files/ghc-7.8.3-unreg-lit.patch deleted file mode 100644 index 632696d6fde7..000000000000 --- a/dev-lang/ghc/files/ghc-7.8.3-unreg-lit.patch +++ /dev/null @@ -1,84 +0,0 @@ -commit a6ea05e21e175407dc9e45f18c56c1d727fd0f26 -Author: Sergei Trofimovich <slyfox@gentoo.org> -Date: Fri Aug 22 23:24:32 2014 +0300 - - UNREG: fix emission of large Integer literals in C codegen - - Summary: - On amd64/UNREG build there is many failing tests trying - to deal with 'Integer' types. - - Looking at 'overflow1' test I've observed invalid C code generated by - GHC. - - Cmm code - CInt a = -1; (a == -1) - yields 'False' with optimisations enabled via the following C code: - StgWord64 a = (StgWord32)0xFFFFffffFFFFffffu; (a == 0xFFFFffffFFFFffffu) - - The patch fixes it by shrinking emitted literals to required sizes: - StgWord64 a = (StgWord32)0xFFFFffffu; (a == 0xFFFFffffu) - - Thanks to Reid Barton for tracking down and fixing the issue. - - Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> - - Test Plan: validate on UNREG build (amd64) - - Reviewers: simonmar, rwbarton, austin - - Subscribers: simonmar, ezyang, carter - - Differential Revision: https://phabricator.haskell.org/D173 - -diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs -index 93a5d06..8605988 100644 ---- a/compiler/cmm/PprC.hs -+++ b/compiler/cmm/PprC.hs -@@ -1221,8 +1221,9 @@ commafy xs = hsep $ punctuate comma xs - pprHexVal :: Integer -> Width -> SDoc - pprHexVal 0 _ = ptext (sLit "0x0") - pprHexVal w rep -- | w < 0 = parens (char '-' <> ptext (sLit "0x") <> go (-w) <> repsuffix rep) -- | otherwise = ptext (sLit "0x") <> go w <> repsuffix rep -+ | w < 0 = parens (char '-' <> -+ ptext (sLit "0x") <> intToDoc (-w) <> repsuffix rep) -+ | otherwise = ptext (sLit "0x") <> intToDoc w <> repsuffix rep - where - -- type suffix for literals: - -- Integer literals are unsigned in Cmm/C. We explicitly cast to -@@ -1237,10 +1238,33 @@ pprHexVal w rep - else panic "pprHexVal: Can't find a 64-bit type" - repsuffix _ = char 'U' - -+ intToDoc :: Integer -> SDoc -+ intToDoc i = go (truncInt i) -+ -+ -- We need to truncate value as Cmm backend does not drop -+ -- redundant bits to ease handling of negative values. -+ -- Thus the following Cmm code on 64-bit arch, like amd64: -+ -- CInt v; -+ -- v = {something}; -+ -- if (v == %lobits32(-1)) { ... -+ -- leads to the following C code: -+ -- StgWord64 v = (StgWord32)({something}); -+ -- if (v == 0xFFFFffffFFFFffffU) { ... -+ -- Such code is incorrect as it promotes both operands to StgWord64 -+ -- and the whole condition is always false. -+ truncInt :: Integer -> Integer -+ truncInt i = -+ case rep of -+ W8 -> i `rem` (2^(8 :: Int)) -+ W16 -> i `rem` (2^(16 :: Int)) -+ W32 -> i `rem` (2^(32 :: Int)) -+ W64 -> i `rem` (2^(64 :: Int)) -+ _ -> panic ("pprHexVal/truncInt: C backend can't encode " -+ ++ show rep ++ " literals") -+ - go 0 = empty - go w' = go q <> dig - where - (q,r) = w' `quotRem` 16 - dig | r < 10 = char (chr (fromInteger r + ord '0')) - | otherwise = char (chr (fromInteger r - 10 + ord 'a')) -- diff --git a/dev-lang/ghc/files/terminfo-0.3.2.5-tinfo.patch b/dev-lang/ghc/files/terminfo-0.3.2.5-tinfo.patch deleted file mode 100644 index ca10da2e03ae..000000000000 --- a/dev-lang/ghc/files/terminfo-0.3.2.5-tinfo.patch +++ /dev/null @@ -1,25 +0,0 @@ -http://bugs.gentoo.org/454216 - -Mon Jan 7 16:34:47 FET 2013 Judah Jacobson <judah.jacobson@gmail.com> - * Search for terminfo in libtinfo; fixes GHC #7281. - - Patch from Paul Johnson. -diff -rN -u old-terminfo/configure.ac new-terminfo/configure.ac ---- old-terminfo/configure.ac 2013-02-14 00:16:11.816111434 +0300 -+++ new-terminfo/configure.ac 2013-02-14 00:16:11.819111434 +0300 -@@ -39,10 +39,11 @@ - TERMINFO_INCLUDES="$CursesIncludes term.h" - fi - --AC_CHECK_LIB(ncursesw, setupterm, HaveLibCurses=YES; LibCurses=ncursesw, -- [AC_CHECK_LIB(ncurses, setupterm, HaveLibCurses=YES; LibCurses=ncurses, -- [AC_CHECK_LIB(curses, setupterm, HaveLibCurses=YES; LibCurses=curses, -- HaveLibCurses=NO; LibCurses=not-installed)])]) -+AC_CHECK_LIB(tinfo, setupterm, HaveLibCurses=YES; LibCurses=tinfo, -+ [AC_CHECK_LIB(ncursesw, setupterm, HaveLibCurses=YES; LibCurses=ncursesw, -+ [AC_CHECK_LIB(ncurses, setupterm, HaveLibCurses=YES; LibCurses=ncurses, -+ [AC_CHECK_LIB(curses, setupterm, HaveLibCurses=YES; LibCurses=curses, -+ HaveLibCurses=NO; LibCurses=not-installed)])])]) - - if test "x$HaveLibCurses" = "xNO" ; then - AC_MSG_FAILURE([curses library not found, so this package cannot be built]) |