pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/ghc7 Backport the $ORIGIN removal patch from ghc88



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2d798ed4dfa3
branches:  trunk
changeset: 451738:2d798ed4dfa3
user:      pho <pho%pkgsrc.org@localhost>
date:      Fri Apr 30 18:52:05 2021 +0000

description:
Backport the $ORIGIN removal patch from ghc88

diffstat:

 lang/ghc7/Makefile                                 |  20 +------------
 lang/ghc7/distinfo                                 |   7 +++-
 lang/ghc7/patches/patch-ghc.mk                     |  32 +++++++++++++++++++--
 lang/ghc7/patches/patch-rts_ghc.mk                 |  14 +++++++++
 lang/ghc7/patches/patch-rules_build-package-way.mk |  14 +++++++++
 lang/ghc7/patches/patch-rules_distdir-way-opts.mk  |  27 ++++++++++++++++++
 6 files changed, 90 insertions(+), 24 deletions(-)

diffs (175 lines):

diff -r a99b52c84c8a -r 2d798ed4dfa3 lang/ghc7/Makefile
--- a/lang/ghc7/Makefile        Fri Apr 30 18:03:51 2021 +0000
+++ b/lang/ghc7/Makefile        Fri Apr 30 18:52:05 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.46 2021/04/27 13:55:25 pho Exp $
+# $NetBSD: Makefile,v 1.47 2021/04/30 18:52:05 pho Exp $
 # -----------------------------------------------------------------------------
 # Package metadata
 #
@@ -163,22 +163,6 @@
 # There is an unused script which don't pass the portability test.
 CHECK_PORTABILITY_SKIP+=       distrib/prep-bin-dist-mingw
 
-# Dynamically linked Haskell executables and libraries have rpaths to
-# dependent Haskell libraries, but the problem is that they are
-# specified with $ORIGIN, which isn't currently supported by
-# ../../mk/check/check-shlibs-elf.awk nor
-# mk/pkgformat/pkg/metadata.mk.
-#
-# This means we need to disable the entire CHECK_SHLIBS machinery
-# because otherwise the resulting binary package would contain
-# REQUIRES lines with $ORIGIN wrongly expanded by ldd(1).
-#
-# Note that arguments like "-Wl,-rpath,$ORIGIN/.." are usually dropped
-# by the "cleanup" phase of wrappers. This is not the case in GHC
-# because GHC uses @file syntax while linking objects, and our
-# wrappers does nothing about it.
-CHECK_SHLIBS_SUPPORTED=        no
-
 # ghc57207_0.s: failed to add inputs for merge: Resource temporarily unavailable
 CTF_FILES_SKIP+=               */libHS*-ghc${PKGVERSION_NOREV}.*
 
@@ -200,7 +184,7 @@
 # In a sandboxed build environment, we have to reach over to the
 # installed libraries themselves, since the symlinks compat80 adds
 # to the /usr tree can't be applied.
-ALL_ENV+=      LD_LIBRARY_PATH=${PREFIX:Q}/emul/netbsd/usr/lib:${FILESDIR}
+ALL_ENV+=      LD_LIBRARY_PATH=${PREFIX:Q}/emul/netbsd/usr/lib
 .endif
 
 .include "../../converters/libiconv/buildlink3.mk"
diff -r a99b52c84c8a -r 2d798ed4dfa3 lang/ghc7/distinfo
--- a/lang/ghc7/distinfo        Fri Apr 30 18:03:51 2021 +0000
+++ b/lang/ghc7/distinfo        Fri Apr 30 18:52:05 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.20 2020/02/14 23:36:54 jperkin Exp $
+$NetBSD: distinfo,v 1.21 2021/04/30 18:52:05 pho Exp $
 
 SHA1 (ghc-7.10.3-boot-i386-unknown-freebsd.tar.xz) = 95a1c350f25677f0f9fefac66d99589aa6ce5fbe
 RMD160 (ghc-7.10.3-boot-i386-unknown-freebsd.tar.xz) = 0b27558c57a435c76478ea95a94d576a5579f48f
@@ -25,7 +25,7 @@
 SHA512 (ghc-7.6.3-boot-x86_64-unknown-solaris2.tar.xz) = f253e82beaec3f0f06fdaf48d02d7ceabe43d54582992f0bac68e7be40dd9fbcafee4e84c15a470c3648a3aee16a0ad708a5a409d6c490e5687f9568109e5d46
 Size (ghc-7.6.3-boot-x86_64-unknown-solaris2.tar.xz) = 33541060 bytes
 SHA1 (patch-configure) = dafe8dee52e3e79e1ce9307fb62f283691bdb568
-SHA1 (patch-ghc.mk) = 542e3c8a2cd61eeeee6588ff62203c9c1074025d
+SHA1 (patch-ghc.mk) = d1131c7582a189775b307b830f860089f5afe346
 SHA1 (patch-libraries_base_GHC_Event_KQueue.hsc) = 8ee5da667a241a05fde3c580d3dc9bdc05aa5f00
 SHA1 (patch-libraries_base_System_Environment.hs) = fd786a7aa2058b5d86d4646e3816fb53ea0bf59f
 SHA1 (patch-libraries_base_configure.ac) = dd6132c5335d7e0421ec2181ebb5a34bb162e255
@@ -36,3 +36,6 @@
 SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = 6a2b9a527730ec593b70e827fdc1aaeccc575dad
 SHA1 (patch-libraries_unix_include_execvpe.h) = a134be89b4bdd49eb5c5ed45756eb3a4ce5951a5
 SHA1 (patch-rts_PosixSource.h) = 604608791f33245d9305dcbd6d9d5979fe162f21
+SHA1 (patch-rts_ghc.mk) = 661fe3b57280809f0f00dc449bd4585fafd3f9c0
+SHA1 (patch-rules_build-package-way.mk) = c161044f44fc8a52726492a52366cff7b394f48c
+SHA1 (patch-rules_distdir-way-opts.mk) = 66b0da62629f251a74ca7ca38dcb996dcb555e59
diff -r a99b52c84c8a -r 2d798ed4dfa3 lang/ghc7/patches/patch-ghc.mk
--- a/lang/ghc7/patches/patch-ghc.mk    Fri Apr 30 18:03:51 2021 +0000
+++ b/lang/ghc7/patches/patch-ghc.mk    Fri Apr 30 18:52:05 2021 +0000
@@ -1,10 +1,34 @@
-$NetBSD: patch-ghc.mk,v 1.2 2019/12/29 16:59:09 pho Exp $
+$NetBSD: patch-ghc.mk,v 1.3 2021/04/30 18:52:05 pho Exp $
 
-Fix building bootkits: we don't generate documentation for them.
+* Use the wrapper scripts for ghc as we can't use the ones from the DESTDIR
+  as the libraries are not in the right place yet.
+
+* Fix building bootkits: we don't generate documentation for them.
 
---- ghc.mk.orig        2019-12-27 02:36:02.858039422 +0000
+--- ghc.mk.orig        2015-10-19 15:59:58.000000000 +0000
 +++ ghc.mk
-@@ -989,7 +989,6 @@ $(eval $(call bindist,.,\
+@@ -897,6 +897,12 @@ endif
+ 
+ INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf.d
+ 
++ifneq "$(BINDIST)" "YES"
++# when installing ghc-stage2 we can't run target's
++# 'ghc-pkg' and 'ghc-stage2' but those are needed for registration.
++INSTALLED_GHC_REAL=$(TOP)/inplace/bin/ghc-stage1
++INSTALLED_GHC_PKG_REAL=$(TOP)/utils/ghc-pkg/dist/build/tmp/ghc-pkg
++else
+ # Install packages in the right order, so that ghc-pkg doesn't complain.
+ # Also, install ghc-pkg first.
+ ifeq "$(Windows_Host)" "NO"
+@@ -906,6 +912,7 @@ else
+ INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe
+ INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe
+ endif
++endif
+ 
+ # Set the INSTALL_DISTDIR_p for each package; compiler is special
+ $(foreach p,$(filter-out compiler,$(INSTALL_PACKAGES)),\
+@@ -989,7 +996,6 @@ $(eval $(call bindist,.,\
      $(INSTALL_LIBRARY_DOCS) \
      $(addsuffix /*,$(INSTALL_HTML_DOC_DIRS)) \
      docs/index.html \
diff -r a99b52c84c8a -r 2d798ed4dfa3 lang/ghc7/patches/patch-rts_ghc.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc7/patches/patch-rts_ghc.mk        Fri Apr 30 18:52:05 2021 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-rts_ghc.mk,v 1.8 2021/04/30 18:52:05 pho Exp $
+
+This is for Darwin. See the patch to rules/distdir-way-opts.mk.
+
+--- rts/ghc.mk.orig    2015-07-23 22:06:18.000000000 +0000
++++ rts/ghc.mk
+@@ -189,6 +189,7 @@ ifeq "$$(HostOS_CPP)" "mingw32" 
+ $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) rts/dist/libs.depend rts/dist/build/$$(LIBFFI_DLL)
+       "$$(RM)" $$(RM_OPTS) $$@
+       "$$(rts_dist_HC)" -this-package-key rts -shared -dynamic -dynload deploy \
++        -dylib-install-name $$(ghclibdir)/rts/$$(rts_$1_LIB_NAME) \
+         -no-auto-link-packages -Lrts/dist/build -l$$(LIBFFI_NAME) \
+          `cat rts/dist/libs.depend` $$(rts_$1_OBJS) $$(ALL_RTS_DEF_LIBS) \
+          $$(rts_dist_$1_GHC_LD_OPTS) \
diff -r a99b52c84c8a -r 2d798ed4dfa3 lang/ghc7/patches/patch-rules_build-package-way.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc7/patches/patch-rules_build-package-way.mk        Fri Apr 30 18:52:05 2021 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-rules_build-package-way.mk,v 1.1 2021/04/30 18:52:05 pho Exp $
+
+This is for Darwin. See the patch to rules/distdir-way-opts.mk.
+
+--- rules/build-package-way.mk.orig    2015-07-23 22:06:18.000000000 +0000
++++ rules/build-package-way.mk
+@@ -90,6 +90,7 @@ else
+ $$($1_$2_$3_LIB) : $$($1_$2_$3_ALL_OBJS) $$(ALL_RTS_LIBS) $$($1_$2_$3_DEPS_LIBS)
+       $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) $$($1_$2_$3_GHC_LD_OPTS) $$($1_$2_$3_ALL_OBJS) \
+          -shared -dynamic -dynload deploy \
++       -dylib-install-name $$(ghclibdir)/$$($1_$2_PACKAGE_KEY)/$$($1_$2_$3_LIB_NAME) \
+        $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) $$(addprefix -L,$$($1_$2_EXTRA_LIBDIRS)) \
+          -no-auto-link-packages \
+          -o $$@
diff -r a99b52c84c8a -r 2d798ed4dfa3 lang/ghc7/patches/patch-rules_distdir-way-opts.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc7/patches/patch-rules_distdir-way-opts.mk Fri Apr 30 18:52:05 2021 +0000
@@ -0,0 +1,27 @@
+$NetBSD: patch-rules_distdir-way-opts.mk,v 1.1 2021/04/30 18:52:05 pho Exp $
+
+Use correct RPATHs. On ELF we replace "$ORIGIN/../{PACKAGE_ID}" with
+the final installation path.
+
+On Darwin library paths work differently. If an executable (or a
+library) A depends on a library B, the installation path of B is first
+embedded in B, and then the path propagates to A at the time when A is
+linked. So we remove -rpath to libraries here, and do the other half
+in rules/build-package-way.mk and rts/ghc.mk.
+
+--- rules/distdir-way-opts.mk.orig     2015-07-23 22:06:18.000000000 +0000
++++ rules/distdir-way-opts.mk
+@@ -186,11 +186,10 @@ ifneq "$4" "0"
+ ifeq "$$(TargetElf)" "YES"
+ $1_$2_$3_GHC_LD_OPTS += \
+     -fno-use-rpaths \
+-    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_KEYS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'$$$$ORIGIN/../$$d') -optl-Wl,-zorigin
++    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_KEYS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)$$(ghclibdir)/$$d)
+ else ifeq "$$(TargetOS_CPP)" "darwin"
+ $1_$2_$3_GHC_LD_OPTS += \
+-    -fno-use-rpaths \
+-    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_KEYS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'@loader_path/../$$d')
++    -fno-use-rpaths
+ endif
+ endif
+ endif



Home | Main Index | Thread Index | Old Index