Patchwork Re: [PATCH 3/3] Add FreeBSD/ppc host TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET} definitions.

login
register
mail settings
Submitter Juergen Lock
Date Feb. 16, 2010, 9:14 p.m.
Message ID <20100216211414.GA81084@triton8.kn-bremen.de>
Download mbox | patch
Permalink /patch/45561/
State New
Headers show

Comments

Juergen Lock - Feb. 16, 2010, 9:14 p.m.
On Sun, Feb 14, 2010 at 09:13:31PM +0100, Juergen Lock wrote:
> Submitted by: Andreas Tobler <andreast@fgznet.ch>
> 
> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> 
> --- a/tcg/ppc/tcg-target.h
> +++ b/tcg/ppc/tcg-target.h
> @@ -69,7 +69,7 @@
>  #define TCG_TARGET_CALL_STACK_OFFSET 24
>  #elif defined _AIX
>  #define TCG_TARGET_CALL_STACK_OFFSET 52
> -#elif defined __linux__
> +#elif defined __linux__ || defined __FreeBSD__ || defined(__FreeBSD_kernel__)
>  #define TCG_TARGET_CALL_ALIGN_ARGS 1
>  #define TCG_TARGET_CALL_STACK_OFFSET 8
>  #else

New version using ppc _CALL_* definitions after malc's comments:

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Andreas Färber - April 6, 2010, 4:28 p.m.
Am 16.02.2010 um 22:14 schrieb Juergen Lock:

> On Sun, Feb 14, 2010 at 09:13:31PM +0100, Juergen Lock wrote:
>> Submitted by: Andreas Tobler <andreast@fgznet.ch>
>>
>> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
>>
>> --- a/tcg/ppc/tcg-target.h
>> +++ b/tcg/ppc/tcg-target.h
>> @@ -69,7 +69,7 @@
>> #define TCG_TARGET_CALL_STACK_OFFSET 24
>> #elif defined _AIX
>> #define TCG_TARGET_CALL_STACK_OFFSET 52
>> -#elif defined __linux__
>> +#elif defined __linux__ || defined __FreeBSD__ ||  
>> defined(__FreeBSD_kernel__)
>> #define TCG_TARGET_CALL_ALIGN_ARGS 1
>> #define TCG_TARGET_CALL_STACK_OFFSET 8
>> #else
>
> New version using ppc _CALL_* definitions after malc's comments:
>
> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
>
> --- a/tcg/ppc/tcg-target.h
> +++ b/tcg/ppc/tcg-target.h
> @@ -65,11 +65,11 @@ enum {
> /* used for function call generation */
> #define TCG_REG_CALL_STACK TCG_REG_R1
> #define TCG_TARGET_STACK_ALIGN 16
> -#if defined __APPLE__
> +#if defined _CALL_DARWIN
> #define TCG_TARGET_CALL_STACK_OFFSET 24

5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X  
v10.5 ppc: Apparently _CALL_DARWIN is not defined, so it runs into the  
#else.

Andreas

> -#elif defined _AIX
> +#elif defined _CALL_AIX
> #define TCG_TARGET_CALL_STACK_OFFSET 52
> -#elif defined __linux__
> +#elif defined _CALL_SYSV
> #define TCG_TARGET_CALL_ALIGN_ARGS 1
> #define TCG_TARGET_CALL_STACK_OFFSET 8
> #else
>
>
malc - April 6, 2010, 5:14 p.m.
On Tue, 6 Apr 2010, Andreas F?rber wrote:

> 
> Am 16.02.2010 um 22:14 schrieb Juergen Lock:
> 
> > On Sun, Feb 14, 2010 at 09:13:31PM +0100, Juergen Lock wrote:
> > > Submitted by: Andreas Tobler <andreast@fgznet.ch>
> > > 
> > > Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> > > 
> > > --- a/tcg/ppc/tcg-target.h
> > > +++ b/tcg/ppc/tcg-target.h
> > > @@ -69,7 +69,7 @@
> > > #define TCG_TARGET_CALL_STACK_OFFSET 24
> > > #elif defined _AIX
> > > #define TCG_TARGET_CALL_STACK_OFFSET 52
> > > -#elif defined __linux__
> > > +#elif defined __linux__ || defined __FreeBSD__ ||
> > > defined(__FreeBSD_kernel__)
> > > #define TCG_TARGET_CALL_ALIGN_ARGS 1
> > > #define TCG_TARGET_CALL_STACK_OFFSET 8
> > > #else
> > 
> > New version using ppc _CALL_* definitions after malc's comments:
> > 
> > Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> > 
> > --- a/tcg/ppc/tcg-target.h
> > +++ b/tcg/ppc/tcg-target.h
> > @@ -65,11 +65,11 @@ enum {
> > /* used for function call generation */
> > #define TCG_REG_CALL_STACK TCG_REG_R1
> > #define TCG_TARGET_STACK_ALIGN 16
> > -#if defined __APPLE__
> > +#if defined _CALL_DARWIN
> > #define TCG_TARGET_CALL_STACK_OFFSET 24
> 
> 5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X v10.5
> ppc: Apparently _CALL_DARWIN is not defined, so it runs into the #else.

Which gcc version?

> 
> Andreas
> 
> > -#elif defined _AIX
> > +#elif defined _CALL_AIX
> > #define TCG_TARGET_CALL_STACK_OFFSET 52
> > -#elif defined __linux__
> > +#elif defined _CALL_SYSV
> > #define TCG_TARGET_CALL_ALIGN_ARGS 1
> > #define TCG_TARGET_CALL_STACK_OFFSET 8
> > #else
> > 
>
Andreas Färber - April 6, 2010, 5:19 p.m.
Am 06.04.2010 um 19:14 schrieb malc:

> On Tue, 6 Apr 2010, Andreas F?rber wrote:
>
>> 5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac  
>> OS X v10.5
>> ppc: Apparently _CALL_DARWIN is not defined, so it runs into the  
>> #else.
>
> Which gcc version?

powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)

Andreas
malc - April 6, 2010, 5:44 p.m.
On Tue, 6 Apr 2010, Andreas F?rber wrote:

> Am 06.04.2010 um 19:14 schrieb malc:
> 
> > On Tue, 6 Apr 2010, Andreas F?rber wrote:
> > 
> > > 5da79c86a3744e3a901c7986c109dd06951befd2 broke compilation on Mac OS X
> > > v10.5
> > > ppc: Apparently _CALL_DARWIN is not defined, so it runs into the #else.
> > 
> > Which gcc version?
> 
> powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)

I guess your only option is to cook up a patch since i don't have
development stuff on my Mac OS X (and i'm reluctant on reverting
the aforementioned commit)

Patch

--- a/tcg/ppc/tcg-target.h
+++ b/tcg/ppc/tcg-target.h
@@ -65,11 +65,11 @@  enum {
 /* used for function call generation */
 #define TCG_REG_CALL_STACK TCG_REG_R1
 #define TCG_TARGET_STACK_ALIGN 16
-#if defined __APPLE__
+#if defined _CALL_DARWIN
 #define TCG_TARGET_CALL_STACK_OFFSET 24
-#elif defined _AIX
+#elif defined _CALL_AIX
 #define TCG_TARGET_CALL_STACK_OFFSET 52
-#elif defined __linux__
+#elif defined _CALL_SYSV
 #define TCG_TARGET_CALL_ALIGN_ARGS 1
 #define TCG_TARGET_CALL_STACK_OFFSET 8
 #else