Patchwork [3/8] linux-user: Fix undefined HOST_LONG_SIZE on PPC hosts

login
register
mail settings
Submitter Alexander Graf
Date May 1, 2012, 8:58 a.m.
Message ID <1335862740-17408-4-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/156034/
State New
Headers show

Comments

Alexander Graf - May 1, 2012, 8:58 a.m.
On my PPC host, HOST_LONG_SIZE is not defined even after
running configure. Use the normal C way of determining the
long size instead.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 thunk.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Andreas Färber - May 1, 2012, 6:32 p.m.
Am 01.05.2012 10:58, schrieb Alexander Graf:
> On my PPC host, HOST_LONG_SIZE is not defined even after
> running configure. Use the normal C way of determining the
> long size instead.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  thunk.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/thunk.h b/thunk.h
> index 5be8f91..87025c3 100644
> --- a/thunk.h
> +++ b/thunk.h
> @@ -113,7 +113,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host)
>        defined(HOST_PARISC) || defined(HOST_SPARC64)
>              return 4;
>  #elif defined(HOST_PPC)
> -            return HOST_LONG_SIZE;
> +            return sizeof(void *);

malc has committed a different fix (TARGET_ABI_BITS / 8) - thanks for
fixing the build - but this PULL will now conflict.

Andreas

>  #else
>              return 2;
>  #endif
Alexander Graf - May 1, 2012, 6:54 p.m.
On 01.05.2012, at 20:32, Andreas Färber wrote:

> Am 01.05.2012 10:58, schrieb Alexander Graf:
>> On my PPC host, HOST_LONG_SIZE is not defined even after
>> running configure. Use the normal C way of determining the
>> long size instead.
>> 
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> ---
>> thunk.h |    2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/thunk.h b/thunk.h
>> index 5be8f91..87025c3 100644
>> --- a/thunk.h
>> +++ b/thunk.h
>> @@ -113,7 +113,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host)
>>       defined(HOST_PARISC) || defined(HOST_SPARC64)
>>             return 4;
>> #elif defined(HOST_PPC)
>> -            return HOST_LONG_SIZE;
>> +            return sizeof(void *);
> 
> malc has committed a different fix (TARGET_ABI_BITS / 8) - thanks for
> fixing the build - but this PULL will now conflict.

:(.

Removed from my queue. I hope I don't have to send out another pull request for that ;).


Alex
Peter Maydell - May 1, 2012, 7:11 p.m.
On 1 May 2012 19:54, Alexander Graf <agraf@suse.de> wrote:
>
> On 01.05.2012, at 20:32, Andreas Färber wrote:
>
>> Am 01.05.2012 10:58, schrieb Alexander Graf:
>>> On my PPC host, HOST_LONG_SIZE is not defined even after
>>> running configure. Use the normal C way of determining the
>>> long size instead.
>>>
>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>> ---
>>> thunk.h |    2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/thunk.h b/thunk.h
>>> index 5be8f91..87025c3 100644
>>> --- a/thunk.h
>>> +++ b/thunk.h
>>> @@ -113,7 +113,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host)
>>>       defined(HOST_PARISC) || defined(HOST_SPARC64)
>>>             return 4;
>>> #elif defined(HOST_PPC)
>>> -            return HOST_LONG_SIZE;
>>> +            return sizeof(void *);
>>
>> malc has committed a different fix (TARGET_ABI_BITS / 8) - thanks for
>> fixing the build - but this PULL will now conflict.
>
> :(.
>
> Removed from my queue.

We need to put out a patch which converts commit b754e4fc1 to
the fix as reviewed on the mailing list, because b754e4fc1 is
incorrect: it is returning the size of a target type when it
should be returning the size of a host type.

-- PMM

Patch

diff --git a/thunk.h b/thunk.h
index 5be8f91..87025c3 100644
--- a/thunk.h
+++ b/thunk.h
@@ -113,7 +113,7 @@  static inline int thunk_type_size(const argtype *type_ptr, int is_host)
       defined(HOST_PARISC) || defined(HOST_SPARC64)
             return 4;
 #elif defined(HOST_PPC)
-            return HOST_LONG_SIZE;
+            return sizeof(void *);
 #else
             return 2;
 #endif