From: ulan@chromium.org Date: Mon, 24 Mar 2014 15:56:35 +0000 (+0000) Subject: Enable x64 build for Android X-Git-Tag: upstream/4.7.83~10047 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e0624c0b6f3118f867b0aca6dadf51a4a6fa2db;p=platform%2Fupstream%2Fv8.git Enable x64 build for Android BUG= R=ulan@chromium.org Review URL: https://codereview.chromium.org/209323004 Patch from Yang Gu . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20206 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/build/android.gypi b/build/android.gypi index 6224e75..9570f44 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-v8a', @@ -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', diff --git a/src/sampler.cc b/src/sampler.cc index fef3f28..c6830e6 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)