Fix #3461: protect the use of keepCAFs with #ifdef DYNAMIC
authorSimon Marlow <marlowsd@gmail.com>
Fri, 28 Aug 2009 12:58:02 +0000 (12:58 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 28 Aug 2009 12:58:02 +0000 (12:58 +0000)
compiler/ghci/keepCAFsForGHCi.c
rts/sm/Storage.c

index 0a9c1b4..f125d4c 100644 (file)
@@ -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
index 59a41b0..f0506cd 100644 (file)
@@ -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