From: Paolo Bonzini <pbonzini@redhat.com>
To: Liviu Ionescu <ilg@livius.net>, qemu-devel <Qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime()
Date: Tue, 25 Oct 2016 13:40:11 +0200 [thread overview]
Message-ID: <cec7e51e-6c1a-f16b-c50a-32c136d09ec7@redhat.com> (raw)
In-Reply-To: <1EF56314-1CA2-4C7B-81FB-7B8F3AEF47B8@livius.net>
On 25/10/2016 11:43, Liviu Ionescu wrote:
> In Xcode 8 (more or less mandatory after upgrading to Sierra), Apple added support for `clock_gettime(CLOCK_MONOTONIC, &ts)`, which is not bad in itself.
>
> Unfortunately, with this addition, a QEMU built on 10.12 runs **only** on 10.12; on previous versions it fails with something like:
>
> ```
> $ ./qemu-system-gnuarmeclipse --version
> dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
> Referenced from: /Applications/GNU ARM Eclipse/QEMU/2.6.0-201610170917-dev/bin/./qemu-system-gnuarmeclipse (which was built for Mac OS X 10.12)
> Expected in: /usr/lib/libSystem.B.dylib
> ```
>
> The explanation is simple, for previous versions `_clock_gettime` is
> not available in the system library.
>
> Apple does some tricks with macros in `time.h` to specify that the
> definitions were introduced in 10.12, but QEMU uses only `#ifdef
> CLOCK_MONOTONIC` to select the use of `clock_gettime()`.
>
> Until a more elaborate solution will be considered, my workaround was
> to replace `#ifdef CLOCK_MONOTONIC` with `#if
> defined(CLOCK_MONOTONIC) && !defined(__APPLE__)` and so avoid
> references to `clock_gettime()`.
I think you need to use -mmacosx-version-min=10.10 or something like
that, using the configure flag --extra-cflags.
Paolo
next prev parent reply other threads:[~2016-10-25 11:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-25 9:43 [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime() Liviu Ionescu
2016-10-25 10:02 ` Peter Maydell
2016-10-25 10:34 ` Liviu Ionescu
2016-10-25 13:40 ` Liviu Ionescu
2016-10-25 11:40 ` Paolo Bonzini [this message]
2016-10-25 13:36 ` Liviu Ionescu
2016-10-25 13:48 ` Paolo Bonzini
2016-10-25 14:12 ` Liviu Ionescu
2016-10-25 14:21 ` Paolo Bonzini
2016-10-25 14:37 ` Liviu Ionescu
2016-10-25 14:38 ` Paolo Bonzini
[not found] <mailman.12713.1477406219.22738.qemu-devel@nongnu.org>
2016-10-26 14:32 ` G 3
2016-10-26 15:15 ` Liviu Ionescu
2016-10-26 15:32 ` G 3
2016-10-26 15:39 ` Liviu Ionescu
2016-10-26 16:03 ` G 3
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=cec7e51e-6c1a-f16b-c50a-32c136d09ec7@redhat.com \
--to=pbonzini@redhat.com \
--cc=Qemu-devel@nongnu.org \
--cc=ilg@livius.net \
/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).