Reviewers: Jakob, danno, Søren Gjesse,

http://codereview.chromium.org/8351073/diff/1/tools/gyp/v8.gyp
File tools/gyp/v8.gyp (right):

http://codereview.chromium.org/8351073/diff/1/tools/gyp/v8.gyp#newcode30
tools/gyp/v8.gyp:30: 'target_conditions': [
On 2011/11/03 08:30:56, Jakob wrote:
Note that these settings will not be applied to d8, cctest and any
other targets
not defined in this file. If you want to build those for Android, too,
please
move this target_condition to ../../build/common.gypi.

I think that's a good idea because we'll want to build many things for
Android. I'll do that. Thanks.

http://codereview.chromium.org/8351073/diff/1/tools/gyp/v8.gyp#newcode748
tools/gyp/v8.gyp:748: 'v8_base',
On 2011/11/03 11:45:13, Søren Gjesse wrote:
On 2011/11/03 08:30:56, Jakob wrote:
> Since v8_nosnapshot depends on v8_base anyway, I don't see why this
addition
is
> necessary.

As far as I remember this is a workaround for a GYP issue where the
linker
grouping on Linux is does not happen without this. Maybe it is only
for the
patched version of GYP used by Android.

When building for Linux, the linking command line was like:
  g++ -pthread -Wl,-z,noexecstack  -o out/Debug/mksnapshot
-Wl,--start-group out/Debug/obj.host/mksnapshot/v8/src/mksnapshot.o
out/Debug/obj.host/v8/tools/gyp/libv8_nosnapshot.a
out/Debug/obj.host/v8/tools/gyp/libv8_base.a -Wl,--end-group

When building for Android, the linking command line was like:
  g++ -pthread -m32  -o out/Release/mksnapshot
out/Release/obj.host/mksnapshot/v8/src/mksnapshot.o
out/Release/obj.host/v8/tools/gyp/libv8_nosnapshot.a
out/Release/obj.host/v8/tools/gyp/libv8_base.a

The second one doesn't have "start-group" and "end-group" so it failed.
Adding v8_base in dependencies makes libv8_base.a come before
libv8_nosnapshot.a, and then it can succeed.

I don't know what happened to gyp, though. I run android_gyp to generate
makefiles, as defined in build/android/envsetup.sh, which passes some
DEFINES to gyp. Is it because "OS=android"?

Description:
Upstream Android V8 change.

Please review this at http://codereview.chromium.org/8351073/

SVN Base: http://v8.googlecode.com/svn/branches/3.6/

Affected files:
  M     src/platform-posix.cc
  M     tools/gyp/v8.gyp


Index: src/platform-posix.cc
===================================================================
--- src/platform-posix.cc       (revision 9637)
+++ src/platform-posix.cc       (working copy)
@@ -48,7 +48,7 @@

 #if defined(ANDROID)
 #define LOG_TAG "v8"
-#include <utils/Log.h>  // LOG_PRI_VA
+#include <android/log.h>
 #endif

 #include "v8.h"
@@ -182,7 +182,7 @@

 void OS::VPrint(const char* format, va_list args) {
 #if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
-  LOG_PRI_VA(ANDROID_LOG_INFO, LOG_TAG, format, args);
+  __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args);
 #else
   vprintf(format, args);
 #endif
@@ -199,7 +199,7 @@

 void OS::VFPrint(FILE* out, const char* format, va_list args) {
 #if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
-  LOG_PRI_VA(ANDROID_LOG_INFO, LOG_TAG, format, args);
+  __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args);
 #else
   vfprintf(out, format, args);
 #endif
@@ -216,7 +216,7 @@

 void OS::VPrintError(const char* format, va_list args) {
 #if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
-  LOG_PRI_VA(ANDROID_LOG_ERROR, LOG_TAG, format, args);
+  __android_log_vprint(ANDROID_LOG_ERROR, LOG_TAG, format, args);
 #else
   vfprintf(stderr, format, args);
 #endif
Index: tools/gyp/v8.gyp
===================================================================
--- tools/gyp/v8.gyp    (revision 9637)
+++ tools/gyp/v8.gyp    (working copy)
@@ -609,13 +609,6 @@
                       '../../src/platform-linux.cc'
                     ]
                   }],
-                  ['_toolset=="target"', {
-                    'link_settings': {
-                      'libraries': [
-                        '-llog',
-                       ],
-                     }
-                  }],
                 ],
               },
             ],
@@ -743,6 +736,7 @@
           'target_name': 'mksnapshot',
           'type': 'executable',
           'dependencies': [
+            'v8_base',
             'v8_nosnapshot',
           ],
           'include_dirs+': [


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to