build: fix run time error on macos 10.11 61/157161/1
authorMinkee Lee <minkee.lee@samsung.com>
Mon, 23 Oct 2017 13:14:50 +0000 (22:14 +0900)
committerMinkee Lee <minkee.lee@samsung.com>
Mon, 23 Oct 2017 13:18:20 +0000 (22:18 +0900)
(W/A) Do not use clock_gettime because it occurs
runtime error on macos 10.11

Change-Id: I7c0317c5d0b2af0897363aa305feb892578ac594
Signed-off-by: Minkee Lee <minkee.lee@samsung.com>
(cherry picked from commit f1bcd00df5a29c2a690ee9916b160e03af216626)

include/qemu/timer.h
tizen/emulator_configure.sh
util/qemu-timer-common.c

index 7f9a074c2a3b771cf0df87d46ae5a10537775544..6e4fde37577faf8b0c8760a80c036a259caf71b6 100644 (file)
@@ -727,7 +727,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);
index bd2fcfb99973fcc16b958238f03de80b47bb1395..5e8290cee3c76c64b5e0c267bbb6aaab24328cb6 100755 (executable)
@@ -235,7 +235,7 @@ echo "##### QEMU configure append:" $CONFIGURE_APPEND
  --cc=clang \
  --cxx=clang++ \
  --enable-werror \
- --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-cflags=-Wno-error=constant-conversion \
@@ -246,6 +246,7 @@ echo "##### QEMU configure append:" $CONFIGURE_APPEND
  --disable-cocoa \
  --disable-sdl \
  --extra-ldflags=-Wl,-rpath,'@executable_path' \
+ --extra-ldflags=-Wl,-no_weak_imports \
  $CONFIGURE_APPEND \
 ;;
 esac
index 95e0847c76f3b88ee713f19f119134093a0454da..0cf48f489cca4ac9a410d9121effe2cd61aa2ccf 100644 (file)
@@ -49,7 +49,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) {