qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Friedt <chrisfriedt@gmail.com>
To: Fam Zheng <famz@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	mst@redhat.com, QEMU Developers <qemu-devel@nongnu.org>,
	qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] Use libtool instead of ar to create static libraries on Darwin.
Date: Mon, 2 May 2016 21:08:59 -0400	[thread overview]
Message-ID: <CAF4BF-SjsGbzkAxRuf_UmpJCXLdeQtHOETv2LEiOp9Eay5QUeA@mail.gmail.com> (raw)
In-Reply-To: <20160503010435.GT1421@ad.usersys.redhat.com>

On Mon, May 2, 2016 at 9:04 PM, Fam Zheng <famz@redhat.com> 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."
>> 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:
>> +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    $(TARGET_DIR)$@")
>
> 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.

  reply	other threads:[~2016-05-03  1:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03  0:47 [Qemu-devel] [PATCH 0/2] Resolve link errors on Mac OS X Christopher Friedt
2016-05-03  0:47 ` [Qemu-devel] [PATCH 1/2] Use libtool instead of ar to create static libraries on Darwin Christopher Friedt
2016-05-03  0:53   ` Peter Maydell
2016-05-03  1:08     ` Christopher Friedt
2016-05-03  1:04   ` Fam Zheng
2016-05-03  1:08     ` Christopher Friedt [this message]
2016-05-06 19:07   ` Michael Tokarev
2016-05-06 22:26     ` Peter Maydell
2016-05-03  0:47 ` [Qemu-devel] [PATCH 2/2] Remove unnecessary CONFIG_EVENTFD preprocessor conditional to satisfy link Christopher Friedt
2016-05-03  1:01   ` Peter Maydell
2016-05-03  1:14     ` Christopher Friedt
2016-05-03  1:18       ` Peter Maydell
2016-05-03  1:25         ` Christopher Friedt
2016-05-03  1:27           ` Peter Maydell

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=CAF4BF-SjsGbzkAxRuf_UmpJCXLdeQtHOETv2LEiOp9Eay5QUeA@mail.gmail.com \
    --to=chrisfriedt@gmail.com \
    --cc=famz@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).