Reviewers: Michael Starzinger,

Description:
Merged r16456 into trunk branch.

Work-around missing librt for cross-compiling Chrome for Android in AOSP.

[email protected]

Please review this at https://codereview.chromium.org/23681006/

SVN Base: https://v8.googlecode.com/svn/trunk

Affected files:
  M src/platform/time.cc
  M src/version.cc
  M tools/gyp/v8.gyp


Index: src/platform/time.cc
diff --git a/src/platform/time.cc b/src/platform/time.cc
index 653eb14bf410409be9ae36820d34a6c581591b11..073ca1e1f4b985d792d9a2894155d7dd93b07831 100644
--- a/src/platform/time.cc
+++ b/src/platform/time.cc
@@ -509,6 +509,15 @@ TimeTicks TimeTicks::HighResNow() {
            info.numer / info.denom);
 #elif V8_OS_SOLARIS
   ticks = (gethrtime() / Time::kNanosecondsPerMicrosecond);
+#elif V8_LIBRT_NOT_AVAILABLE
+  // TODO(bmeurer): This is a temporary hack to support cross-compiling
+  // Chrome for Android in AOSP. Remove this once AOSP is fixed, also
+  // cleanup the tools/gyp/v8.gyp file.
+  struct timeval tv;
+  int result = gettimeofday(&tv, NULL);
+  ASSERT_EQ(0, result);
+  USE(result);
+  ticks = (tv.tv_sec * Time::kMicrosecondsPerSecond + tv.tv_usec);
 #elif V8_OS_POSIX
   struct timespec ts;
   int result = clock_gettime(CLOCK_MONOTONIC, &ts);
Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index 5644151fb9aab15a9423ceeefbc85bf7ae57ff9f..bad4b63b3bd5d4a005f6dd7e4db2709a8710bae0 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     21
 #define BUILD_NUMBER      7
-#define PATCH_LEVEL       0
+#define PATCH_LEVEL       1
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
Index: tools/gyp/v8.gyp
diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp
index 3f99b13fd2b478e4d36143f5c3c47ab66733eb6b..a73ece03b8246486b0291fef7c1ef68417e7984f 100644
--- a/tools/gyp/v8.gyp
+++ b/tools/gyp/v8.gyp
@@ -724,15 +724,28 @@
                   }],
                 ],
               }, {
-                'link_settings': {
-                  'target_conditions': [
-                    ['_toolset=="host"', {
-                      'libraries': [
-                        '-lrt'
-                      ]
-                    }]
-                  ]
-                },
+                # TODO(bmeurer): What we really want here, is this:
+                #
+                # 'link_settings': {
+                #   'target_conditions': [
+                #     ['_toolset=="host"', {
+                #       'libraries': [
+                #         '-lrt'
+                #       ]
+                #     }]
+                #   ]
+                # },
+                #
+ # but we can't do this right now, as the AOSP does not support + # linking against the host librt, so we need to work around this
+                # for now, using the following hack (see platform/time.cc):
+                'target_conditions': [
+                  ['_toolset=="host"', {
+                    'defines': [
+                      'V8_LIBRT_NOT_AVAILABLE',
+                    ],
+                  }],
+                ],
                 'sources': [
                   '../../src/platform-linux.cc'
                 ]


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to