pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/ghc88 Eliminate use of @rpath and @loader_path on...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fc7028c2e895
branches:  trunk
changeset: 451597:fc7028c2e895
user:      pho <pho%pkgsrc.org@localhost>
date:      Thu Apr 29 05:09:08 2021 +0000

description:
Eliminate use of @rpath and @loader_path on Darwin

They are essentially equivalent to $ORIGIN of ELF.

diffstat:

 lang/ghc88/Makefile                                 |   4 ++--
 lang/ghc88/distinfo                                 |   6 ++++--
 lang/ghc88/patches/patch-rts_ghc.mk                 |  14 ++++++++++++++
 lang/ghc88/patches/patch-rules_build-package-way.mk |  14 ++++++++++++++
 lang/ghc88/patches/patch-rules_distdir-way-opts.mk  |  20 ++++++++++++++++----
 5 files changed, 50 insertions(+), 8 deletions(-)

diffs (104 lines):

diff -r 768a3f2dff3a -r fc7028c2e895 lang/ghc88/Makefile
--- a/lang/ghc88/Makefile       Thu Apr 29 03:06:41 2021 +0000
+++ b/lang/ghc88/Makefile       Thu Apr 29 05:09:08 2021 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.18 2021/04/28 15:39:23 pho Exp $
+# $NetBSD: Makefile,v 1.19 2021/04/29 05:09:08 pho Exp $
 # -----------------------------------------------------------------------------
 # Package metadata
 #
 DISTNAME=      ghc-8.8.4-src
 PKGNAME=       ${DISTNAME:S/-src$//}
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    lang
 MASTER_SITES=  https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/
 EXTRACT_SUFX=  .tar.xz
diff -r 768a3f2dff3a -r fc7028c2e895 lang/ghc88/distinfo
--- a/lang/ghc88/distinfo       Thu Apr 29 03:06:41 2021 +0000
+++ b/lang/ghc88/distinfo       Thu Apr 29 05:09:08 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.16 2021/04/28 15:39:23 pho Exp $
+$NetBSD: distinfo,v 1.17 2021/04/29 05:09:08 pho Exp $
 
 SHA1 (ghc-8.4.4-boot-i386-unknown-freebsd.tar.xz) = 04981802730423aa12999e59679be198d540222a
 RMD160 (ghc-8.4.4-boot-i386-unknown-freebsd.tar.xz) = f617e67f2c2f07c7211cb391a4bc2e7b304045e2
@@ -46,4 +46,6 @@
 SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = 49215dce493a6bbc440f91a3959e592f86fc779b
 SHA1 (patch-libraries_unix_include_execvpe.h) = 67dd9720a71a6a55bbe2b50e61621ca60187ef00
 SHA1 (patch-rts_StgCRun.c) = 121c7bd714725d5b14a3cbb03d81b1c769848824
-SHA1 (patch-rules_distdir-way-opts.mk) = 1430f03c2dfc3462a68002c76bfefcf38622429b
+SHA1 (patch-rts_ghc.mk) = 6e3daf71fb7e656131aa2aeeb0346c651520216a
+SHA1 (patch-rules_build-package-way.mk) = ec73df0bbc85e962f76a9068683879a1a1ba1815
+SHA1 (patch-rules_distdir-way-opts.mk) = a058c6428faf02ef94aab3336d2d2874f2726f4e
diff -r 768a3f2dff3a -r fc7028c2e895 lang/ghc88/patches/patch-rts_ghc.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc88/patches/patch-rts_ghc.mk       Thu Apr 29 05:09:08 2021 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-rts_ghc.mk,v 1.1 2021/04/29 05:09:08 pho Exp $
+
+This is for Darwin. See the patch to rules/distdir-way-opts.mk.
+
+--- rts/ghc.mk.orig    2021-04-29 03:14:20.000000000 +0000
++++ rts/ghc.mk
+@@ -251,6 +251,7 @@ endif
+ $$(rts_$1_LIB) : $$(rts_$1_OBJS) $$(rts_$1_DTRACE_OBJS) rts/dist/libs.depend $$(rts_dist_FFI_SO)
+       "$$(RM)" $$(RM_OPTS) $$@
+       "$$(rts_dist_HC)" -this-unit-id rts -shared -dynamic -dynload deploy \
++        -dylib-install-name $$(ghclibdir)/rts/$$(rts_$1_LIB_FILE) \
+         -no-auto-link-packages $$(LIBFFI_LIBS) `cat rts/dist/libs.depend` $$(rts_$1_OBJS) \
+           $$(rts_dist_$1_GHC_LD_OPTS) \
+         $$(rts_$1_DTRACE_OBJS) -o $$@
diff -r 768a3f2dff3a -r fc7028c2e895 lang/ghc88/patches/patch-rules_build-package-way.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc88/patches/patch-rules_build-package-way.mk       Thu Apr 29 05:09:08 2021 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-rules_build-package-way.mk,v 1.1 2021/04/29 05:09:08 pho Exp $
+
+This is for Darwin. See the patch to rules/distdir-way-opts.mk.
+
+--- rules/build-package-way.mk.orig    2021-04-28 17:51:42.000000000 +0000
++++ rules/build-package-way.mk
+@@ -64,6 +64,7 @@ else # ifneq "$$(TargetOS_CPP)" "mingw32
+ $$($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_COMPONENT_ID)/$$($1_$2_$3_LIB_FILE) \
+        $$(addprefix -l,$$($1_$2_EXTRA_LIBRARIES)) $$(addprefix -L,$$($1_$2_EXTRA_LIBDIRS)) \
+          -no-auto-link-packages \
+          -o $$@
diff -r 768a3f2dff3a -r fc7028c2e895 lang/ghc88/patches/patch-rules_distdir-way-opts.mk
--- a/lang/ghc88/patches/patch-rules_distdir-way-opts.mk        Thu Apr 29 03:06:41 2021 +0000
+++ b/lang/ghc88/patches/patch-rules_distdir-way-opts.mk        Thu Apr 29 05:09:08 2021 +0000
@@ -1,10 +1,17 @@
-$NetBSD: patch-rules_distdir-way-opts.mk,v 1.3 2021/04/28 15:39:23 pho Exp $
+$NetBSD: patch-rules_distdir-way-opts.mk,v 1.4 2021/04/29 05:09:08 pho Exp $
+
+Use correct RPATHs. On ELF we replace "$ORIGIN/../{PACKAGE_ID}" with
+the final installation path.
 
-Use correct RPATHs.
+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     2020-07-08 16:43:04.000000000 +0000
 +++ rules/distdir-way-opts.mk
-@@ -209,7 +209,7 @@ ifneq "$4" "0"
+@@ -209,11 +209,10 @@ ifneq "$4" "0"
  ifeq "$$(TargetElf)" "YES"
  $1_$2_$3_GHC_LD_OPTS += \
      -fno-use-rpaths \
@@ -12,4 +19,9 @@
 +    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_COMPONENT_IDS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)$$(ghclibdir)/$$d)
  else ifeq "$$(TargetOS_CPP)" "darwin"
  $1_$2_$3_GHC_LD_OPTS += \
-     -fno-use-rpaths \
+-    -fno-use-rpaths \
+-    $$(foreach d,$$($1_$2_TRANSITIVE_DEP_COMPONENT_IDS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'@loader_path/../$$d')
++    -fno-use-rpaths
+ endif
+ endif
+ endif



Home | Main Index | Thread Index | Old Index