Change some TARGET tests to HOST tests in the RTS
authorIan Lynagh <igloo@earth.li>
Tue, 13 Jul 2010 14:10:34 +0000 (14:10 +0000)
committerIan Lynagh <igloo@earth.li>
Tue, 13 Jul 2010 14:10:34 +0000 (14:10 +0000)
Which was being used seemed to be random

12 files changed:
rts/Adjustor.c
rts/Linker.c
rts/LinkerInternals.h
rts/RetainerProfile.c
rts/RtsDllMain.c
rts/RtsDllMain.h
rts/StgCRun.c
rts/StgMiscClosures.cmm
rts/ghc.mk
rts/sm/Evac.h
rts/sm/GCThread.h
rts/sm/Scav.c

index 382f74a..607c0b8 100644 (file)
@@ -111,7 +111,7 @@ createAdjustor (int cconv,
         arg_types[i] = char_to_ffi_type(typeString[i+1]);
     }
     switch (cconv) {
-#ifdef mingw32_TARGET_OS
+#ifdef mingw32_HOST_OS
     case 0: /* stdcall */
         abi = FFI_STDCALL;
         break;
index 718936a..78bdc8f 100644 (file)
@@ -457,7 +457,7 @@ typedef struct _RtsSymbolVal {
       SymI_NeedsProto(closedir)
 #endif
 
-#if defined(darwin_TARGET_OS) && HAVE_PRINTF_LDBLSTUB
+#if defined(darwin_HOST_OS) && HAVE_PRINTF_LDBLSTUB
 #define RTS_DARWIN_ONLY_SYMBOLS                                    \
      SymI_NeedsProto(asprintf$LDBLStub)                     \
      SymI_NeedsProto(err$LDBLStub)                          \
@@ -1004,7 +1004,7 @@ typedef struct _RtsSymbolVal {
 
 /* entirely bogus claims about types of these symbols */
 #define SymI_NeedsProto(vvv)  extern void vvv(void);
-#if defined(__PIC__) && defined(mingw32_TARGET_OS)
+#if defined(__PIC__) && defined(mingw32_HOST_OS)
 #define SymE_HasProto(vvv)    SymE_HasProto(vvv);
 #define SymE_NeedsProto(vvv)    extern void _imp__ ## vvv (void);
 #else
@@ -2017,7 +2017,7 @@ static SymbolExtra* makeSymbolExtra( ObjectCode* oc,
  * PowerPC specifics (instruction cache flushing)
  * ------------------------------------------------------------------------*/
 
-#ifdef powerpc_TARGET_ARCH
+#ifdef powerpc_HOST_ARCH
 /*
    ocFlushInstructionCache
 
@@ -4021,7 +4021,7 @@ static int ocVerifyImage_MachO(ObjectCode* oc)
     char *image = (char*) oc->image;
     struct mach_header *header = (struct mach_header*) image;
 
-#if x86_64_TARGET_ARCH || powerpc64_TARGET_ARCH
+#if x86_64_HOST_ARCH || powerpc64_HOST_ARCH
     if(header->magic != MH_MAGIC_64)
         return 0;
 #else
@@ -4812,7 +4812,7 @@ static int machoGetMisalignment( FILE * f )
     fread(&header, sizeof(header), 1, f);
     rewind(f);
 
-#if x86_64_TARGET_ARCH || powerpc64_TARGET_ARCH
+#if x86_64_HOST_ARCH || powerpc64_HOST_ARCH
     if(header.magic != MH_MAGIC_64)
         return 0;
 #else
index 8dc6441..8e151ec 100644 (file)
@@ -50,7 +50,7 @@ typedef struct {
         long mtctr_r12;
         long bctr;
     } jumpIsland;
-#elif x86_64_TARGET_ARCH
+#elif x86_64_HOST_ARCH
     uint64_t    addr;
     uint8_t     jumpIsland[6];
 #endif
index 07a3db4..e80a588 100644 (file)
@@ -366,7 +366,7 @@ find_srt( stackPos *info )
        bitmap = info->next.srt.srt_bitmap;
        while (bitmap != 0) {
            if ((bitmap & 1) != 0) {
-#if defined(__PIC__) && defined(mingw32_TARGET_OS)
+#if defined(__PIC__) && defined(mingw32_HOST_OS)
                if ((unsigned long)(*(info->next.srt.srt)) & 0x1)
                    c = (* (StgClosure **)((unsigned long)*(info->next.srt.srt)) & ~0x1);
                else
@@ -1229,7 +1229,7 @@ retainSRT (StgClosure **srt, nat srt_bitmap, StgClosure *c, retainer c_child_r)
 
   while (bitmap != 0) {
       if ((bitmap & 1) != 0) {
-#if defined(__PIC__) && defined(mingw32_TARGET_OS)
+#if defined(__PIC__) && defined(mingw32_HOST_OS)
          if ( (unsigned long)(*srt) & 0x1 ) {
              retainClosure(* (StgClosure**) ((unsigned long) (*srt) & ~0x1), 
                            c, c_child_r);
index 592eb09..2081e62 100644 (file)
@@ -16,7 +16,7 @@
 #endif
 
 /* I'd be mildly surprised if this wasn't defined, but still. */
-#if defined(__PIC__) && defined(mingw32_TARGET_OS)
+#if defined(__PIC__) && defined(mingw32_HOST_OS)
 BOOL
 WINAPI
 DllMain ( HINSTANCE hInstance STG_UNUSED
@@ -40,4 +40,4 @@ DllMain ( HINSTANCE hInstance STG_UNUSED
   return TRUE;
 }
 
-#endif /* defined(__PIC__) && defined(mingw32_TARGET_OS) */
+#endif /* defined(__PIC__) && defined(mingw32_HOST_OS) */
index df5fde9..fc28d90 100644 (file)
@@ -6,7 +6,7 @@
 #endif
 
 /* I'd be mildly surprised if this wasn't defined, but still. */
-#if defined(__PIC__) && defined(mingw32_TARGET_OS)
+#if defined(__PIC__) && defined(mingw32_HOST_OS)
 BOOL
 WINAPI
 DllMain ( HINSTANCE hInstance
index 92ce6eb..e28353c 100644 (file)
@@ -122,7 +122,7 @@ StgFunPtr StgReturn(void)
 
 #ifdef i386_HOST_ARCH
 
-#ifdef darwin_TARGET_OS
+#ifdef darwin_HOST_OS
 #define STG_GLOBAL ".globl "
 #else
 #define STG_GLOBAL ".global "
index c665749..c981cbe 100644 (file)
@@ -546,7 +546,7 @@ INFO_TABLE_CONSTR(stg_MVAR_TSO_QUEUE,2,0,0,PRIM,"MVAR_TSO_QUEUE","MVAR_TSO_QUEUE
    replace them with references to the static objects.
    ------------------------------------------------------------------------- */
 
-#if defined(__PIC__) && defined(mingw32_TARGET_OS)
+#if defined(__PIC__) && defined(mingw32_HOST_OS)
 /*
  * When sticking the RTS in a Windows DLL, we delay populating the
  * Charlike and Intlike tables until load-time, which is only
index 7815e77..7d475a3 100644 (file)
@@ -172,7 +172,7 @@ $$(rts_$1_LIB) : $$(rts_$1_OBJS) rts/libs.depend
        "$$(RM)" $$(RM_OPTS) $$@
        "$$(rts_dist_HC)" -package-name rts -shared -dynamic -dynload deploy \
          -no-auto-link-packages `cat rts/libs.depend` $$(rts_$1_OBJS) -o $$@
-ifeq "$$(darwin_TARGET_OS)" "1"
+ifeq "$$(darwin_HOST_OS)" "1"
        # Ensure library's install name is correct before anyone links with it.
        install_name_tool -id $(ghclibdir)/$$(rts_$1_LIB_NAME) $$@
 endif
index c95658a..ad56c64 100644 (file)
@@ -26,7 +26,7 @@
 //         registers EAX, EDX, and ECX instead of on the stack. Functions that
 //         take a variable number of arguments will continue to be passed all of
 //         their arguments on the stack.
-#if __GNUC__ >= 2 && (defined(x86_64_TARGET_ARCH) || defined(i386_TARGET_ARCH))
+#if __GNUC__ >= 2 && (defined(x86_64_HOST_ARCH) || defined(i386_HOST_ARCH))
 #define REGPARM1 __attribute__((regparm(1)))
 #else
 #define REGPARM1
index 65554c4..c45eb1b 100644 (file)
@@ -226,7 +226,7 @@ extern __thread gc_thread* gct;
 #define DECLARE_GCT __thread gc_thread* gct;
 
 
-#elif defined(sparc_TARGET_ARCH)
+#elif defined(sparc_HOST_ARCH)
 // On SPARC we can't pin gct to a register. Names like %l1 are just offsets
 //     into the register window, which change on each function call.
 //     
index 54bf47c..e59fc75 100644 (file)
@@ -329,7 +329,7 @@ scavenge_srt (StgClosure **srt, nat srt_bitmap)
 
   while (bitmap != 0) {
       if ((bitmap & 1) != 0) {
-#if defined(__PIC__) && defined(mingw32_TARGET_OS)
+#if defined(__PIC__) && defined(mingw32_HOST_OS)
          // Special-case to handle references to closures hiding out in DLLs, since
          // double indirections required to get at those. The code generator knows
          // which is which when generating the SRT, so it stores the (indirect)