From fb22bcc926707c0ba10608d97ad14e4eb2474bb9 Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Tue, 24 May 2011 14:49:02 +0000 Subject: [PATCH] Platform and build updates for Android build R=ager@chromium.org BUG=none TEST=none Review URL: http://codereview.chromium.org//7059015 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8042 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- tools/gyp/v8.gyp | 67 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp index 3153d9ab16..7ad8b91709 100644 --- a/tools/gyp/v8.gyp +++ b/tools/gyp/v8.gyp @@ -55,6 +55,7 @@ 'v8_use_arm_eabi_hardfloat%': 'false', 'v8_use_snapshot%': 'true', + 'host_os%': '<(OS)', 'v8_use_liveobjectlist%': 'false', }, 'conditions': [ @@ -327,7 +328,47 @@ 'outputs': [ '<(INTERMEDIATE_DIR)/snapshot.cc', ], - 'action': ['<@(_inputs)', '<@(_outputs)'], + 'variables': { + 'mksnapshot_flags': [], + }, + 'conditions': [ + ['v8_target_arch=="arm"', { + # The following rules should be consistent with chromium's + # common.gypi and V8's runtime rule to ensure they all generate + # the same correct machine code. The following issue is about + # V8's runtime rule about vfpv3 and neon: + # http://code.google.com/p/v8/issues/detail?id=914 + 'conditions': [ + ['armv7==1', { + # The ARM Architecture Manual mandates VFPv3 if NEON is + # available. + # The current V8 doesn't use d16-d31, so for vfpv3-d16, we can + # also enable vfp3 for the better performance. + 'conditions': [ + ['arm_neon!=1 and arm_fpu!="vfpv3" and arm_fpu!="vfpv3-d16"', { + 'variables': { + 'mksnapshot_flags': [ + '--noenable_vfp3', + ], + }, + }], + ], + },{ # else: armv7!=1 + 'variables': { + 'mksnapshot_flags': [ + '--noenable_armv7', + '--noenable_vfp3', + ], + }, + }], + ], + }], + ], + 'action': [ + '<@(_inputs)', + '<@(mksnapshot_flags)', + '<@(_outputs)' + ], }, ], }, @@ -750,6 +791,30 @@ ], } ], + ['OS=="android"', { + 'sources': [ + '../../src/platform-posix.cc', + ], + 'conditions': [ + ['host_os=="mac" and _toolset!="target"', { + 'sources': [ + '../../src/platform-macos.cc' + ] + }, { + 'sources': [ + '../../src/platform-linux.cc' + ] + }], + ['_toolset=="target"', { + 'link_settings': { + 'libraries': [ + '-llog', + ], + } + }], + ], + }, + ], ['OS=="freebsd"', { 'link_settings': { 'libraries': [