[BACK]Return to patch-rts_ghc.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / lang / ghc7 / patches

File: [cvs.NetBSD.org] / pkgsrc / lang / ghc7 / patches / Attic / patch-rts_ghc.mk (download)

Revision 1.6, Sat May 7 10:02:06 2016 UTC (4 years, 2 months ago) by joerg
Branch: MAIN
CVS Tags: pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2
Changes since 1.5: +20 -6 lines

Fix libffi linkage, so that it actually picks up the right version and
includes the rpath. Seen by a not so happy devel/happy. Bump revision.

$NetBSD: patch-rts_ghc.mk,v 1.6 2016/05/07 10:02:06 joerg Exp $

This is pkgsrc specific:

Install libffi.{a,la} too, so that the plist framework can deal with
.so name being different between platforms. Note that
"libffi$(soext)*" matches to libffi.{so,so.6,so.6.0} but not to
libffi.6.dylib so the pattern must be corrected to "libffi*$(soext)*",
otherwise libtool-expand will emit the following error on Mach-O

  libtool-expand: `lib/ghc-7.6.3/libffi.6.dylib' was not found

For what it's worth, this ain't the right way to install libtool
libraries. They should always be installed by running
"libtool --mode=install install -c foo.la /path/to/destination", which
can't be achieved without a major refactoring of the GHC build system.
And for that matter, GHC shouldn't install a local copy of libffi in
the first place. In fact GHC 7.8 seems to have a configure option
"--with-system-libffi" so we can hopefully remove this rather
unpleasant patch in the future.

--- rts/ghc.mk.orig	2013-04-18 21:22:47.000000000 +0000
+++ rts/ghc.mk
@@ -112,10 +112,11 @@ $(rts_ffi_objs_stamp): $(libffi_STATIC_L
 # This is a little hacky. We don't know the SO version, so we only
 # depend on libffi.so, but copy libffi.so*
-rts/dist/build/libffi$(soext): libffi/build/inst/lib/libffi$(soext)
-	cp libffi/build/inst/lib/libffi$(soext)* rts/dist/build
+rts/dist/build/libffi$(soext): libffi/build/inst${ghclibdir}/libffi$(soext)
+	cp libffi/build/inst${ghclibdir}/libffi*$(soext)* rts/dist/build
+	cp libffi/build/inst${ghclibdir}/libffi.*a rts/dist/build
-rts/dist/build/$(LIBFFI_DLL): libffi/build/inst/bin/$(LIBFFI_DLL)
+rts/dist/build/$(LIBFFI_DLL): libffi/build/inst${prefix}/bin/$(LIBFFI_DLL)
 	cp $< $@
@@ -185,7 +186,7 @@ else
 $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/libs.depend rts/dist/build/libffi$$(soext)
 	"$$(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) \
+	  -no-auto-link-packages -Lrts/dist/build -optl -Wl,-rpath,${ghclibdir} -lffi `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.
@@ -509,7 +510,8 @@ endif
 # installing
-INSTALL_LIBS += $(wildcard rts/dist/build/libffi$(soext)*)
+INSTALL_LIBS += $(wildcard rts/dist/build/libffi*$(soext)*)
+INSTALL_LIBS += $(wildcard rts/dist/build/libffi.*a)
 INSTALL_LIBS += $(wildcard rts/dist/build/$(LIBFFI_DLL))
 install: install_libffi_headers