From 6905835f80812915b8b8fe289d0b28b2213836ef Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Thu, 16 Feb 2012 15:16:20 +0900 Subject: [PATCH] fix build with system libffi - add rest of debian system-libffi patch, - copy libffi headers into rts build dir - acknowledge Debian's patch --- ghc-use-system-libffi.patch | 33 ++++++++++++++++++++++++++++++++- ghc.spec | 3 +++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/ghc-use-system-libffi.patch b/ghc-use-system-libffi.patch index cac9e42..304bcb9 100644 --- a/ghc-use-system-libffi.patch +++ b/ghc-use-system-libffi.patch @@ -1,6 +1,21 @@ This patch could be replaced by a configure call if http://hackage.haskell.org/trac/ghc/ticket/5743 were fixed. +Index: ghc-7.4.0.20111219/rts/package.conf.in +=================================================================== +--- ghc-7.4.0.20111219.orig/rts/package.conf.in 2011-12-21 23:21:03.000000000 +0100 ++++ ghc-7.4.0.20111219/rts/package.conf.in 2011-12-21 23:21:04.000000000 +0100 +@@ -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.0.20111219/ghc.mk =================================================================== --- ghc-7.4.0.20111219.orig/ghc.mk 2011-12-21 23:21:03.000000000 +0100 @@ -17,7 +32,23 @@ Index: ghc-7.4.0.20111219/rts/ghc.mk =================================================================== --- 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 -@@ -177,7 +176,7 @@ +@@ -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 diff --git a/ghc.spec b/ghc.spec index 2b6c180..a9d496e 100644 --- a/ghc.spec +++ b/ghc.spec @@ -195,6 +195,8 @@ rm -r ghc-tarballs/{mingw,perl} # use system libffi %patch4 -p1 -b .libffi rm -r ghc-tarballs/libffi +mkdir -p rts/dist/build +cp $(pkg-config --variable=includedir libffi)/*.h rts/dist/build %ifarch ppc64 %patch7 -p1 -b .pthread @@ -426,6 +428,7 @@ fi - Cabal --enable-executable-dynamic patch is upstream - add Cabal-fix-dynamic-exec-for-TH.patch - sparc linking fix is upstream +- uses Debian's system-libffi patch by Joachim Breitner - setup ghc-deps.sh after ghc_version_override for bootstrapping * Thu Jan 19 2012 Jens Petersen - 7.0.4-42