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)

Reply via email to