Accepting request 185235 from devel:languages:haskell:platform

Update for Haskell Platform 2013.2.0.0.

OBS-URL: https://build.opensuse.org/request/show/185235
OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=133
This commit is contained in:
Peter Trommler 2013-07-31 16:21:12 +00:00 committed by Git OBS Bridge
parent 8d2dff4617
commit 6d5864aaba
11 changed files with 378 additions and 223 deletions

View File

@ -1,12 +0,0 @@
diff -Nur ghc-7.4.2-fix-7062/rules/build-package-way.mk ghc-7.4.2-extra-libdir/rules/build-package-way.mk
--- ghc-7.4.2-fix-7062/rules/build-package-way.mk 2012-07-30 08:59:49.000000000 +0200
+++ ghc-7.4.2-extra-libdir/rules/build-package-way.mk 2012-07-30 09:01:38.000000000 +0200
@@ -74,7 +74,7 @@
"$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_ALL_OBJS) \
-shared -dynamic -dynload deploy \
-dylib-install-name $(ghclibdir)/`basename "$$@" | sed 's/^libHS//;s/[-]ghc.*//'`/`basename "$$@"` \
- $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) \
+ $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) $$(addprefix -L,$$($1_$2_EXTRA_LIBDIRS))\
-no-auto-link-packages \
-o $$@
endif

View File

@ -1,33 +0,0 @@
diff -u ghc-7.2.0.20110728/libraries/Cabal/cabal/Distribution/Simple/GHC.hs.orig ghc-7.2.0.20110728/libraries/Cabal/cabal/Distribution/Simple/GHC.hs
--- ghc-7.2.0.20110728/libraries/Cabal/Cabal/Distribution/Simple/GHC.hs.orig 2011-07-29 02:12:09.000000000 +0900
+++ ghc-7.2.0.20110728/libraries/Cabal/Cabal/Distribution/Simple/GHC.hs 2011-08-05 18:08:05.192042529 +0900
@@ -778,7 +778,10 @@
++ ["-L"++libDir | libDir <- extraLibDirs exeBi]
++ concat [["-framework", f] | f <- PD.frameworks exeBi]
++ if dynExe
- then ["-dynamic"]
+ then ["-dynamic",
+ "-hisuf", "dyn_hi",
+ "-osuf", "dyn_o"
+ ]
else []
++ if profExe
then ["-prof",
@@ -787,13 +790,14 @@
] ++ ghcProfOptions exeBi
else []
- -- For building exe's for profiling that use TH we actually
+ -- For building exe's for profiling or dynamic that use TH we actually
-- have to build twice, once without profiling and the again
-- with profiling. This is because the code that TH needs to
-- run at compile time needs to be the vanilla ABI so it can
-- be loaded up and run by the compiler.
- when (withProfExe lbi && EnableExtension TemplateHaskell `elem` allExtensions exeBi)
- (runGhcProg (binArgs False (withDynExe lbi) False))
+ when ((withProfExe lbi || withDynExe lbi) &&
+ EnableExtension TemplateHaskell `elem` allExtensions exeBi)
+ (runGhcProg (binArgs False False False))
runGhcProg (binArgs True (withDynExe lbi) (withProfExe lbi))

View File

@ -1,12 +0,0 @@
diff -u ghc-6.12.1/libraries/gen_contents_index\~ ghc-6.12.1/libraries/gen_contents_index
--- ghc-6.12.1/libraries/gen_contents_index~ 2009-12-11 04:11:33.000000000 +1000
+++ ghc-6.12.1/libraries/gen_contents_index 2009-12-12 21:08:02.000000000 +1000
@@ -20,7 +20,7 @@
done
;;
*)
- HADDOCK=../../../../../bin/haddock
+ HADDOCK=/usr/bin/haddock
# We don't want the GHC API to swamp the index
HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort`
for HADDOCK_FILE in $HADDOCK_FILES

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f2ee1289a33cc70539287129841acc7eaf16112bb60c59b5a6ee91887bfd836d
size 25836446

3
ghc-7.6.3-src.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bd43823d31f6b5d0b2ca7b74151a8f98336ab0800be85f45bb591c9c26aac998
size 110763823

View File

@ -1,11 +0,0 @@
diff -Nur ghc-7.4.2/rules/build-package-way.mk ghc-7.4.2-fix-7062/rules/build-package-way.mk
--- ghc-7.4.2/rules/build-package-way.mk 2012-06-06 19:10:25.000000000 +0200
+++ ghc-7.4.2-fix-7062/rules/build-package-way.mk 2012-07-30 08:59:49.000000000 +0200
@@ -74,6 +74,7 @@
"$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_ALL_OBJS) \
-shared -dynamic -dynload deploy \
-dylib-install-name $(ghclibdir)/`basename "$$@" | sed 's/^libHS//;s/[-]ghc.*//'`/`basename "$$@"` \
+ $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) \
-no-auto-link-packages \
-o $$@
endif

View File

@ -1,12 +0,0 @@
diff -u ghc-6.12.3/libraries/gen_contents_index\~ ghc-6.12.3/libraries/gen_contents_index
--- ghc-6.12.3/libraries/gen_contents_index~ 2010-09-14 13:03:12.000000000 +1000
+++ ghc-6.12.3/libraries/gen_contents_index 2010-11-04 16:41:32.000000000 +1000
@@ -24,7 +24,7 @@
*)
HADDOCK=/usr/bin/haddock
# We don't want the GHC API to swamp the index
- HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort`
+ HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | grep -v '/type-level\.haddock' | sort`
for HADDOCK_FILE in $HADDOCK_FILES
do
NAME_VERSION=`echo "$HADDOCK_FILE" | sed 's#/.*##'`

View File

@ -1,7 +1,8 @@
diff -Nur ghc-7.4.2/aclocal.m4 ghc-7.4.2-fix-rpath/aclocal.m4 Index: ghc-7.6.3/aclocal.m4
--- ghc-7.4.2/aclocal.m4 2012-06-06 19:10:25.000000000 +0200 ===================================================================
+++ ghc-7.4.2-fix-rpath/aclocal.m4 2012-07-27 21:01:32.000000000 +0200 --- ghc-7.6.3.orig/aclocal.m4
@@ -437,6 +437,13 @@ +++ ghc-7.6.3/aclocal.m4
@@ -465,6 +465,13 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$4="$$4 $LdReduceMemoryOverheads" $4="$$4 $LdReduceMemoryOverheads"
fi fi
@ -15,7 +16,7 @@ diff -Nur ghc-7.4.2/aclocal.m4 ghc-7.4.2-fix-rpath/aclocal.m4
rm -f conftest.c conftest.o rm -f conftest.c conftest.o
AC_MSG_RESULT([done]) AC_MSG_RESULT([done])
]) ])
@@ -833,6 +840,17 @@ @@ -894,6 +901,17 @@ FP_PROG_LD_FLAG([--reduce-memory-overhea
])# FP_PROG_LD_ReduceMemoryOverheads ])# FP_PROG_LD_ReduceMemoryOverheads
@ -33,10 +34,11 @@ diff -Nur ghc-7.4.2/aclocal.m4 ghc-7.4.2-fix-rpath/aclocal.m4
# FP_PROG_LD_BUILD_ID # FP_PROG_LD_BUILD_ID
# ------------ # ------------
diff -Nur ghc-7.4.2/configure.ac ghc-7.4.2-fix-rpath/configure.ac Index: ghc-7.6.3/configure.ac
--- ghc-7.4.2/configure.ac 2012-06-06 19:10:25.000000000 +0200 ===================================================================
+++ ghc-7.4.2-fix-rpath/configure.ac 2012-07-27 20:57:16.000000000 +0200 --- ghc-7.6.3.orig/configure.ac
@@ -426,6 +426,8 @@ +++ ghc-7.6.3/configure.ac
@@ -597,6 +597,8 @@ FP_CC_LLVM_BACKEND
FP_PROG_LD_HashSize31 FP_PROG_LD_HashSize31
FP_PROG_LD_ReduceMemoryOverheads FP_PROG_LD_ReduceMemoryOverheads

View File

@ -1,83 +1,298 @@
This patch could be replaced by a configure call if diff --git a/configure.ac b/configure.ac
http://hackage.haskell.org/trac/ghc/ticket/5743 were fixed. index e43a59b..fc67ca7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,6 +89,57 @@ AC_ARG_WITH([ghc],
fi
WithGhc="$GHC"])
Index: ghc-7.4.0.20111219/rts/package.conf.in +# system libffi
=================================================================== +
--- ghc-7.4.0.20111219.orig/rts/package.conf.in 2011-12-21 23:21:03.000000000 +0100 +AC_ARG_WITH([system-libffi],
+++ ghc-7.4.0.20111219/rts/package.conf.in 2011-12-21 23:21:04.000000000 +0100 +[AC_HELP_STRING([--with-system-libffi=ARG],
@@ -24,8 +24,9 @@ + [Use system provided module ARG for libffi for RTS [default=no]])
hs-libraries: "HSrts" +])
+
+AS_IF([test "x$with_system_libffi" = "xyes"], [
+ with_system_libffi=libffi])
+
+AS_IF([test "x$with_system_libffi" = "x" ], [
+ with_system_libffi=no])
+
+AS_IF([test "x$with_system_libffi" = "xno"], [
+ UseSystemLibFFI="NO"
+ FFIIncludeDir=
+ FFILibDir=
+ LIBFFI_CFLAGS=
+ LIBFFI_LIBS="-optl -Wl,-rpath=\${ghclibdir} -Lrts/dist/build -lffi"
+])
+
+# Should use this but we cannot run aclocal as it would overwrite
+# FP_* macros in aclocal.m4
+# PKG_CHECK_MODULES([LIBFFI], [libffi])
+
+AS_IF([test "x$with_system_libffi" != "xno"], [
+ UseSystemLibFFI="YES"
+ FFIIncludeDir=`pkg-config --variable=includedir $with_system_libffi`
+ FFILibDir=`pkg-config --variable=libdir $with_system_libffi`
+ LIBFFI_CFLAGS=`pkg-config --cflags $with_system_libffi`
+ LIBFFI_LIBS=`pkg-config --libs $with_system_libffi`
+# temporarily set CFLAGS and LIBS
+ CFLAGS2="$CFLAGS"
+ CFLAGS="$LIBFFI_CFLAGS"
+ LIBS2="$LIBS"
+ LIBS="$LIBFFI_LIBS"
+ AS_IF([test "$UseSystemLibFFI" = "YES"], [
+ AC_CHECK_LIB(ffi, ffi_call,
+ [AC_CHECK_HEADERS([ffi/ffi.h ffi.h], [break], [])
+ AC_DEFINE([HAVE_LIBFFI], [1], [Define to 1 if you have libffi.])],
+ [UseSystemLibFFI="NO"])])
+ CFLAGS="$CFLAGS2"
+ LIBS="$LIBS2"
+])
+
+
+AC_SUBST(UseSystemLibFFI)
+AC_SUBST(FFIIncludeDir)
+AC_SUBST(FFILibDir)
+AC_SUBST(LIBFFI_CFLAGS)
+AC_SUBST(LIBFFI_LIBS)
extra-libraries: dnl ** Tell the make system which OS we are using
+ "ffi" dnl $OSTYPE is set by the operating system to "msys" or "cygwin" or something
#ifdef HAVE_LIBM diff --git a/ghc.mk b/ghc.mk
- "m" /* for ldexp() */ index 48d247a..eed3fa5 100644
+ , "m" /* for ldexp() */ --- a/ghc.mk
#endif +++ b/ghc.mk
#ifdef HAVE_LIBRT @@ -52,7 +52,7 @@
, "rt" # * For each package:
Index: ghc-7.4.0.20111219/ghc.mk # o configure, generate package-data.mk and inplace-pkg-info
=================================================================== # o register each package into inplace/lib/package.conf
--- ghc-7.4.0.20111219.orig/ghc.mk 2011-12-21 23:21:03.000000000 +0100 -# * build libffi
+++ ghc-7.4.0.20111219/ghc.mk 2011-12-21 23:21:04.000000000 +0100 +# * build libffi (if not disabled by --with-system-libffi)
@@ -579,7 +579,6 @@ # * With bootstrapping compiler:
driver/ghci \ # o Build libraries/{filepath,hpc,Cabal}
# o Build compiler (stage 1)
@@ -595,12 +595,18 @@ else
MAYBE_GHCI=driver/ghci
endif
+ifeq "$(UseSystemLibFFI)" "YES"
+MAYBE_LIBFFI=
+else
+MAYBE_LIBFFI=libffi
+endif
+
BUILD_DIRS += \
driver \
$(MAYBE_GHCI) \
driver/ghc \ driver/ghc \
driver/haddock \ driver/haddock \
- libffi \ - libffi \
+ $(MAYBE_LIBFFI) \
includes \ includes \
rts rts
Index: ghc-7.4.0.20111219/rts/ghc.mk @@ -994,10 +1000,11 @@ endif
===================================================================
--- ghc-7.4.0.20111219.orig/rts/ghc.mk 2011-12-21 19:56:29.000000000 +0100
+++ ghc-7.4.0.20111219/rts/ghc.mk 2011-12-21 23:23:52.000000000 +0100
@@ -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 BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindist.mk
define make-importlib-def # args $1 = lib name
@@ -172,12 +171,12 @@ +# don't include libffi when building with system libffi
unix-binary-dist-prep:
$(call removeTrees,bindistprep/)
"$(MKDIRHIER)" $(BIN_DIST_PREP_DIR)
- set -e; for i in packages LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh settings.in ghc.mk inplace distrib/configure.ac distrib/README distrib/INSTALL; do ln -s ../../$$i $(BIN_DIST_PREP_DIR)/; done
+ set -e; for i in packages LICENSE compiler ghc rts libraries utils docs $(MAYBE_LIBFFI) includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh settings.in ghc.mk inplace distrib/configure.ac distrib/README distrib/INSTALL; do ln -s ../../$$i $(BIN_DIST_PREP_DIR)/; done
echo "HADDOCK_DOCS = $(HADDOCK_DOCS)" >> $(BIN_DIST_MK)
echo "LATEX_DOCS = $(LATEX_DOCS)" >> $(BIN_DIST_MK)
echo "BUILD_DOCBOOK_HTML = $(BUILD_DOCBOOK_HTML)" >> $(BIN_DIST_MK)
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 81298e4..258cdc0 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -362,6 +362,16 @@ GhcRtsWithPapi = NO
PapiLibDir=
PapiIncludeDir=
+# Configuration for libffi
+UseSystemLibFFI=@UseSystemLibFFI@
+# Flags to go into package.conf for rts
+FFILibDir=@FFILibDir@
+FFIIncludeDir=@FFIIncludeDir@
+# gcc flags needed for libffi
+LIBFFI_CFLAGS=@LIBFFI_CFLAGS@
+LIBFFI_LIBS=@LIBFFI_LIBS@
+
+
################################################################################
#
# Paths (see paths.mk)
diff --git a/rts/Adjustor.c b/rts/Adjustor.c
index 1a0bc28..e088dce 100644
--- a/rts/Adjustor.c
+++ b/rts/Adjustor.c
@@ -43,7 +43,14 @@ Haskell side.
#include "Stable.h"
#if defined(USE_LIBFFI_FOR_ADJUSTORS)
+#include "ghcconfig.h"
+#ifdef HAVE_FFI_H
+#include <ffi.h>
+#elif defined(HAVE_FFI_FFI_H)
+#include <ffi/ffi.h>
+#else
#include "ffi.h"
+#endif
#include <string.h>
#endif
diff --git a/rts/Interpreter.c b/rts/Interpreter.c
index d879fd3..7819fc9 100644
--- a/rts/Interpreter.c
+++ b/rts/Interpreter.c
@@ -37,7 +37,14 @@
#endif
#endif
+#include "ghcconfig.h"
+#ifdef HAVE_FFI_H
+#include <ffi.h>
+#elif defined(HAVE_FFI_FFI_H)
+#include <ffi/ffi.h>
+#else
#include "ffi.h"
+#endif
/* --------------------------------------------------------------------------
* The bytecode interpreter
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 9fdf6be..408e485 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -104,6 +104,10 @@ $(foreach lib,$(ALL_RTS_DEF_LIBNAMES),$(eval $(call make-importlib-def,$(lib))))
endif
ifneq "$(BINDIST)" "YES"
+ifeq "$(UseSystemLibFFI)" "YES"
+rts_ffi_objs_stamp =
+rts_ffi_objs =
+else
rts_ffi_objs_stamp = rts/dist/ffi/stamp
rts_ffi_objs = rts/dist/ffi/*.o
$(rts_ffi_objs_stamp): $(libffi_STATIC_LIB) $(TOUCH_DEP) | $$(dir $$@)/.
@@ -118,6 +122,7 @@ rts/dist/build/libffi$(soext): libffi/build/inst/lib/libffi$(soext)
rts/dist/build/$(LIBFFI_DLL): libffi/build/inst/bin/$(LIBFFI_DLL)
cp $< $@
endif
+endif
#-----------------------------------------------------------------------------
# Building one way
@@ -174,6 +179,12 @@ endif
rts_dist_$1_CC_OPTS += -DRtsWay=\"rts_$1\"
+ifeq "$(UseSystemLibFFI)" "NO"
+rts_dist_FFI_SO = rts/dist/build/libffi$(soext)
+else
+rts_dist_FFI_SO =
+endif
+
# Making a shared library for the RTS. # Making a shared library for the RTS.
ifneq "$$(findstring dyn, $1)" "" ifneq "$$(findstring dyn, $1)" ""
ifeq "$$(HOSTPLATFORM)" "i386-unknown-mingw32" ifeq "$$(HostOS_CPP)" "mingw32"
-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/build/libffi-5.dll @@ -182,10 +193,10 @@ $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/libs.depend rts/dist/b
+$$(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 \ "$$(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 $$@ -no-auto-link-packages -Lrts/dist/build -l$(LIBFFI_WINDOWS_LIB) `cat rts/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) -o $$@
else 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 rts/dist/build/libffi$$(soext)
+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend +$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend $$(rts_dist_FFI_SO)
"$$(RM)" $$(RM_OPTS) $$@ "$$(RM)" $$(RM_OPTS) $$@
"$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \ "$$(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) \ - -no-auto-link-packages -Lrts/dist/build -lffi `cat rts/libs.depend` $$(rts_$1_OBJS) \
@@ -188,9 +187,9 @@ + -no-auto-link-packages $$(LIBFFI_LIBS) `cat rts/libs.depend` $$(rts_$1_OBJS) \
$$(rts_$1_DTRACE_OBJS) -o $$@
ifeq "$$(darwin_HOST_OS)" "1"
# Ensure library's install name is correct before anyone links with it.
@@ -374,10 +385,11 @@ rts/dist/build/AutoApply_HC_OPTS += -fno-PIC -static
endif endif
endif endif
else
-$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) $$(rts_ffi_objs_stamp) +# add CFLAGS for libffi
+$$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) # ffi.h triggers prototype warnings, so disable them here:
"$$(RM)" $$(RM_OPTS) $$@ -rts/Interpreter_CC_OPTS += -Wno-strict-prototypes
- echo $$(rts_ffi_objs) $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \ -rts/Adjustor_CC_OPTS += -Wno-strict-prototypes
+ echo $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) | "$$(XARGS)" $$(XARGS_OPTS) "$$(AR_STAGE1)" \ -rts/sm/Storage_CC_OPTS += -Wno-strict-prototypes
$$(AR_OPTS_STAGE1) $$(EXTRA_AR_ARGS_STAGE1) $$@ +rts/Interpreter_CC_OPTS += -Wno-strict-prototypes $(LIBFFI_CFLAGS)
+rts/Adjustor_CC_OPTS += -Wno-strict-prototypes $(LIBFFI_CFLAGS)
+rts/sm/Storage_CC_OPTS += -Wno-strict-prototypes $(LIBFFI_CFLAGS)
# inlining warnings happen in Compact
rts/sm/Compact_CC_OPTS += -Wno-inline
@@ -435,6 +447,21 @@ rts_PACKAGE_CPP_OPTS += -DPAPI_LIB_DIR=""
endif endif
@@ -504,10 +503,8 @@ +#-----------------------------------------------------------------------------
# installing +# Use system provided libffi
+
+ifeq "$(UseSystemLibFFI)" "YES"
+
+rts_PACKAGE_CPP_OPTS += -DFFI_INCLUDE_DIR=$(FFIIncludeDir)
+rts_PACKAGE_CPP_OPTS += -DFFI_LIB_DIR=$(FFILibDir)
+
+else # UseSystemLibFFI==YES
+
+rts_PACKAGE_CPP_OPTS += -DFFI_INCLUDE_DIR=""
+rts_PACKAGE_CPP_OPTS += -DFFI_LIB_DIR=""
+
+endif
+
# -----------------------------------------------------------------------------
# dependencies
INSTALL_LIBS += $(ALL_RTS_LIBS) @@ -512,7 +539,11 @@ INSTALL_LIBS += $(ALL_RTS_LIBS)
-INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*) INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
-INSTALL_LIBS += $(wildcard rts/dist/build/libffi-5.dll) INSTALL_LIBS += $(wildcard rts/dist/build/$(LIBFFI_DLL))
-install: install_libffi_headers +ifneq "$(UseSystemLibFFI)" "YES"
install: install_libffi_headers
+else
+install: +install:
+endif
.PHONY: install_libffi_headers .PHONY: install_libffi_headers
install_libffi_headers : install_libffi_headers :
diff --git a/rts/package.conf.in b/rts/package.conf.in
index 727b586..6bf3b50 100644
--- a/rts/package.conf.in
+++ b/rts/package.conf.in
@@ -33,6 +33,9 @@ extra-libraries:
#ifdef HAVE_LIBDL
, "dl"
#endif
+#ifdef HAVE_LIBFFI
+ , "ffi"
+#endif
#ifdef mingw32_HOST_OS
,"wsock32" /* for the linker */
,"gdi32" /* for the linker */
diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c
index f645cd4..0315d6f 100644
--- a/rts/sm/Storage.c
+++ b/rts/sm/Storage.c
@@ -32,7 +32,14 @@
#include <string.h>
+#include "ghcconfig.h"
+#ifdef HAVE_FFI_H
+#include <ffi.h>
+#elif defined(HAVE_FFI_FFI_H)
+#include <ffi/ffi.h>
+#else
#include "ffi.h"
+#endif
/*
* All these globals require sm_mutex to access in THREADED_RTS mode.

View File

@ -1,10 +1,34 @@
------------------------------------------------------------------- -------------------------------------------------------------------
Sun May 19 07:05:39 UTC 2013 - peter.trommler@ohm-hochschule.de Tue Jul 16 15:01:54 UTC 2013 - peter.trommler@ohm-hochschule.de
- ghc-pkg allocates memeory in an infinite loop and then crashes - add comment to explain why glibc-locale is required by
when glibc-locale is not installed, so require glibc-locale for
ghc-compiler ghc-compiler
-------------------------------------------------------------------
Fri May 17 15:53:07 UTC 2013 - peter.trommler@ohm-hochschule.de
- glibc-locale required by ghc-pkg
-------------------------------------------------------------------
Fri May 3 07:38:55 UTC 2013 - peter.trommler@ohm-hochschule.de
- update to 7.6.3 from upstream
- part of Haskell Platform 2013.2
- new languages features (polymorphic kinds, ...)
- do compiler upgrade in one submit request by bootstrapping
ghc if necessary and use that ghc to selfbootstrap new
ghc
- replaced ghc-use-system-libffi.patch with new patch for
Haskell trac #5743 (add configure option to use system libffi)
- drop Cabal-fix-dynamic-exec-for-TH.patch: Fixed upstream
- drop ghc-6.12.1-gen_contents_index-haddock-path.patch which used
system provided haddock and that causes trouble when bootstrapping
- drop ghc-gen_contents_index-type-level.patch: fixed upstream
- drop patch ghc-fix-undefined-openpty.patch: Fixed upstream
- drop patch 0001-Add-missing-flag-for-respecting-EXTRA_LIBDIR.patch:
Fixed upstream
- port to new ghc-rpm-macros
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jan 11 16:52:35 UTC 2013 - peter.trommler@ohm-hochschule.de Fri Jan 11 16:52:35 UTC 2013 - peter.trommler@ohm-hochschule.de

132
ghc.spec
View File

@ -16,14 +16,8 @@
# #
# To bootstrap a new version of ghc, uncomment the following:
#%%global ghc_bootstrapping 1
#%%{?ghc_bootstrap}
#%%global without_hscolour 1
#%%global without_manual 1
Name: ghc Name: ghc
Version: 7.4.2 Version: 7.6.3
Release: 0 Release: 0
Url: http://haskell.org/ghc/dist/%{version}/%{name}-%{version}-src.tar.bz2 Url: http://haskell.org/ghc/dist/%{version}/%{name}-%{version}-src.tar.bz2
Summary: The Glorious Glasgow Haskell Compiler Summary: The Glorious Glasgow Haskell Compiler
@ -31,12 +25,8 @@ License: BSD-3-Clause
Group: Development/Languages/Other Group: Development/Languages/Other
ExclusiveArch: %{ix86} x86_64 ExclusiveArch: %{ix86} x86_64
%if %{defined ghc_bootstrapping}
BuildRequires: ghc-compiler >= 6.12
%else
BuildRequires: ghc-compiler = %version
%endif
BuildRequires: ghc-bytestring-devel BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-compiler >= 7.0
BuildRequires: ghc-containers-devel BuildRequires: ghc-containers-devel
BuildRequires: ghc-directory-devel BuildRequires: ghc-directory-devel
BuildRequires: ghc-haskell98-devel BuildRequires: ghc-haskell98-devel
@ -72,7 +62,7 @@ BuildRequires: ghc-unix
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: gcc BuildRequires: gcc
BuildRequires: ghc-rpm-macros >= 0.91 BuildRequires: ghc-rpm-macros-extra
BuildRequires: glibc-devel BuildRequires: glibc-devel
BuildRequires: gmp-devel BuildRequires: gmp-devel
BuildRequires: libffi-devel BuildRequires: libffi-devel
@ -83,26 +73,15 @@ BuildRequires: docbook-utils
BuildRequires: docbook-xsl-stylesheets BuildRequires: docbook-xsl-stylesheets
BuildRequires: libxslt BuildRequires: libxslt
%endif %endif
%if %{undefined without_haddock} && %{undefined without_hscolour}
BuildRequires: hscolour
%endif
PreReq: update-alternatives PreReq: update-alternatives
Requires: ghc-compiler = %{version}-%{release} Requires: ghc-compiler = %{version}-%{release}
Requires: ghc-ghc-devel = %{version}-%{release} Requires: ghc-ghc-devel = %{version}-%{release}
Requires: ghc-libraries = %{version}-%{release} Requires: ghc-libraries = %{version}-%{release}
Source: http://haskell.org/ghc/dist/%{version}/%{name}-%{version}-src.tar.bz2 Source: http://haskell.org/ghc/dist/%{version}/%{name}-%{version}-src.tar.bz2
# PATCH-FIX-UPSTREAM ghc-use-system-libffi.patch peter.trommler@ohm-hochschule.de - See Haskell trac #4496 and #5743 # PATCH-FIX-UPSTREAM ghc-use-system-libffi.patch peter.trommler@ohm-hochschule.de - See Haskell trac #4496 and #5743; backport of our patch accepted upstream for next major release.
Patch: ghc-use-system-libffi.patch Patch: ghc-use-system-libffi.patch
# PATCH-FIX-UPSTREAM ghc-suse-as-needed.patch peter.trommler@ohm-hochschule.de -- temporary fix for Haskell trac #7062, ghc libraries do not work with as_needed and new-dtags both enabled # PATCH-FIX-UPSTREAM ghc-suse-as-needed.patch peter.trommler@ohm-hochschule.de -- temporary fix for Haskell trac #7062, ghc libraries do not work with as_needed and new-dtags both enabled
Patch1: ghc-suse-as-needed.patch Patch1: ghc-suse-as-needed.patch
# fedora patch 9: fix dynamic linking of executables using Template Haskell
Patch2: Cabal-fix-dynamic-exec-for-TH.patch
Patch3: ghc-6.12.1-gen_contents_index-haddock-path.patch
Patch4: ghc-gen_contents_index-type-level.patch
# PATCH-FIX-UPSTREAM ghc-fix-undefined-openpty.patch peter.trommler@ohm-hochschule.de -- backport of upstream fix for #7062
Patch5: ghc-fix-undefined-openpty.patch
# PATCH-FIX-UPSTREAM 0001-Add-missing-flag-for-respecting-EXTRA_LIBDIR.patch peter.trommler@ohm-hochschule.de -- backport of upstream fix for #7062
Patch6: 0001-Add-missing-flag-for-respecting-EXTRA_LIBDIR.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -128,6 +107,9 @@ Summary: GHC compiler and utilities
Group: Development/Languages/Other Group: Development/Languages/Other
Requires: gcc Requires: gcc
Requires: ghc-base-devel Requires: ghc-base-devel
# This Requires fixes an issue in ghc's runtime system (rts) when
# locale files are missing. RTS loops and a memory leak eventually
# exhausts all memory and the program crashes.
Requires: glibc-locale Requires: glibc-locale
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun): update-alternatives
@ -148,30 +130,29 @@ To install all of GHC install package ghc.
%global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release} %global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release}
%if %{defined ghclibdir} %if %{defined ghclibdir}
%ghc_lib_subpackage Cabal 1.14.0 %ghc_lib_subpackage Cabal 1.16.0
%ghc_lib_subpackage array 0.4.0.0 %ghc_lib_subpackage array 0.4.0.1
%ghc_lib_subpackage -c gmp-devel,libffi-devel base 4.5.1.0 %ghc_lib_subpackage -c gmp-devel,libffi-devel base 4.6.0.1
%ghc_lib_subpackage binary 0.5.1.0 %ghc_lib_subpackage binary 0.5.1.1
%ghc_lib_subpackage bytestring 0.9.2.1 %ghc_lib_subpackage bytestring 0.10.0.2
%ghc_lib_subpackage containers 0.4.2.1 %ghc_lib_subpackage containers 0.5.0.0
%ghc_lib_subpackage deepseq 1.3.0.0 %ghc_lib_subpackage deepseq 1.3.0.1
%ghc_lib_subpackage directory 1.1.0.2 %ghc_lib_subpackage directory 1.2.0.1
%ghc_lib_subpackage extensible-exceptions 0.1.1.4 %ghc_lib_subpackage filepath 1.3.0.1
%ghc_lib_subpackage filepath 1.3.0.0
%define ghc_pkg_obsoletes ghc-bin-package-db-devel < 0.0.0.0-%{release} %define ghc_pkg_obsoletes ghc-bin-package-db-devel < 0.0.0.0-%{release}
%ghc_lib_subpackage -x ghc %{ghc_version_override} %ghc_lib_subpackage -x ghc %{ghc_version_override}
%undefine ghc_pkg_obsoletes %undefine ghc_pkg_obsoletes
%ghc_lib_subpackage haskell2010 1.1.0.1 %ghc_lib_subpackage haskell2010 1.1.1.0
%ghc_lib_subpackage haskell98 2.0.0.1 %ghc_lib_subpackage haskell98 2.0.0.2
%ghc_lib_subpackage hoopl 3.8.7.3 %ghc_lib_subpackage hoopl 3.9.0.0
%ghc_lib_subpackage hpc 0.5.1.1 %ghc_lib_subpackage hpc 0.6.0.0
%ghc_lib_subpackage old-locale 1.0.0.4 %ghc_lib_subpackage old-locale 1.0.0.5
%ghc_lib_subpackage old-time 1.1.0.0 %ghc_lib_subpackage old-time 1.1.0.1
%ghc_lib_subpackage pretty 1.1.1.0 %ghc_lib_subpackage pretty 1.1.1.0
%ghc_lib_subpackage process 1.1.0.1 %ghc_lib_subpackage process 1.1.0.2
%ghc_lib_subpackage template-haskell 2.7.0.0 %ghc_lib_subpackage template-haskell 2.8.0.0
%ghc_lib_subpackage time 1.4 %ghc_lib_subpackage time 1.4.0.1
%ghc_lib_subpackage unix 2.5.1.1 %ghc_lib_subpackage unix 2.6.0.1
%endif %endif
%global version %{ghc_version_override} %global version %{ghc_version_override}
@ -192,22 +173,31 @@ except the ghc library, which is installed by the toplevel ghc metapackage.
%prep %prep
%setup -q %setup -q
rm -r ghc-tarballs/{mingw,perl} rm -r ghc-tarballs/{mingw,mingw64,perl}
%patch -p1 -b .libffi %patch -p1 -b .libffi
rm -r ghc-tarballs/libffi rm -r ghc-tarballs/libffi
mkdir -p rts/dist/build
ln -s $(pkg-config --variable=includedir libffi)/*.h rts/dist/build
%patch1 -p1 -b .suse %patch1 -p1 -b .suse
%patch2 -p1 -b .orig
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build %build
# required for patch1 # required for patch and patch1
autoreconf -fi autoreconf -fi
# Check if bootstrap is required, i.e. version is different from ghc's version
# Note: Cannot use ghc_version macro here as we defined version override earlier
%if "%version" != "%(ghc --numeric-version)"
%define ghc_boot 1
cat > mk/build.mk <<EOF
GhcLibWays = v
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
HSCOLOUR_SRCS = NO
EOF
./configure --prefix=%{_builddir}/ghc-boot --with-system-libffi
make %{?_smp_mflags}
make install
make clean
%endif
# http://hackage.haskell.org/trac/ghc/wiki/Platforms # http://hackage.haskell.org/trac/ghc/wiki/Platforms
# cf https://github.com/gentoo-haskell/gentoo-haskell/tree/master/dev-lang/ghc # cf https://github.com/gentoo-haskell/gentoo-haskell/tree/master/dev-lang/ghc
cat > mk/build.mk << EOF cat > mk/build.mk << EOF
@ -230,6 +220,8 @@ export CFLAGS="${CFLAGS:-%optflags}"
--libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \ --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
--sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \ --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--docdir=%{ghcdocroot} \ --docdir=%{ghcdocroot} \
%{?ghc_boot:--with-ghc=%{_builddir}/ghc-boot/bin/ghc} \
--with-system-libffi \
--with-gcc=%{_bindir}/gcc --with-gcc=%{_bindir}/gcc
make %{?_smp_mflags} make %{?_smp_mflags}
@ -242,18 +234,19 @@ for i in %{ghc_packages_list}; do
name=$(echo $i | sed -e "s/\(.*\)-.*/\1/") name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")
ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/") ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")
%ghc_gen_filelists $name $ver %ghc_gen_filelists $name $ver
echo "%doc libraries/$name/LICENSE" >> ghc-$name%{?ghc_without_shared:-devel}.files echo "%doc libraries/$name/LICENSE" >> ghc-$name.files
done done
# ghc-base should own ghclibdir
echo "%dir %{ghclibdir}" >> ghc-base.files
%ghc_gen_filelists bin-package-db 0.0.0.0 %ghc_gen_filelists bin-package-db 0.0.0.0
%ghc_gen_filelists ghc %{ghc_version_override} %ghc_gen_filelists ghc %{ghc_version_override}
%ghc_gen_filelists ghc-prim 0.2.0.0 %ghc_gen_filelists ghc-prim 0.3.0.0
%ghc_gen_filelists integer-gmp 0.4.0.0 %ghc_gen_filelists integer-gmp 0.5.0.0
%define merge_filelist()\ %define merge_filelist()\
%if %{undefined ghc_without_shared}\
cat ghc-%1.files >> ghc-%2.files\ cat ghc-%1.files >> ghc-%2.files\
%endif\
cat ghc-%1-devel.files >> ghc-%2-devel.files\ cat ghc-%1-devel.files >> ghc-%2-devel.files\
cp -p libraries/%1/LICENSE libraries/LICENSE.%1\ cp -p libraries/%1/LICENSE libraries/LICENSE.%1\
echo "%doc libraries/LICENSE.%1" >> ghc-%2.files echo "%doc libraries/LICENSE.%1" >> ghc-%2.files
@ -263,20 +256,20 @@ echo "%doc libraries/LICENSE.%1" >> ghc-%2.files
%merge_filelist bin-package-db ghc %merge_filelist bin-package-db ghc
%if %{undefined ghc_without_shared} %if %{undefined ghc_without_shared}
ls $RPM_BUILD_ROOT%{ghclibdir}/libHS*.so >> ghc-base.files ls %{buildroot}%{ghclibdir}/libHS*.so >> ghc-base.files
sed -i -e "s|^$RPM_BUILD_ROOT||g" ghc-base.files sed -i -e "s|^%{buildroot}||g" ghc-base.files
%endif %endif
ls -d $RPM_BUILD_ROOT%{ghclibdir}/libHS*.a $RPM_BUILD_ROOT%{ghclibdir}/package.conf.d/builtin_*.conf $RPM_BUILD_ROOT%{ghclibdir}/include >> ghc-base-devel.files ls -d %{buildroot}%{ghclibdir}/libHS*.a %{buildroot}%{ghclibdir}/package.conf.d/builtin_*.conf %{buildroot}%{ghclibdir}/include >> ghc-base-devel.files
sed -i -e "s|^$RPM_BUILD_ROOT||g" ghc-base-devel.files sed -i -e "s|^%{buildroot}||g" ghc-base-devel.files
# these are handled as alternatives # these are handled as alternatives
for i in hsc2hs runhaskell; do for i in hsc2hs runhaskell; do
if [ -x ${RPM_BUILD_ROOT}%{_bindir}/$i-ghc ]; then if [ -x %{buildroot}%{_bindir}/$i-ghc ]; then
rm ${RPM_BUILD_ROOT}%{_bindir}/$i rm %{buildroot}%{_bindir}/$i
else else
mv ${RPM_BUILD_ROOT}%{_bindir}/$i{,-ghc} mv %{buildroot}%{_bindir}/$i{,-ghc}
fi fi
touch ${RPM_BUILD_ROOT}%{_bindir}/$i touch %{buildroot}%{_bindir}/$i
done done
%ghc_strip_dynlinked %ghc_strip_dynlinked
@ -343,9 +336,9 @@ fi
%ghost %attr(755,root,root) %{_bindir}/hsc2hs %ghost %attr(755,root,root) %{_bindir}/hsc2hs
%{_bindir}/hsc2hs-ghc %{_bindir}/hsc2hs-ghc
%{_bindir}/runghc %{_bindir}/runghc
%{_bindir}/runghc-%{version}
%ghost %attr(755,root,root) %{_bindir}/runhaskell %ghost %attr(755,root,root) %{_bindir}/runhaskell
%{_bindir}/runhaskell-ghc %{_bindir}/runhaskell-ghc
%dir %{ghclibdir}
%{ghclibdir}/settings %{ghclibdir}/settings
%{ghclibdir}/ghc %{ghclibdir}/ghc
%{ghclibdir}/ghc-pkg %{ghclibdir}/ghc-pkg
@ -376,9 +369,10 @@ fi
%endif %endif
%{ghcdocbasedir}/libraries/frames.html %{ghcdocbasedir}/libraries/frames.html
%{ghcdocbasedir}/libraries/gen_contents_index %{ghcdocbasedir}/libraries/gen_contents_index
%{ghcdocbasedir}/libraries/hscolour.css %{ghcdocbasedir}/libraries/hslogo-16.png
%{ghcdocbasedir}/libraries/ocean.css %{ghcdocbasedir}/libraries/ocean.css
%{ghcdocbasedir}/libraries/prologue.txt %{ghcdocbasedir}/libraries/prologue.txt
%{ghcdocbasedir}/libraries/synopsis.png
%{ghcdocbasedir}/index.html %{ghcdocbasedir}/index.html
%ghost %{ghcdocbasedir}/libraries/doc-index*.html %ghost %{ghcdocbasedir}/libraries/doc-index*.html
%ghost %{ghcdocbasedir}/libraries/haddock-util.js %ghost %{ghcdocbasedir}/libraries/haddock-util.js