qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] OS X compile fix


From: Peter Bartoli
Subject: Re: [Qemu-devel] OS X compile fix
Date: Sun, 18 May 2014 15:45:52 -0700

On May 18, 2014, at 4:40 AM, Peter Maydell <address@hidden> wrote:
> On 18 May 2014 09:50, Andreas Färber <address@hidden> wrote:
>> Am 18.05.2014 01:14, schrieb Peter Bartoli:
>>> At the recommendation of Mark Cave-Ayland, I'm sending this patch in to
>>> remedy a long-time Mac OS X compile issue.
>> 
>> Define "long-time"? 2.0 compiled just fine for me on v10.5.8 with
>> gcc-4.2. I see a number of deprecation and possibly-used-uninitialized
>> warnings but no breakage. What OSX version and what compiler are you
>> using, and what error or warning are you seeing without your patch?
> 
> Yeah, this must be only a problem on certain OSX setups -- it's
> never been an issue for me on 10.8/x86_64.
> 
> That said, it looks like LONG_LONG_MAX is a pre-C99 version
> and LLONG_MAX the standard macro name. We use LLONG_MAX
> elsewhere (though admittedly only in a test case) so I think it makes
> sense to make this change, especially if it fixes compilation on some
> setups.
> 
> (This use of LONG_LONG_MAX has been in the codebase since
> 2006, so presumably any configs which somehow fail to provide
> this macro have always failed to build without this fix...)
> 
>> Right now on qemu.git I have a different build issue: In scripts/qapi.py
>> "except IOError as e" needs to be "except IOError, e". But
>> block/raw-posix.c still builds fine here.
> 
> "except .. as" came in with python 2.6; we need to use the older
> syntax since we must work with 2.4 still. (Compare commit
> 21e0043bada1 where we fixed a previous round of this.)

So, just to add, in case it's helpful, "long time" means since 2012-ish, when 
QEMU first came to my attention.  I'm almost always running the current version 
of Mac OS X on the only system I'm running QEMU on, and have always had to use 
that patch to compile it.  This makes me wonder what I'm missing that gives you 
that macro.

I'm currently running Mac OS X 10.9.3 (current), I use the following configure 
options ...

--sysconfdir=/usr/local/share --mandir=/usr/local/man --enable-system 
--enable-user --enable-cocoa --disable-sdl --disable-gtk --enable-vhost-net 
--enable-guest-agent --enable-vhdx

... and whether I compile with Apple's built-in compiler, Apple LLVM version 
5.1 (clang-503.0.40) ...

  CC    block/raw-posix.o
block/raw-posix.c:1189:16: error: use of undeclared identifier 'LONG_LONG_MAX'
        size = LONG_LONG_MAX;

... or apple-gcc-4.2 from MacPorts, which used to be the only option for me to 
successfully compile QEMU ...

  CC    block/raw-posix.o
block/raw-posix.c: In function 'raw_getlength':
block/raw-posix.c:1189: error: 'LONG_LONG_MAX' undeclared (first use in this 
function)
block/raw-posix.c:1189: error: (Each undeclared identifier is reported only once
block/raw-posix.c:1189: error: for each function it appears in.)
make: *** [block/raw-posix.o] Error 1

... or gcc 4.8, also wfrom MacPorts, I still get the same error.

  CC    block/raw-posix.o
block/raw-posix.c: In function 'raw_getlength':
block/raw-posix.c:1189:16: error: 'LONG_LONG_MAX' undeclared (first use in this 
function)
         size = LONG_LONG_MAX;
                ^
block/raw-posix.c:1189:16: note: each undeclared identifier is reported only 
once for each function it appears in
block/raw-posix.c: In function 'hdev_open':
block/raw-posix.c:1583:23: warning: variable 'kernResult' set but not used 
[-Wunused-but-set-variable]
         kern_return_t kernResult;
                       ^
make: *** [block/raw-posix.o] Error 1

-peter


reply via email to

[Prev in Thread] Current Thread [Next in Thread]