Hi Matthias,

I cleaned up lang/ghc a bit over the last couple of weekends.
I tested by rebuilding a few ports (deps of hs-xmonad-contrib). I also
ran ghci manually (which works normally from a wxallowed fs). Also I
can see the ELF marker:

% objdump -p -j .note.openbsd.ident /usr/local/lib/ghc/bin/ghc | grep
-i WXNEEDED
OPENBSD_WXNEEDED off    0x0000000000000000 vaddr 0x0000000000000000
paddr 0x0000000000000000 align 2**3

Thanks
Greg
-- 
nest.cx is Gmail hosted, use PGP: https://pgp.key-server.io/0x0B1542BD8DF5A1B0
Fingerprint: 5E2B 2D0E 1E03 2046 BEC3  4D50 0B15 42BD 8DF5 A1B0
From dd5d488f4064fc76ac41d5b08725177afab21769 Mon Sep 17 00:00:00 2001
From: Greg Steuck <g...@nest.cx>
Date: Sun, 5 Apr 2020 14:56:42 -0700
Subject: [PATCH] lang/ghc cleanup

Remove -no-pie from GHC_CC_OPTS. Nothing breaks for 8.6.4 and ghc
8.10.1 port starts working.

Remove ffi related patch: since we use system libffi the patch is
irrelevant.

Remove explicit wxneeded: GHC already sets wxneeded on OpenBSD:
https://github.com/ghc/ghc/blob/ghc-8.6/aclocal.m4#L715-L720

Bump REVISION
---
 lang/ghc/Makefile                 | 16 ++++++----------
 lang/ghc/patches/patch-rts_ghc_mk | 19 -------------------
 2 files changed, 6 insertions(+), 29 deletions(-)
 delete mode 100644 lang/ghc/patches/patch-rts_ghc_mk

diff --git lang/ghc/Makefile lang/ghc/Makefile
index e77b92e87e8..0656aa1a446 100644
--- lang/ghc/Makefile
+++ lang/ghc/Makefile
@@ -12,7 +12,7 @@ COMMENT =		compiler for the functional language Haskell
 NO_CCACHE =		Yes
 
 DISTNAME =		ghc-${MODGHC_VER}
-REVISION =		2
+REVISION =		4
 CATEGORIES =		lang devel
 HOMEPAGE =		https://www.haskell.org/ghc/
 
@@ -43,12 +43,11 @@ BUILD_DEPENDS =		archivers/bzip2 \
 			textproc/py-sphinx${MODPY_FLAVOR}
 RUN_DEPENDS =
 
-# We can't use the wrapper script, because it then gets hardcoded into
-# the packaged ghc. So we explicitly use -Wl,-z,wxneeded (see
-# CONFIGURE_ENV below)
+# GHC build uses -Wl,-z,wxneeded on OpenBSD.
+# XXX: wxneeded is a hack. Fix rts/Linker.c, mmapForLinker() and
+#      loadObj_() instead.
 USE_WXNEEDED =		special
 
-
 MASTER_SITES =		${HOMEPAGE}dist/${MODGHC_VER}/ \
 			${HOMEPAGE}dist/stable/dist/
 MASTER_SITES0 =		https://openbsd.dead-parrot.de/distfiles/
@@ -125,15 +124,12 @@ CONFIGURE_ARGS +=	--with-ffi-includes=${LOCALBASE}/include \
 # with /usr/bin/ld.lld: error: cannot preempt symbol: memcpy
 CONFIGURE_ARGS +=	--disable-ld-override
 
-# XXX: wxneeded is a hack. Fix rts/Linker.c, mmapForLinker() and
-#      loadObj_() instead.
-GHC_CC_OPTS =		-fno-pie -nopie
 CONFIGURE_ENV +=	CONF_CC_OPTS_STAGE0="${GHC_CC_OPTS}" \
 			CONF_CC_OPTS_STAGE1="${GHC_CC_OPTS}" \
 			CONF_CC_OPTS_STAGE2="${GHC_CC_OPTS}" \
 			CONF_GCC_LINKER_OPTS_STAGE0="${GHC_CC_OPTS}" \
-			CONF_GCC_LINKER_OPTS_STAGE1="${GHC_CC_OPTS} -Wl,-z,wxneeded" \
-			CONF_GCC_LINKER_OPTS_STAGE2="${GHC_CC_OPTS} -Wl,-z,wxneeded"
+			CONF_GCC_LINKER_OPTS_STAGE1="${GHC_CC_OPTS}" \
+			CONF_GCC_LINKER_OPTS_STAGE2="${GHC_CC_OPTS}"
 
 CONFIGURE_ENV +=	SPHINXBUILD=${LOCALBASE}/bin/sphinx-build${MODPY_BIN_SUFFIX}
 
diff --git lang/ghc/patches/patch-rts_ghc_mk lang/ghc/patches/patch-rts_ghc_mk
deleted file mode 100644
index 0b711c79e1d..00000000000
--- lang/ghc/patches/patch-rts_ghc_mk
+++ /dev/null
@@ -1,19 +0,0 @@
-$OpenBSD: patch-rts_ghc_mk,v 1.1 2019/09/30 11:44:18 kili Exp $
-
-libffi build process seems to be using bundled libtool which only
-produces the .so.8.0 and not a plain .so which is expected to exist.
-The patch forces the dependency on versioned file at the expense of
-hardcoding the version number.
-
-Index: rts/ghc.mk
---- rts/ghc.mk.orig
-+++ rts/ghc.mk
-@@ -126,7 +126,7 @@ rts/dist/build/$(LIBFFI_DLL): libffi/build/inst/bin/$(
- else
- # 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/lib$(LIBFFI_NAME)$(soext): libffi/build/inst/lib/lib$(LIBFFI_NAME)$(soext)
-+rts/dist/build/lib$(LIBFFI_NAME)$(soext): libffi/build/inst/lib/lib$(LIBFFI_NAME)$(soext).8.0
- 	cp libffi/build/inst/lib/lib$(LIBFFI_NAME)$(soext)* rts/dist/build
- ifeq "$(TargetOS_CPP)" "darwin"
- 	install_name_tool -id @rpath/lib$(LIBFFI_NAME)$(soext) rts/dist/build/lib$(LIBFFI_NAME)$(soext)
-- 
2.26.2

Reply via email to