Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LbJwj-0002k3-Gt for qemu-devel@nongnu.org; Sun, 22 Feb 2009 14:25:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LbJwi-0002jl-4f for qemu-devel@nongnu.org; Sun, 22 Feb 2009 14:25:01 -0500 Received: from [199.232.76.173] (port=44886 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LbJwh-0002jg-RQ for qemu-devel@nongnu.org; Sun, 22 Feb 2009 14:24:59 -0500 Received: from ns.suse.de ([195.135.220.2]:35147 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LbJwh-00085e-BC for qemu-devel@nongnu.org; Sun, 22 Feb 2009 14:24:59 -0500 Message-Id: From: Alexander Graf In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: [PATCH] [RESEND] Re: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf) Date: Sun, 22 Feb 2009 20:24:20 +0100 References: Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: Anthony Liguori , qemu-devel@nongnu.org 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 >>> >> >> 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 >> --- >> >> 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