Patchwork TCG: Fix Darwin/ppc calling convention recognition

login
register
mail settings
Submitter Andreas Färber
Date Aug. 14, 2010, 6:51 p.m.
Message ID <1281811910-8824-1-git-send-email-andreas.faerber@web.de>
Download mbox | patch
Permalink /patch/61734/
State New
Headers show

Comments

Andreas Färber - Aug. 14, 2010, 6:51 p.m.
5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X v10.5 ppc.
Apple's GCC 4.0.1 does not define _CALL_DARWIN. Recognize __APPLE__ again as well.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: malc <av1474@comtv.ru>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jürgen Lock <nox@jelal.kn-bremen.de>
Cc: Stefan Weil <weil@mail.berlios.de>
---
 Been using a similar patch for some time but apparently hadn't posted it yet...
 Together with one of Cam's KVM-related patches this fixes the build for me.
 
 Regards,
 Andreas
 
 tcg/ppc/tcg-target.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
malc - Aug. 14, 2010, 8:41 p.m.
On Sat, 14 Aug 2010, Andreas F?rber wrote:

> 5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X 
> v10.5 ppc. Apple's GCC 4.0.1 does not define _CALL_DARWIN. Recognize 
> __APPLE__ again as well.

Thanks. Applied.

> 
> Signed-off-by: Andreas F?rber <andreas.faerber@web.de>
> Cc: malc <av1474@comtv.ru>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: J?rgen Lock <nox@jelal.kn-bremen.de>
> Cc: Stefan Weil <weil@mail.berlios.de>
> ---
>  Been using a similar patch for some time but apparently hadn't posted it yet...
>  Together with one of Cam's KVM-related patches this fixes the build for me.
>  
>  Regards,
>  Andreas
>  
>  tcg/ppc/tcg-target.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
> index 5302428..a1f8599 100644
> --- a/tcg/ppc/tcg-target.h
> +++ b/tcg/ppc/tcg-target.h
> @@ -65,7 +65,7 @@ enum {
>  /* used for function call generation */
>  #define TCG_REG_CALL_STACK TCG_REG_R1
>  #define TCG_TARGET_STACK_ALIGN 16
> -#if defined _CALL_DARWIN
> +#if defined _CALL_DARWIN || defined __APPLE__
>  #define TCG_TARGET_CALL_STACK_OFFSET 24
>  #elif defined _CALL_AIX
>  #define TCG_TARGET_CALL_STACK_OFFSET 52
>

Patch

diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h
index 5302428..a1f8599 100644
--- a/tcg/ppc/tcg-target.h
+++ b/tcg/ppc/tcg-target.h
@@ -65,7 +65,7 @@  enum {
 /* used for function call generation */
 #define TCG_REG_CALL_STACK TCG_REG_R1
 #define TCG_TARGET_STACK_ALIGN 16
-#if defined _CALL_DARWIN
+#if defined _CALL_DARWIN || defined __APPLE__
 #define TCG_TARGET_CALL_STACK_OFFSET 24
 #elif defined _CALL_AIX
 #define TCG_TARGET_CALL_STACK_OFFSET 52