[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/2v2] [RESENT-INLINE] Use libtoo
Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/2v2] [RESENT-INLINE] Use libtool instead of ar to create static libraries on Darwin.
Tue, 20 Sep 2016 18:58:51 +0100
On 14 September 2016 at 08:30, Michael Tokarev <address@hidden> wrote:
> 03.05.2016 04:10, 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, $^))
>> +ifdef CONFIG_DARWIN
>> + $(call quiet-command,rm -f $@ && libtool -static -o $@ $^,"
>> libtool $(TARGET_DIR)$@")
>> $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR
>> quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1))
> Hmm. Is this patch still relevant? Apparently I missed it back then.
I don't have El Capitan, but I can confirm that it doesn't break
the build on Yosemite, so I guess we should have it.
I'd like to know the error message the linker produces first,
though (and we should put that in the commit message).
The progress string argument to quiet-command is slightly wrong:
we capitalize the shortname of the command being run, so it
ought to look like " LIBTOOL $(TARGET_DIR)$@" so it lines up
and looks nice with the other output.