From 88e79d2758f93d1991a4870a0348b08ccc3f5663 Mon Sep 17 00:00:00 2001 From: Minkee Lee Date: Fri, 13 Oct 2017 14:35:33 +0900 Subject: [PATCH] build: fix run time error on macos 10.11 (W/A) Do not use clock_gettime because it occurs runtime error on macos 10.11 Change-Id: I8931696b2e950b174e303570e20a18575fcc9fd7 Signed-off-by: Minkee Lee --- include/qemu/timer.h | 5 ++++- tizen/emulator_configure.sh | 3 ++- util/qemu-timer-common.c | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index bdfae00..78da162 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -823,7 +823,10 @@ extern int use_rt_clock; static inline int64_t get_clock(void) { -#ifdef CLOCK_MONOTONIC +// (W/A) do not use clock_gettime in macos +// because it occurs runtime error on macos 10.11 +//#ifdef CLOCK_MONOTONIC +#if defined(CLOCK_MONOTONIC) && !defined(__APPLE__) if (use_rt_clock) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); diff --git a/tizen/emulator_configure.sh b/tizen/emulator_configure.sh index e7eaa9b..e951bf5 100755 --- a/tizen/emulator_configure.sh +++ b/tizen/emulator_configure.sh @@ -194,10 +194,11 @@ Darwin*) CONFIGURE_APPEND=" --cc=clang --cxx=clang++ - --extra-cflags=-mmacosx-version-min=10.9 + --extra-cflags=-mmacosx-version-min=10.11 --extra-cflags=-Wno-error=deprecated-declarations --extra-cflags=-Wno-error=address-of-packed-member --extra-ldflags=-Wl,-rpath,'@executable_path' + --extra-ldflags=-Wl,-no_weak_imports --audio-drv-list=coreaudio --enable-cocoa --enable-hax diff --git a/util/qemu-timer-common.c b/util/qemu-timer-common.c index 06d084d..f8de0f7 100644 --- a/util/qemu-timer-common.c +++ b/util/qemu-timer-common.c @@ -50,7 +50,10 @@ int use_rt_clock; static void __attribute__((constructor)) init_get_clock(void) { use_rt_clock = 0; -#ifdef CLOCK_MONOTONIC +// (W/A) do not use clock_gettime in macos +// because it occurs runtime error on macos 10.11 +//#ifdef CLOCK_MONOTONIC +#if defined(CLOCK_MONOTONIC) && !defined(__APPLE__) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { -- 2.7.4