[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] Use libtool instead of ar to create static
Re: [Qemu-devel] [PATCH 1/2] Use libtool instead of ar to create static libraries on Darwin.
Mon, 2 May 2016 21:08:59 -0400
On Mon, May 2, 2016 at 9:04 PM, Fam Zheng <address@hidden> wrote:
> Cc'ing Peter Maydell, who must have better ideas than me on building on Mac.
> On Mon, 05/02 20:47, Christopher Friedt wrote:
>> Currently, at least on Mac OS X 10.11.4 (El Capitan), Qemu fails to build
>> for a few reasons.
>> One of those reasons is that Apple's ld (at least ld64) does not properly
>> process archive files created with ar (even Apple's ar).
>> After some RTFM'ing, I came upon this tidbit, which is unfortunate. Luckily,
>> autotools packages are not broken.
>> "Libtool with -static is intended to replace ar(5) and ranlib."
>> In any case, this change takes Apple's recommendations into account and
>> allows Qemu to build on Mac OS X El Capitan.
>> Signed-off-by: Christopher Friedt <address@hidden>
>> rules.mak | 4 ++++
>> 1 file changed, 4 insertions(+)
>> diff --git a/rules.mak b/rules.mak
>> index d1ff311..44421af 100644
>> --- a/rules.mak
>> +++ b/rules.mak
>> @@ -105,7 +105,11 @@ modules:
>> $(call LINK,$(filter %.o %.a %.mo, $^))
>> +ifeq ($(shell uname),Darwin)
> I think you can use "ifdef CONFIG_DARWIN" here.
Good suggestion. I missed that entirely.
>> + $(call quiet-command,rm -f $@ && libtool -static -o $@ $^," libtool
> Is libtool always available on Mac OS X? If not, we may need to add the
> detection to ./configure.
Apple's libtool should be installed with their command line tools, at
least as far back as Snow Leopard.