Reviewers: Jakob, Yang, ulan, yurys, Benedikt Meurer,

Message:
This CL is to enable x64 build of v8. Please review!

Description:
Enable x64 build

BUG=

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

SVN Base: https://github.com/v8/v8.git@master

Affected files (+31, -2 lines):
  M build/android.gypi
  M src/sampler.cc


Index: build/android.gypi
diff --git a/build/android.gypi b/build/android.gypi
index c119271a20d59000ef2da218a9ac5ff5186e352d..5c5084f2b6c83178efb8676904890f7b7a970b88 100644
--- a/build/android.gypi
+++ b/build/android.gypi
@@ -184,6 +184,11 @@
                   '-L<(android_stlport_libs)/x86',
                 ],
               }],
+              ['target_arch=="x64"', {
+                'ldflags': [
+                  '-L<(android_stlport_libs)/x86_64',
+                ],
+              }],
               ['target_arch=="arm64"', {
                 'ldflags': [
                   '-L<(android_stlport_libs)/arm64',
@@ -252,8 +257,15 @@
       }],  # _toolset=="target"
       # Settings for building host targets using the system toolchain.
       ['_toolset=="host"', {
-        'cflags': [ '-m32', '-pthread' ],
-        'ldflags': [ '-m32', '-pthread' ],
+        'conditions': [
+          ['target_arch=="x64"', {
+            'cflags': [ '-m64', '-pthread' ],
+            'ldflags': [ '-m64', '-pthread' ],
+          }, {
+            'cflags': [ '-m32', '-pthread' ],
+            'ldflags': [ '-m32', '-pthread' ],
+          }],
+        ],
         'ldflags!': [
           '-Wl,-z,noexecstack',
           '-Wl,--gc-sections',
Index: src/sampler.cc
diff --git a/src/sampler.cc b/src/sampler.cc
index fef3f2847c4bf11fba2a5a9f4d5c4e6182cd12d6..c6830e69047612a5d7a3f73a255c9114cdce4df1 100644
--- a/src/sampler.cc
+++ b/src/sampler.cc
@@ -159,6 +159,23 @@ typedef struct ucontext {
   // Other fields are not used by V8, don't define them here.
 } ucontext_t;
 enum { REG_EBP = 6, REG_ESP = 7, REG_EIP = 14 };
+
+#elif defined(__x86_64__)
+// x64 version for Android.
+typedef struct {
+  uint64_t gregs[23];
+  void* fpregs;
+  uint64_t __reserved1[8];
+} mcontext_t;
+
+typedef struct ucontext {
+  uint64_t uc_flags;
+  struct ucontext *uc_link;
+  stack_t uc_stack;
+  mcontext_t uc_mcontext;
+  // Other fields are not used by V8, don't define them here.
+} ucontext_t;
+enum { REG_RBP = 10, REG_RSP = 15, REG_RIP = 16 };
 #endif

 #endif  // V8_OS_ANDROID && !defined(__BIONIC_HAVE_UCONTEXT_T)


--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to