From: Simon Marlow Date: Wed, 22 Mar 2006 10:17:46 +0000 (+0000) Subject: fix for gcc 4.1.x X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=a0f46309637779ccc141ec531e9b128596a5bba0 fix for gcc 4.1.x We need to use GNUC3_ATTRIBUTE(used) to force gcc to keep the definition of StgRunIsImplementedInAssembler() around. In some cases we had already made this function external rather than static to get around the problem, but GNUC3_ATTRIBUTE(used) is a better fix. --- diff --git a/ghc/rts/StgCRun.c b/ghc/rts/StgCRun.c index b1e2724..29d4efe 100644 --- a/ghc/rts/StgCRun.c +++ b/ghc/rts/StgCRun.c @@ -203,8 +203,8 @@ StgRun(StgFunPtr f, StgRegTable *basereg) { extern StgRegTable * StgRun(StgFunPtr f, StgRegTable *basereg); -void StgRunIsImplementedInAssembler(void); -void StgRunIsImplementedInAssembler(void) +static void GNUC3_ATTRIBUTE(used) +StgRunIsImplementedInAssembler(void) { __asm__ volatile ( /* @@ -591,7 +591,8 @@ StgRun(StgFunPtr f, StgRegTable *basereg) extern StgRegTable * StgRun(StgFunPtr f, StgRegTable *basereg); #ifdef darwin_HOST_OS -void StgRunIsImplementedInAssembler(void) +static void GNUC3_ATTRIBUTE(used) +StgRunIsImplementedInAssembler(void) { #if HAVE_SUBSECTIONS_VIA_SYMBOLS // if the toolchain supports deadstripping, we have to @@ -629,7 +630,8 @@ void StgRunIsImplementedInAssembler(void) // *) The Link Register is saved to a different offset in the caller's stack frame // (Linux: 4(r1), Darwin 8(r1)) -static void StgRunIsImplementedInAssembler(void) +static void GNUC3_ATTRIBUTE(used) +StgRunIsImplementedInAssembler(void) { __asm__ volatile ( "\t.globl StgRun\n" @@ -708,7 +710,8 @@ static void StgRunIsImplementedInAssembler(void) #ifdef linux_HOST_OS extern StgRegTable * StgRun(StgFunPtr f, StgRegTable *basereg); -static void StgRunIsImplementedInAssembler(void) +static void GNUC3_ATTRIBUTE(used) +StgRunIsImplementedInAssembler(void) { // r0 volatile // r1 stack pointer @@ -858,7 +861,8 @@ static void StgRunIsImplementedInAssembler(void) #define LOCALS 31 #endif -static void StgRunIsImplementedInAssembler(void) +static void GNUC3_ATTRIBUTE(used) +StgRunIsImplementedInAssembler(void) { __asm__ volatile( ".global StgRun\n"