[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime()
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime() |
Date: |
Tue, 25 Oct 2016 13:40:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
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
- [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime(), Liviu Ionescu, 2016/10/25
- Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime(), Peter Maydell, 2016/10/25
- Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime(),
Paolo Bonzini <=
- Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime(), Liviu Ionescu, 2016/10/25
- Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime(), Paolo Bonzini, 2016/10/25
- Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime(), Liviu Ionescu, 2016/10/25
- Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime(), Paolo Bonzini, 2016/10/25
- Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime(), Liviu Ionescu, 2016/10/25
- Re: [Qemu-devel] macOS 10.12 Sierra, Xcode 8 & clock_gettime(), Paolo Bonzini, 2016/10/25