On Sun, 16 Sep 2012, Nigel Taylor wrote:
> On 09/08/12 22:22, Matthias Kilian wrote:
> > Hi,
> >
> > On Wed, Sep 05, 2012 at 10:01:37PM +0100, Stuart Henderson wrote:
> >>> After the switch to __guard_local, ghc's "dynamic linker" currently
> >>> doesn't work any longer, which causes *at least* devel/hs-vector
> >>> and devel/hs-type-level builds to fail (probably other hs-* ports
> >>> that use template-Haskell. I'm awaere of it, and I hope to find
> >>> time to fix this soon.
> >>
> >> In an i386 bulk, these 2 were the only hs-* ports failing (plus any
> >> depending on these which were knocked out of the build)
> >
> > And those depending are really wubscale ;-)
> >
> >> Both were related to gmp,
> >>
> >> Loading package integer-gmp ... linking ... ghc: /usr/local/lib/libgmp.a:
> >> unknown symbol `__guard_local'
> >
> > Does the attached patch on i386
> >
> > - help to build hs-vector and hs-type-level,
> >
> > - allow to start ghci without immediately failing when loading
> > integer-gmp?
> >
> > Please be aware that the patch is *not* a proper fix but rather a
> > quick hack. I only want to see wether it's worth patching ghc's
> > internal linker at all. The other option would be to enable shared
> > haskell libraries.
> >
> > Ciao,
> > Kili
> >
> >
> > Index: patches/patch-rts_Linker_c
> > ===================================================================
> > RCS file: patches/patch-rts_Linker_c
> > diff -N patches/patch-rts_Linker_c
> > --- /dev/null 1 Jan 1970 00:00:00 -0000
> > +++ patches/patch-rts_Linker_c 8 Sep 2012 21:08:43 -0000
> > @@ -0,0 +1,33 @@
> > +$OpenBSD$
> > +--- rts/Linker.c.orig Wed Jun 6 19:10:25 2012
> > ++++ rts/Linker.c Fri Sep 7 00:46:07 2012
> > +@@ -563,6 +563,13 @@ typedef struct _RtsSymbolVal {
> > + #define RTS_DARWIN_ONLY_SYMBOLS
> > + #endif
> > +
> > ++#if defined(openbsd_HOST_OS)
> > ++#define RTS_OPENBSD_ONLY_SYMBOLS \
> > ++ SymE_NeedsProto(__guard_local)
> > ++#else
> > ++#define RTS_OPENBSD_ONLY_SYMBOLS
> > ++#endif
> > ++
> > + #ifndef SMP
> > + # define MAIN_CAP_SYM SymI_HasProto(MainCapability)
> > + #else
> > +@@ -1084,6 +1091,7 @@ RTS_POSIX_ONLY_SYMBOLS
> > + RTS_MINGW_ONLY_SYMBOLS
> > + RTS_CYGWIN_ONLY_SYMBOLS
> > + RTS_DARWIN_ONLY_SYMBOLS
> > ++RTS_OPENBSD_ONLY_SYMBOLS
> > + RTS_LIBGCC_SYMBOLS
> > + RTS_LIBFFI_SYMBOLS
> > + #undef SymI_NeedsProto
> > +@@ -1119,6 +1127,7 @@ static RtsSymbolVal rtsSyms[] = {
> > + RTS_MINGW_ONLY_SYMBOLS
> > + RTS_CYGWIN_ONLY_SYMBOLS
> > + RTS_DARWIN_ONLY_SYMBOLS
> > ++ RTS_OPENBSD_ONLY_SYMBOLS
> > + RTS_LIBGCC_SYMBOLS
> > + RTS_LIBFFI_SYMBOLS
> > + #if defined(darwin_HOST_OS) && defined(i386_HOST_ARCH)
> >
> >
> Missed the e-mail on @ports till mentioned on icb, have only just tried this
>
> I applied the patches to both amd64 and i386, the two failing ports
> hs-vector and hs-type-level built on i386, not on amd64.
Hi all,
The diff below, replacing SymE_NeedsProto with SymI_NeedsProto,
makes things work for me on amd64 (tested with hs-vector and
hs-type-level)...
*GIANT* WARNING:
http://blogs.gnome.org/diegoe/files/2012/09/no-idea-what-im-doing-dog.jpg
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/ghc/Makefile,v
retrieving revision 1.81
diff -u -p -r1.81 Makefile
--- Makefile 27 Sep 2012 17:26:05 -0000 1.81
+++ Makefile 1 Oct 2012 14:22:07 -0000
@@ -5,7 +5,7 @@ COMMENT-doc = documentation for GHC
DISTNAME = ghc-${MODGHC_VER}
PKGNAME-main = ghc-${MODGHC_VER}
-REVISION-main = 0
+REVISION-main = 1
PKGNAME-doc = ghc-doc-${MODGHC_VER}
CATEGORIES = lang devel
HOMEPAGE = http://www.haskell.org/ghc/
Index: patches/patch-rts_Linker_c
===================================================================
RCS file: patches/patch-rts_Linker_c
diff -N patches/patch-rts_Linker_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-rts_Linker_c 1 Oct 2012 14:22:07 -0000
@@ -0,0 +1,33 @@
+$OpenBSD$
+--- rts/Linker.c.orig Mon Oct 1 11:41:46 2012
++++ rts/Linker.c Mon Oct 1 11:45:15 2012
+@@ -563,6 +563,13 @@ typedef struct _RtsSymbolVal {
+ #define RTS_DARWIN_ONLY_SYMBOLS
+ #endif
+
++#if defined(openbsd_HOST_OS)
++#define RTS_OPENBSD_ONLY_SYMBOLS \
++ SymI_NeedsProto(__guard_local)
++#else
++#define RTS_OPENBSD_ONLY_SYMBOLS
++#endif
++
+ #ifndef SMP
+ # define MAIN_CAP_SYM SymI_HasProto(MainCapability)
+ #else
+@@ -1084,6 +1091,7 @@ RTS_POSIX_ONLY_SYMBOLS
+ RTS_MINGW_ONLY_SYMBOLS
+ RTS_CYGWIN_ONLY_SYMBOLS
+ RTS_DARWIN_ONLY_SYMBOLS
++RTS_OPENBSD_ONLY_SYMBOLS
+ RTS_LIBGCC_SYMBOLS
+ RTS_LIBFFI_SYMBOLS
+ #undef SymI_NeedsProto
+@@ -1119,6 +1127,7 @@ static RtsSymbolVal rtsSyms[] = {
+ RTS_MINGW_ONLY_SYMBOLS
+ RTS_CYGWIN_ONLY_SYMBOLS
+ RTS_DARWIN_ONLY_SYMBOLS
++ RTS_OPENBSD_ONLY_SYMBOLS
+ RTS_LIBGCC_SYMBOLS
+ RTS_LIBFFI_SYMBOLS
+ #if defined(darwin_HOST_OS) && defined(i386_HOST_ARCH)