On 5 August 2011 05:27, Ian Lynagh <ig...@earth.li> wrote:
>> >from 
>> >http://koji.fedoraproject.org/koji/getfile?taskID=3251249&name=build.log .
>| *** unexpected failure for fed001(normal)
>
> but it works fine for me on x86/Linux.
>
>> >Note the Fedora build is patched to use system libffi.
>
> Hmm. What happens if you don't patch it?

More hmmm: that makes the x86 unexpected errors go to 0!

http://koji.fedoraproject.org/koji/taskinfo?taskID=3253482

I attach system libffi patch if anyone wants to look at it,
but I don't see anything particularly arch-specific about it though so I still
don't understand why it fails for 7.2.  A similar patch for ghc-7.0.4
doesn't seem to have any ill-effects on the test results:

eg http://koji.fedoraproject.org/koji/buildinfo?buildID=248071

I'd be interested to know if any other distros can reproduces or not.
I think the system libffi patch originally comes from Debian.

It would be good to make Linux default to use system libffi anyway.
Is there any good reason not to do so?  As you know copy libraries
are frowned upon in the linux world.  I can't remember if such
an RFE already exists in trac?

Thanks, Jens
diff -up ghc-7.2.0.20110728/compiler/ghc.cabal.in.libffi ghc-7.2.0.20110728/compiler/ghc.cabal.in
--- ghc-7.2.0.20110728/compiler/ghc.cabal.in.libffi	2011-07-29 02:12:04.000000000 +0900
+++ ghc-7.2.0.20110728/compiler/ghc.cabal.in	2011-08-03 14:28:19.447190200 +0900
@@ -81,7 +81,7 @@ Library
     if flag(ghci)
         Build-Depends: template-haskell
         CPP-Options: -DGHCI
-        Include-Dirs: ../libffi/build/include
+        pkgconfig-depends: libffi
 
     Build-Depends: bin-package-db
     Build-Depends: hoopl
diff -up ghc-7.2.0.20110728/ghc.mk.libffi ghc-7.2.0.20110728/ghc.mk
--- ghc-7.2.0.20110728/ghc.mk.libffi	2011-07-29 02:12:04.000000000 +0900
+++ ghc-7.2.0.20110728/ghc.mk	2011-08-03 14:35:16.766340182 +0900
@@ -449,7 +449,6 @@ utils/runghc/dist-install/package-data.m
 # add the final two package.conf dependencies: ghc-prim depends on RTS,
 # and RTS depends on libffi.
 libraries/ghc-prim/dist-install/package-data.mk : rts/package.conf.inplace
-rts/package.conf.inplace : libffi/package.conf.inplace
 endif
 
 # --------------------------------
@@ -467,11 +466,6 @@ ALL_STAGE1_LIBS += $(foreach lib,$(PACKA
 endif
 BOOT_LIBS = $(foreach lib,$(PACKAGES_STAGE0),$(libraries/$(lib)_dist-boot_v_LIB))
 
-OTHER_LIBS = libffi/dist-install/build/libHSffi$(v_libsuf) libffi/dist-install/build/HSffi.o
-ifeq "$(BuildSharedLibs)" "YES"
-OTHER_LIBS  += libffi/dist-install/build/libHSffi$(dyn_libsuf)
-endif
-
 # ----------------------------------------
 # Special magic for the ghc-prim package
 
@@ -560,7 +554,6 @@ BUILD_DIRS += \
    driver/ghci \
    driver/ghc \
    driver/haddock \
-   libffi \
    includes \
    rts
 
@@ -865,11 +858,10 @@ INSTALL_DISTDIR_compiler = stage2
 
 # Now we can do the installation
 install_packages: install_libexecs
-install_packages: libffi/package.conf.install rts/package.conf.install
+install_packages: rts/package.conf.install
 	$(call INSTALL_DIR,"$(DESTDIR)$(topdir)")
 	"$(RM)" $(RM_OPTS_REC) "$(INSTALLED_PACKAGE_CONF)"
 	$(call INSTALL_DIR,"$(INSTALLED_PACKAGE_CONF)")
-	"$(INSTALLED_GHC_PKG_REAL)" --force --global-conf "$(INSTALLED_PACKAGE_CONF)" update libffi/package.conf.install
 	"$(INSTALLED_GHC_PKG_REAL)" --force --global-conf "$(INSTALLED_PACKAGE_CONF)" update rts/package.conf.install
 	$(foreach p, $(INSTALLED_PKG_DIRS),                           \
 	    $(call make-command,                                      \
@@ -957,7 +949,7 @@ BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindi
 unix-binary-dist-prep:
 	"$(RM)" $(RM_OPTS_REC) 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 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)
@@ -1042,7 +1034,7 @@ SRC_DIST_DIR=$(TOP)/$(SRC_DIST_NAME)
 #
 # Files to include in source distributions
 #
-SRC_DIST_DIRS = mk rules docs distrib bindisttest libffi includes utils docs rts compiler ghc driver libraries ghc-tarballs
+SRC_DIST_DIRS = mk rules docs distrib bindisttest includes utils docs rts compiler ghc driver libraries ghc-tarballs
 SRC_DIST_FILES += \
 	configure.ac config.guess config.sub configure \
 	aclocal.m4 README ANNOUNCE HACKING LICENSE Makefile install-sh \
diff -up ghc-7.2.0.20110728/rts/ghc.mk.libffi ghc-7.2.0.20110728/rts/ghc.mk
--- ghc-7.2.0.20110728/rts/ghc.mk.libffi	2011-07-29 02:12:04.000000000 +0900
+++ ghc-7.2.0.20110728/rts/ghc.mk	2011-08-03 14:37:52.306159811 +0900
@@ -455,15 +455,15 @@ endif
 
 $(eval $(call dependencies,rts,dist,1))
 
-$(rts_dist_depfile_c_asm) : libffi/dist-install/build/ffi.h $(DTRACEPROBES_H)
+$(rts_dist_depfile_c_asm) : $(DTRACEPROBES_H)
 
 #-----------------------------------------------------------------------------
 # libffi stuff
 
-rts_CC_OPTS     += -Ilibffi/build/include
-rts_HC_OPTS     += -Ilibffi/build/include
-rts_HSC2HS_OPTS += -Ilibffi/build/include
-rts_LD_OPTS     += -Llibffi/build/include
+rts_CC_OPTS     += $(shell pkg-config --cflags libffi)
+rts_HC_OPTS     += $(shell pkg-config --cflags libffi)
+rts_HSC2HS_OPTS += $(shell pkg-config --cflags libffi)
+rts_LD_OPTS     += $(shell pkg-config --libs libffi)
 
 # -----------------------------------------------------------------------------
 # compile dtrace probes if dtrace is supported
diff -up ghc-7.2.0.20110728/rts/package.conf.in.libffi ghc-7.2.0.20110728/rts/package.conf.in
--- ghc-7.2.0.20110728/rts/package.conf.in.libffi	2011-07-29 02:12:04.000000000 +0900
+++ ghc-7.2.0.20110728/rts/package.conf.in	2011-08-03 14:25:38.409447648 +0900
@@ -24,8 +24,9 @@ library-dirs:		TOP"/rts/dist/build" PAPI
 hs-libraries:   "HSrts"
 
 extra-libraries:
+				"ffi"
 #ifdef HAVE_LIBM
-                		"m"		/* for ldexp() */
+			      , "m"		/* for ldexp() */
 #endif
 #ifdef HAVE_LIBRT
 			      , "rt"
@@ -55,7 +56,6 @@ include-dirs:		TOP"/includes"
 #endif
 
 includes:		Stg.h
-depends:	 	builtin_ffi
 hugs-options:
 cc-options:
 
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to