qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf)
@ 2009-01-26 15:37 Anthony Liguori
  2009-02-01 12:06 ` [PATCH] " Andreas Färber
  0 siblings, 1 reply; 10+ messages in thread
From: Anthony Liguori @ 2009-01-26 15:37 UTC (permalink / raw)
  To: qemu-devel

Revision: 6443
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6443
Author:   aliguori
Date:     2009-01-26 15:37:40 +0000 (Mon, 26 Jan 2009)

Log Message:
-----------
Enabled building of x86_64 code on Mac OS X (Alexander Graf)

Mac OS X 10.5 supports 64-bit userspace on an x86_64 kernel and
by default uses 32-bit userspace applications, so the detection for
the host architecture fails.

This patch enabled building of x86_64 code on x86_64 capable CPUS
with Mac OS X.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    trunk/configure

Modified: trunk/configure
===================================================================
--- trunk/configure	2009-01-26 15:37:35 UTC (rev 6442)
+++ trunk/configure	2009-01-26 15:37:40 UTC (rev 6443)
@@ -243,11 +243,21 @@
 Darwin)
 bsd="yes"
 darwin="yes"
+# on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can run 64-bit userspace code
+is_x86_64=`sysctl -n hw.optional.x86_64`
+if [ "$is_x86_64" = "1" ]; then
+    cpu=x86_64
+fi
+if [ "$cpu" = "x86_64" ] ; then
+    OS_CFLAGS="-arch x86_64"
+    LDFLAGS="-arch x86_64"
+else
+    OS_CFLAGS="-mdynamic-no-pic"
+fi
 darwin_user="yes"
 cocoa="yes"
 audio_drv_list="coreaudio"
 audio_possible_drivers="coreaudio sdl fmod"
-OS_CFLAGS="-mdynamic-no-pic"
 OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
 ;;
 SunOS)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] Re: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf)
  2009-01-26 15:37 [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf) Anthony Liguori
@ 2009-02-01 12:06 ` Andreas Färber
  2009-02-22 15:16   ` [PATCH] [RESEND] " Andreas Färber
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Färber @ 2009-02-01 12:06 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]


Am 26.01.2009 um 16:37 schrieb Anthony Liguori:

> Revision: 6443
>          http://svn.sv.gnu.org/viewvc/? 
> view=rev&root=qemu&revision=6443
> Author:   aliguori
> Date:     2009-01-26 15:37:40 +0000 (Mon, 26 Jan 2009)
>
> Log Message:
> -----------
> Enabled building of x86_64 code on Mac OS X (Alexander Graf)
>
> Mac OS X 10.5 supports 64-bit userspace on an x86_64 kernel and
> by default uses 32-bit userspace applications, so the detection for
> the host architecture fails.
>
> This patch enabled building of x86_64 code on x86_64 capable CPUS
> with Mac OS X.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>
> Modified Paths:
> --------------
>    trunk/configure
>
> Modified: trunk/configure
> ===================================================================
> --- trunk/configure	2009-01-26 15:37:35 UTC (rev 6442)
> +++ trunk/configure	2009-01-26 15:37:40 UTC (rev 6443)
> @@ -243,11 +243,21 @@
> Darwin)
> bsd="yes"
> darwin="yes"
> +# on Leopard most of the system is 32-bit, so we have to ask the  
> kernel it if we can run 64-bit userspace code
> +is_x86_64=`sysctl -n hw.optional.x86_64`

This results in an error message on OSX/ppc:

second level name optional in hw.optional.x86_64 is invalid

The attached patch silences this error output.

Andreas

[-- Attachment #2: qemu-x64-ppc.diff --]
[-- Type: application/octet-stream, Size: 411 bytes --]

diff --git a/configure b/configure
index c3fbbbe..dffed79 100755
--- a/configure
+++ b/configure
@@ -244,7 +244,7 @@ Darwin)
 bsd="yes"
 darwin="yes"
 # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can run 64-bit userspace code
-is_x86_64=`sysctl -n hw.optional.x86_64`
+is_x86_64=`sysctl -n hw.optional.x86_64 2>/dev/null`
 if [ "$is_x86_64" = "1" ]; then
     cpu=x86_64
 fi

[-- Attachment #3: Type: text/plain, Size: 432 bytes --]



>
> +if [ "$is_x86_64" = "1" ]; then
> +    cpu=x86_64
> +fi
> +if [ "$cpu" = "x86_64" ] ; then
> +    OS_CFLAGS="-arch x86_64"
> +    LDFLAGS="-arch x86_64"
> +else
> +    OS_CFLAGS="-mdynamic-no-pic"
> +fi
> darwin_user="yes"
> cocoa="yes"
> audio_drv_list="coreaudio"
> audio_possible_drivers="coreaudio sdl fmod"
> -OS_CFLAGS="-mdynamic-no-pic"
> OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
> ;;
> SunOS)
>
>
>
>


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] [RESEND] Re: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf)
  2009-02-01 12:06 ` [PATCH] " Andreas Färber
@ 2009-02-22 15:16   ` Andreas Färber
  2009-02-22 15:21     ` Alexander Graf
  2009-02-22 19:15     ` malc
  0 siblings, 2 replies; 10+ messages in thread
From: Andreas Färber @ 2009-02-22 15:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Alexander Graf


Am 01.02.2009 um 13:06 schrieb Andreas Färber:

>
> Am 26.01.2009 um 16:37 schrieb Anthony Liguori:
>
>> Revision: 6443
>>         http://svn.sv.gnu.org/viewvc/? 
>> view=rev&root=qemu&revision=6443
>> Author:   aliguori
>> Date:     2009-01-26 15:37:40 +0000 (Mon, 26 Jan 2009)
>>
>> Log Message:
>> -----------
>> Enabled building of x86_64 code on Mac OS X (Alexander Graf)
>>
>> Mac OS X 10.5 supports 64-bit userspace on an x86_64 kernel and
>> by default uses 32-bit userspace applications, so the detection for
>> the host architecture fails.
>>
>> This patch enabled building of x86_64 code on x86_64 capable CPUS
>> with Mac OS X.
>>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>
>> Modified Paths:
>> --------------
>>   trunk/configure
>>
>> Modified: trunk/configure
>> ===================================================================
>> --- trunk/configure	2009-01-26 15:37:35 UTC (rev 6442)
>> +++ trunk/configure	2009-01-26 15:37:40 UTC (rev 6443)
>> @@ -243,11 +243,21 @@
>> Darwin)
>> bsd="yes"
>> darwin="yes"
>> +# on Leopard most of the system is 32-bit, so we have to ask the  
>> kernel it if we can run 64-bit userspace code
>> +is_x86_64=`sysctl -n hw.optional.x86_64`
>
> This results in an error message on OSX/ppc:
>
> second level name optional in hw.optional.x86_64 is invalid
>
> The attached patch silences this error output.
>
> Andreas
> <qemu-x64-ppc.diff>

My patch still applies cleanly against r6638. Please apply.

It's trivial, but in any case:


Silence x64 check on OSX/ppc.

The check for x86_64 on Mac OS X results in an error message on ppc:

second level name optional in hw.optional.x86_64 is invalid

Suppress this message by redirecting error output.

Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
---

diff --git a/configure b/configure
index c3fbbbe..dffed79 100755
--- a/configure
+++ b/configure
@@ -244,7 +244,7 @@ Darwin)
  bsd="yes"
  darwin="yes"
  # on Leopard most of the system is 32-bit, so we have to ask the  
kernel it if we can run 64-bit userspace code
-is_x86_64=`sysctl -n hw.optional.x86_64`
+is_x86_64=`sysctl -n hw.optional.x86_64 2>/dev/null`
  if [ "$is_x86_64" = "1" ]; then
      cpu=x86_64
  fi

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] [RESEND] Re: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf)
  2009-02-22 15:16   ` [PATCH] [RESEND] " Andreas Färber
@ 2009-02-22 15:21     ` Alexander Graf
  2009-02-22 15:50       ` Natalia Portillo
  2009-02-22 18:52       ` Andreas Färber
  2009-02-22 19:15     ` malc
  1 sibling, 2 replies; 10+ messages in thread
From: Alexander Graf @ 2009-02-22 15:21 UTC (permalink / raw)
  To: Andreas Färber; +Cc: Anthony Liguori, qemu-devel


On 22.02.2009, at 16:16, Andreas Färber wrote:

>
> Am 01.02.2009 um 13:06 schrieb Andreas Färber:
>
>>
>> Am 26.01.2009 um 16:37 schrieb Anthony Liguori:
>>
>>> Revision: 6443
>>>        http://svn.sv.gnu.org/viewvc/? 
>>> view=rev&root=qemu&revision=6443
>>> Author:   aliguori
>>> Date:     2009-01-26 15:37:40 +0000 (Mon, 26 Jan 2009)
>>>
>>> Log Message:
>>> -----------
>>> Enabled building of x86_64 code on Mac OS X (Alexander Graf)
>>>
>>> Mac OS X 10.5 supports 64-bit userspace on an x86_64 kernel and
>>> by default uses 32-bit userspace applications, so the detection for
>>> the host architecture fails.
>>>
>>> This patch enabled building of x86_64 code on x86_64 capable CPUS
>>> with Mac OS X.
>>>
>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>>
>>> Modified Paths:
>>> --------------
>>>  trunk/configure
>>>
>>> Modified: trunk/configure
>>> ===================================================================
>>> --- trunk/configure	2009-01-26 15:37:35 UTC (rev 6442)
>>> +++ trunk/configure	2009-01-26 15:37:40 UTC (rev 6443)
>>> @@ -243,11 +243,21 @@
>>> Darwin)
>>> bsd="yes"
>>> darwin="yes"
>>> +# on Leopard most of the system is 32-bit, so we have to ask the  
>>> kernel it if we can run 64-bit userspace code
>>> +is_x86_64=`sysctl -n hw.optional.x86_64`
>>
>> This results in an error message on OSX/ppc:
>>
>> second level name optional in hw.optional.x86_64 is invalid
>>
>> The attached patch silences this error output.
>>
>> Andreas
>> <qemu-x64-ppc.diff>
>
> My patch still applies cleanly against r6638. Please apply.
>
> It's trivial, but in any case:
>
>
> Silence x64 check on OSX/ppc.
>
> The check for x86_64 on Mac OS X results in an error message on ppc:
>
> second level name optional in hw.optional.x86_64 is invalid
>
> Suppress this message by redirecting error output.
>
> Signed-off-by: Andreas Faerber <andreas.faerber@web.de>

Acked-by: Alexander Graf <agraf@suse.de>

I haven't compile tested it, but it looks pretty obvious :-).

Alex

>
> ---
>
> diff --git a/configure b/configure
> index c3fbbbe..dffed79 100755
> --- a/configure
> +++ b/configure
> @@ -244,7 +244,7 @@ Darwin)
> bsd="yes"
> darwin="yes"
> # on Leopard most of the system is 32-bit, so we have to ask the  
> kernel it if we can run 64-bit userspace code
> -is_x86_64=`sysctl -n hw.optional.x86_64`
> +is_x86_64=`sysctl -n hw.optional.x86_64 2>/dev/null`
> if [ "$is_x86_64" = "1" ]; then
>     cpu=x86_64
> fi
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] [RESEND] Re: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf)
  2009-02-22 15:21     ` Alexander Graf
@ 2009-02-22 15:50       ` Natalia Portillo
  2009-02-22 18:48         ` Andreas Färber
  2009-02-22 18:52       ` Andreas Färber
  1 sibling, 1 reply; 10+ messages in thread
From: Natalia Portillo @ 2009-02-22 15:50 UTC (permalink / raw)
  To: qemu-devel

Why not to just simply compile a multiarchitecture fat?
It is possible in 10.4 and 10.5 SDKs to compile at the same time ppc,  
ppc64, ia32 and x86_64 fully independent of what cpu is running.
On execute time the OS will choose the most adequate.

And remember:
64 bit WILL NOT COMPILE COCOA, this is not implemented until 10.6 SDK.
DEPENDENCIES MUST HAVE THESE ARCHITECTURES AVAILABLE (eg. libSDL, if  
it is not compiled x86_64, linking will fail).

El 22/02/2009, a las 15:21, Alexander Graf escribió:

>
> On 22.02.2009, at 16:16, Andreas Färber wrote:
>
>>
>> Am 01.02.2009 um 13:06 schrieb Andreas Färber:
>>
>>>
>>> Am 26.01.2009 um 16:37 schrieb Anthony Liguori:
>>>
>>>> Revision: 6443
>>>>       http://svn.sv.gnu.org/viewvc/? 
>>>> view=rev&root=qemu&revision=6443
>>>> Author:   aliguori
>>>> Date:     2009-01-26 15:37:40 +0000 (Mon, 26 Jan 2009)
>>>>
>>>> Log Message:
>>>> -----------
>>>> Enabled building of x86_64 code on Mac OS X (Alexander Graf)
>>>>
>>>> Mac OS X 10.5 supports 64-bit userspace on an x86_64 kernel and
>>>> by default uses 32-bit userspace applications, so the detection for
>>>> the host architecture fails.
>>>>
>>>> This patch enabled building of x86_64 code on x86_64 capable CPUS
>>>> with Mac OS X.
>>>>
>>>> Signed-off-by: Alexander Graf <agraf@suse.de>
>>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>>>
>>>> Modified Paths:
>>>> --------------
>>>> trunk/configure
>>>>
>>>> Modified: trunk/configure
>>>> ===================================================================
>>>> --- trunk/configure	2009-01-26 15:37:35 UTC (rev 6442)
>>>> +++ trunk/configure	2009-01-26 15:37:40 UTC (rev 6443)
>>>> @@ -243,11 +243,21 @@
>>>> Darwin)
>>>> bsd="yes"
>>>> darwin="yes"
>>>> +# on Leopard most of the system is 32-bit, so we have to ask the  
>>>> kernel it if we can run 64-bit userspace code
>>>> +is_x86_64=`sysctl -n hw.optional.x86_64`
>>>
>>> This results in an error message on OSX/ppc:
>>>
>>> second level name optional in hw.optional.x86_64 is invalid
>>>
>>> The attached patch silences this error output.
>>>
>>> Andreas
>>> <qemu-x64-ppc.diff>
>>
>> My patch still applies cleanly against r6638. Please apply.
>>
>> It's trivial, but in any case:
>>
>>
>> Silence x64 check on OSX/ppc.
>>
>> The check for x86_64 on Mac OS X results in an error message on ppc:
>>
>> second level name optional in hw.optional.x86_64 is invalid
>>
>> Suppress this message by redirecting error output.
>>
>> Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
>
> Acked-by: Alexander Graf <agraf@suse.de>
>
> I haven't compile tested it, but it looks pretty obvious :-).
>
> Alex
>
>>
>> ---
>>
>> diff --git a/configure b/configure
>> index c3fbbbe..dffed79 100755
>> --- a/configure
>> +++ b/configure
>> @@ -244,7 +244,7 @@ Darwin)
>> bsd="yes"
>> darwin="yes"
>> # on Leopard most of the system is 32-bit, so we have to ask the  
>> kernel it if we can run 64-bit userspace code
>> -is_x86_64=`sysctl -n hw.optional.x86_64`
>> +is_x86_64=`sysctl -n hw.optional.x86_64 2>/dev/null`
>> if [ "$is_x86_64" = "1" ]; then
>>    cpu=x86_64
>> fi
>>
>
>
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] [RESEND] Re: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf)
  2009-02-22 15:50       ` Natalia Portillo
@ 2009-02-22 18:48         ` Andreas Färber
  2009-02-22 19:43           ` Alexander Graf
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Färber @ 2009-02-22 18:48 UTC (permalink / raw)
  To: qemu-devel


Am 22.02.2009 um 16:50 schrieb Natalia Portillo:

> Why not to just simply compile a multiarchitecture fat?
> It is possible in 10.4 and 10.5 SDKs to compile at the same time  
> ppc, ppc64, ia32 and x86_64 fully independent of what cpu is running.
> On execute time the OS will choose the most adequate.

Often due to autoconf et al. it is necessary to postprocess using the  
`lipo` tool instead of directly passing multiple architectures to GCC.  
QEMU's configure detects the endianness for instance, so building a  
classical Universal Binary (ppc+i386) seems destined to fail...

Anyway, having a ppc64 binary in the bundle would on a G5  
unconditionally run the 64-bit version, independent of whether that  
makes sense (e.g., 32-bit guest w/ <4GB RAM). Loading a 64-bit address  
consumes 5 instructions compared to 2 in 32-bit userland; on amd64 it  
probably makes more sense.


> 64 bit WILL NOT COMPILE COCOA, this is not implemented until 10.6 SDK.

I thought it was a feature of v10.5?
Cf. http://www.apple.com/macosx/technology/64bit.html

Andreas

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] [RESEND] Re: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf)
  2009-02-22 15:21     ` Alexander Graf
  2009-02-22 15:50       ` Natalia Portillo
@ 2009-02-22 18:52       ` Andreas Färber
  1 sibling, 0 replies; 10+ messages in thread
From: Andreas Färber @ 2009-02-22 18:52 UTC (permalink / raw)
  To: qemu-devel


Am 22.02.2009 um 16:21 schrieb Alexander Graf:

>
> On 22.02.2009, at 16:16, Andreas Färber wrote:
>
>> Silence x64 check on OSX/ppc.
>>
>> The check for x86_64 on Mac OS X results in an error message on ppc:
>>
>> second level name optional in hw.optional.x86_64 is invalid
>>
>> Suppress this message by redirecting error output.
>>
>> Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
>
> Acked-by: Alexander Graf <agraf@suse.de>
>
> I haven't compile tested it, but it looks pretty obvious :-).

Thanks, I haven't tested it on x86_64 either, but I hope it doesn't  
break. ;-)

Andreas

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] [RESEND] Re: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf)
  2009-02-22 15:16   ` [PATCH] [RESEND] " Andreas Färber
  2009-02-22 15:21     ` Alexander Graf
@ 2009-02-22 19:15     ` malc
  2009-02-22 19:24       ` Alexander Graf
  1 sibling, 1 reply; 10+ messages in thread
From: malc @ 2009-02-22 19:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Alexander Graf

On Sun, 22 Feb 2009, Andreas F?rber wrote:

[..snip..]

> > > bsd="yes"
> > > darwin="yes"
> > > +# on Leopard most of the system is 32-bit, so we have to ask the kernel
> > > it if we can run 64-bit userspace code
> > > +is_x86_64=`sysctl -n hw.optional.x86_64`
> > 
> > This results in an error message on OSX/ppc:
> > 
> > second level name optional in hw.optional.x86_64 is invalid
> > 
> > The attached patch silences this error output.
> > 
> > Andreas
> > <qemu-x64-ppc.diff>
> 
> My patch still applies cleanly against r6638. Please apply.
> 
> It's trivial, but in any case:
> 
> 
> Silence x64 check on OSX/ppc.
> 
> The check for x86_64 on Mac OS X results in an error message on ppc:
> 
> second level name optional in hw.optional.x86_64 is invalid
> 
> Suppress this message by redirecting error output.
> 
> Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
> ---
> 
> diff --git a/configure b/configure
> index c3fbbbe..dffed79 100755
> --- a/configure
> +++ b/configure
> @@ -244,7 +244,7 @@ Darwin)
> bsd="yes"
> darwin="yes"
> # on Leopard most of the system is 32-bit, so we have to ask the kernel it if
> we can run 64-bit userspace code
> -is_x86_64=`sysctl -n hw.optional.x86_64`
> +is_x86_64=`sysctl -n hw.optional.x86_64 2>/dev/null`
> if [ "$is_x86_64" = "1" ]; then
>     cpu=x86_64
> fi
> 
> 

It does silence it, but it will also silence any useful warning/error
messages should there be any, perhaps there's some other way?

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] [RESEND] Re: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf)
  2009-02-22 19:15     ` malc
@ 2009-02-22 19:24       ` Alexander Graf
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Graf @ 2009-02-22 19:24 UTC (permalink / raw)
  To: malc; +Cc: Anthony Liguori, qemu-devel


On 22.02.2009, at 20:15, malc wrote:

> On Sun, 22 Feb 2009, Andreas F?rber wrote:
>
> [..snip..]
>
>>>> bsd="yes"
>>>> darwin="yes"
>>>> +# on Leopard most of the system is 32-bit, so we have to ask the  
>>>> kernel
>>>> it if we can run 64-bit userspace code
>>>> +is_x86_64=`sysctl -n hw.optional.x86_64`
>>>
>>> This results in an error message on OSX/ppc:
>>>
>>> second level name optional in hw.optional.x86_64 is invalid
>>>
>>> The attached patch silences this error output.
>>>
>>> Andreas
>>> <qemu-x64-ppc.diff>
>>
>> My patch still applies cleanly against r6638. Please apply.
>>
>> It's trivial, but in any case:
>>
>>
>> Silence x64 check on OSX/ppc.
>>
>> The check for x86_64 on Mac OS X results in an error message on ppc:
>>
>> second level name optional in hw.optional.x86_64 is invalid
>>
>> Suppress this message by redirecting error output.
>>
>> Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
>> ---
>>
>> diff --git a/configure b/configure
>> index c3fbbbe..dffed79 100755
>> --- a/configure
>> +++ b/configure
>> @@ -244,7 +244,7 @@ Darwin)
>> bsd="yes"
>> darwin="yes"
>> # on Leopard most of the system is 32-bit, so we have to ask the  
>> kernel it if
>> we can run 64-bit userspace code
>> -is_x86_64=`sysctl -n hw.optional.x86_64`
>> +is_x86_64=`sysctl -n hw.optional.x86_64 2>/dev/null`
>> if [ "$is_x86_64" = "1" ]; then
>>    cpu=x86_64
>> fi
>>
>>
>
> It does silence it, but it will also silence any useful warning/error
> messages should there be any, perhaps there's some other way?

There shouldn't be any useful warning/error messages from sysctl. It's  
always there and can be run by any user. IMHO this approach is the  
easiest you can get.
Of course, you could try and check uname for i386 and only then decide  
if you want to go for x86_64, but I don't see any reason to make  
things more complicated than they have to be.

Alex

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] [RESEND] Re: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf)
  2009-02-22 18:48         ` Andreas Färber
@ 2009-02-22 19:43           ` Alexander Graf
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Graf @ 2009-02-22 19:43 UTC (permalink / raw)
  To: qemu-devel


On 22.02.2009, at 19:48, Andreas Färber wrote:

>
> Am 22.02.2009 um 16:50 schrieb Natalia Portillo:
>
>> Why not to just simply compile a multiarchitecture fat?
>> It is possible in 10.4 and 10.5 SDKs to compile at the same time  
>> ppc, ppc64, ia32 and x86_64 fully independent of what cpu is running.
>> On execute time the OS will choose the most adequate.
>
> Often due to autoconf et al. it is necessary to postprocess using  
> the `lipo` tool instead of directly passing multiple architectures  
> to GCC. QEMU's configure detects the endianness for instance, so  
> building a classical Universal Binary (ppc+i386) seems destined to  
> fail...

Creating a universal binary is more hassle than it's worth IMHO. But  
if anyone wants to take on the challenge, I won't keep him.

> Anyway, having a ppc64 binary in the bundle would on a G5  
> unconditionally run the 64-bit version, independent of whether that  
> makes sense (e.g., 32-bit guest w/ <4GB RAM). Loading a 64-bit  
> address consumes 5 instructions compared to 2 in 32-bit userland; on  
> amd64 it probably makes more sense.

I agree here. 64-bit makes a _lot_ more sense on x86_64. You get more  
registers and other neat features (like direct read of rip).

>> 64 bit WILL NOT COMPILE COCOA, this is not implemented until 10.6  
>> SDK.
>
> I thought it was a feature of v10.5?
> Cf. http://www.apple.com/macosx/technology/64bit.html

It worked fine last time I checked. For me cocoa compilation is broken  
right now (x86 and x86_64 alike), but there was an unbreaking fix on  
the list somewhere :)

Alex

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-02-22 19:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26 15:37 [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf) Anthony Liguori
2009-02-01 12:06 ` [PATCH] " Andreas Färber
2009-02-22 15:16   ` [PATCH] [RESEND] " Andreas Färber
2009-02-22 15:21     ` Alexander Graf
2009-02-22 15:50       ` Natalia Portillo
2009-02-22 18:48         ` Andreas Färber
2009-02-22 19:43           ` Alexander Graf
2009-02-22 18:52       ` Andreas Färber
2009-02-22 19:15     ` malc
2009-02-22 19:24       ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).