I only tested the attached up to `make patch`. I have a build running
on amd64-current. It shows the export-dynamic token has disappeared
from the build log so far. While the patch is not known to have fixed
the problem with clang 10, it looks promising.

Thanks
Greg

P.S. Also in cvs:~gnezdo/lang-ghc-clang10.patch
-- 
nest.cx is Gmail hosted, use PGP: https://pgp.key-server.io/0x0B1542BD8DF5A1B0
Fingerprint: 5E2B 2D0E 1E03 2046 BEC3  4D50 0B15 42BD 8DF5 A1B0
lang/ghc workaround for clang 10 fallout

Adapted from https://gitlab.haskell.org/ghc/ghc/-/issues/17962

--
diff --git lang/ghc/Makefile lang/ghc/Makefile
index e520c1d7bd5..05d364eec53 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 =		4
+REVISION =		5
 CATEGORIES =		lang devel
 HOMEPAGE =		https://www.haskell.org/ghc/
 
diff --git lang/ghc/patches/patch-utils_iserv_ghc_mk lang/ghc/patches/patch-utils_iserv_ghc_mk
new file mode 100644
index 00000000000..a5ab9a2a46a
--- /dev/null
+++ lang/ghc/patches/patch-utils_iserv_ghc_mk
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+Work around https://gitlab.haskell.org/ghc/ghc/-/issues/17962
+
+Index: utils/iserv/ghc.mk
+--- utils/iserv/ghc.mk.orig
++++ utils/iserv/ghc.mk
+@@ -30,8 +30,9 @@ endif
+ # refer to the RTS.  This is harmless if you don't use it (adds a bit
+ # of overhead to startup and increases the binary sizes) but if you
+ # need it there's no alternative.
++# Don't do this on systems known to use clang 10 to work around #17962.
+ ifeq "$(TargetElf)" "YES"
+-ifneq "$(TargetOS_CPP)" "solaris2"
++ifeq "$(findstring $(TargetOS_CPP), freebsd openbsd solaris2)" ""
+ # The Solaris linker does not support --export-dynamic option. It also
+ # does not need it since it exports all dynamic symbols by default
+ utils/iserv_stage2_MORE_HC_OPTS += -optl-Wl,--export-dynamic

Reply via email to