From ce9a12321f228ab68934e3031c32ab7f9a2173fc Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Fri, 28 Aug 2009 12:58:02 +0000 Subject: [PATCH] Fix #3461: protect the use of keepCAFs with #ifdef DYNAMIC --- compiler/ghci/keepCAFsForGHCi.c | 2 ++ rts/sm/Storage.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/compiler/ghci/keepCAFsForGHCi.c b/compiler/ghci/keepCAFsForGHCi.c index 0a9c1b4..f125d4c 100644 --- a/compiler/ghci/keepCAFsForGHCi.c +++ b/compiler/ghci/keepCAFsForGHCi.c @@ -6,9 +6,11 @@ // This is required so that GHCi can use dynamic libraries instead of HSxyz.o // files. +#ifdef DYNAMIC static void keepCAFsForGHCi() __attribute__((constructor)); static void keepCAFsForGHCi() { keepCAFs = 1; } +#endif diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index 59a41b0..f0506cd 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -330,6 +330,7 @@ newCAF(StgClosure* caf) { ACQUIRE_SM_LOCK; +#ifdef DYNAMIC if(keepCAFs) { // HACK: @@ -347,6 +348,7 @@ newCAF(StgClosure* caf) caf_list = caf; } else +#endif { /* Put this CAF on the mutable list for the old generation. * This is a HACK - the IND_STATIC closure doesn't really have -- 1.7.10.4