All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Christopher Friedt <chrisfriedt@gmail.com>,
	Fam Zheng <famz@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	QEMU Trivial <qemu-trivial@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/2v2] [RESENT-INLINE] Use libtool instead of ar to create static libraries on Darwin.
Date: Tue, 20 Sep 2016 18:58:51 +0100	[thread overview]
Message-ID: <CAFEAcA_Km8-bEYhy6k3YgJwVauuFGyXXGtXXQZx2Ba23+vYtCw@mail.gmail.com> (raw)
In-Reply-To: <269ab2fb-a43b-c5ee-3ff4-c08f99054f8b@msgid.tls.msk.ru>

On 14 September 2016 at 08:30, Michael Tokarev <mjt@tls.msk.ru> 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."
>> http://www.manpages.info/macosx/libtool.1.html
>>
>> 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 <chrisfriedt@gmail.com>
>> ---
>>  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, $^))
>>
>>  %.a:
>> +ifdef CONFIG_DARWIN
>> +       $(call quiet-command,rm -f $@ && libtool -static -o $@ $^,"
>> libtool    $(TARGET_DIR)$@")
>> +else
>>         $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^,"  AR
>> $(TARGET_DIR)$@")
>> +endif
>>
>>  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.

thanks
-- PMM

      reply	other threads:[~2016-09-20 17:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03  1:10 [Qemu-devel] [PATCH 1/2v2] [RESENT-INLINE] Use libtool instead of ar to create static libraries on Darwin Christopher Friedt
2016-05-03  7:06 ` Richard Henderson
2016-05-03 13:50   ` Christopher Friedt
2016-05-03 14:12     ` Peter Maydell
2016-05-04  0:07     ` Christopher Friedt
2016-05-04  9:03       ` Peter Maydell
2016-09-14  7:30 ` Michael Tokarev
2016-09-20 17:58   ` Peter Maydell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFEAcA_Km8-bEYhy6k3YgJwVauuFGyXXGtXXQZx2Ba23+vYtCw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=chrisfriedt@gmail.com \
    --cc=famz@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.