OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 17 matching lines...) Expand all Loading... |
28 # Definitions for building standalone V8 binaries to run on Android. | 28 # Definitions for building standalone V8 binaries to run on Android. |
29 # This is mostly excerpted from: | 29 # This is mostly excerpted from: |
30 # http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi | 30 # http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi |
31 | 31 |
32 { | 32 { |
33 'variables': { | 33 'variables': { |
34 # Location of Android NDK. | 34 # Location of Android NDK. |
35 'variables': { | 35 'variables': { |
36 'variables': { | 36 'variables': { |
37 'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)', | 37 'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)', |
38 'android_target_arch%': 'arm', # target_arch in android terms. | |
39 | 38 |
40 # Switch between different build types, currently only '0' is | 39 # Switch between different build types, currently only '0' is |
41 # supported. | 40 # supported. |
42 'android_build_type%': 0, | 41 'android_build_type%': 0, |
43 }, | 42 }, |
44 'android_ndk_root%': '<(android_ndk_root)', | 43 'android_ndk_root%': '<(android_ndk_root)', |
45 'android_ndk_sysroot': '<(android_ndk_root)/platforms/android-9/arch-<(and
roid_target_arch)', | 44 'android_ndk_sysroot': '<(android_ndk_root)/platforms/android-9/arch-<(and
roid_target_arch)', |
46 'android_build_type%': '<(android_build_type)', | 45 'android_build_type%': '<(android_build_type)', |
47 }, | 46 }, |
48 'android_ndk_root%': '<(android_ndk_root)', | 47 'android_ndk_root%': '<(android_ndk_root)', |
49 'android_ndk_sysroot': '<(android_ndk_sysroot)', | 48 'android_ndk_sysroot': '<(android_ndk_sysroot)', |
50 'android_ndk_include': '<(android_ndk_sysroot)/usr/include', | 49 'android_ndk_include': '<(android_ndk_sysroot)/usr/include', |
51 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib', | 50 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib', |
52 # Enable to use the system stlport, otherwise statically | 51 # Enable to use the system stlport, otherwise statically |
53 # link the NDK one? | 52 # link the NDK one? |
54 'use_system_stlport%': '<(android_build_type)', | 53 'use_system_stlport%': '<(android_build_type)', |
55 'android_stlport_library': 'stlport_static', | 54 'android_stlport_library': 'stlport_static', |
56 # Copy it out one scope. | 55 # Copy it out one scope. |
57 'android_build_type%': '<(android_build_type)', | 56 'android_build_type%': '<(android_build_type)', |
58 | 57 |
59 'OS': 'android', | 58 'OS': 'android', |
60 'target_arch': 'arm', | |
61 'v8_target_arch': 'arm', | |
62 'armv7': 1, | |
63 'arm_neon': 0, | |
64 'arm_fpu': 'vfpv3', | |
65 }, # variables | 59 }, # variables |
66 'target_defaults': { | 60 'target_defaults': { |
67 'defines': [ | 61 'defines': [ |
68 'ANDROID', | 62 'ANDROID', |
69 'V8_ANDROID_LOG_STDOUT', | 63 'V8_ANDROID_LOG_STDOUT', |
70 ], | 64 ], |
71 'configurations': { | 65 'configurations': { |
72 'Release': { | 66 'Release': { |
73 'cflags!': [ | 67 'cflags!': [ |
74 '-O2', | 68 '-O2', |
(...skipping 19 matching lines...) Expand all Loading... |
94 '-ffunction-sections', | 88 '-ffunction-sections', |
95 '-funwind-tables', | 89 '-funwind-tables', |
96 '-fstack-protector', | 90 '-fstack-protector', |
97 '-fno-short-enums', | 91 '-fno-short-enums', |
98 '-finline-limit=64', | 92 '-finline-limit=64', |
99 '-Wa,--noexecstack', | 93 '-Wa,--noexecstack', |
100 '-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings. | 94 '-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings. |
101 # Note: This include is in cflags to ensure that it comes after | 95 # Note: This include is in cflags to ensure that it comes after |
102 # all of the includes. | 96 # all of the includes. |
103 '-I<(android_ndk_include)', | 97 '-I<(android_ndk_include)', |
104 '-march=armv7-a', | |
105 '-mtune=cortex-a8', | |
106 '-mfpu=vfp3', | |
107 ], | 98 ], |
108 'defines': [ | 99 'defines': [ |
109 'ANDROID', | 100 'ANDROID', |
110 #'__GNU_SOURCE=1', # Necessary for clone() | 101 #'__GNU_SOURCE=1', # Necessary for clone() |
111 'USE_STLPORT=1', | 102 'USE_STLPORT=1', |
112 '_STLP_USE_PTR_SPECIALIZATIONS=1', | 103 '_STLP_USE_PTR_SPECIALIZATIONS=1', |
113 'HAVE_OFF64_T', | 104 'HAVE_OFF64_T', |
114 'HAVE_SYS_UIO_H', | 105 'HAVE_SYS_UIO_H', |
115 'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize. | 106 'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize. |
116 ], | 107 ], |
117 'ldflags!': [ | 108 'ldflags!': [ |
118 '-pthread', # Not supported by Android toolchain. | 109 '-pthread', # Not supported by Android toolchain. |
119 ], | 110 ], |
120 'ldflags': [ | 111 'ldflags': [ |
121 '-nostdlib', | 112 '-nostdlib', |
122 '-Wl,--no-undefined', | 113 '-Wl,--no-undefined', |
123 '-Wl,--icf=safe', # Enable identical code folding to reduce size | |
124 # Don't export symbols from statically linked libraries. | 114 # Don't export symbols from statically linked libraries. |
125 '-Wl,--exclude-libs=ALL', | 115 '-Wl,--exclude-libs=ALL', |
126 ], | 116 ], |
127 'libraries!': [ | 117 'libraries!': [ |
128 '-lrt', # librt is built into Bionic. | 118 '-lrt', # librt is built into Bionic. |
129 # Not supported by Android toolchain. | 119 # Not supported by Android toolchain. |
130 # Where do these come from? Can't find references in | 120 # Where do these come from? Can't find references in |
131 # any Chromium gyp or gypi file. Maybe they come from | 121 # any Chromium gyp or gypi file. Maybe they come from |
132 # gyp itself? | 122 # gyp itself? |
133 '-lpthread', '-lnss3', '-lnssutil3', '-lsmime3', '-lplds4', '-lplc4'
, '-lnspr4', | 123 '-lpthread', '-lnss3', '-lnssutil3', '-lsmime3', '-lplds4', '-lplc4'
, '-lnspr4', |
134 ], | 124 ], |
135 'libraries': [ | 125 'libraries': [ |
136 '-l<(android_stlport_library)', | 126 '-l<(android_stlport_library)', |
137 # Manually link the libgcc.a that the cross compiler uses. | 127 # Manually link the libgcc.a that the cross compiler uses. |
138 '<!($CC -print-libgcc-file-name)', | 128 '<!($CC -print-libgcc-file-name)', |
139 '-lc', | 129 '-lc', |
140 '-ldl', | 130 '-ldl', |
141 '-lstdc++', | 131 '-lstdc++', |
142 '-lm', | 132 '-lm', |
143 ], | 133 ], |
144 'conditions': [ | 134 'conditions': [ |
145 ['android_build_type==0', { | 135 ['android_build_type==0', { |
146 'ldflags': [ | 136 'ldflags': [ |
147 '-Wl,-rpath-link=<(android_ndk_lib)', | 137 '-Wl,-rpath-link=<(android_ndk_lib)', |
148 '-L<(android_ndk_lib)', | 138 '-L<(android_ndk_lib)', |
149 ], | 139 ], |
150 }], | 140 }], |
| 141 ['target_arch == "arm"', { |
| 142 'ldflags': [ |
| 143 # Enable identical code folding to reduce size. |
| 144 '-Wl,--icf=safe', |
| 145 ], |
| 146 }], |
| 147 ['target_arch=="arm" and armv7==1', { |
| 148 'cflags': [ |
| 149 '-march=armv7-a', |
| 150 '-mtune=cortex-a8', |
| 151 '-mfpu=vfp3', |
| 152 ], |
| 153 }], |
151 # NOTE: The stlport header include paths below are specified in | 154 # NOTE: The stlport header include paths below are specified in |
152 # cflags rather than include_dirs because they need to come | 155 # cflags rather than include_dirs because they need to come |
153 # after include_dirs. Think of them like system headers, but | 156 # after include_dirs. Think of them like system headers, but |
154 # don't use '-isystem' because the arm-linux-androideabi-4.4.3 | 157 # don't use '-isystem' because the arm-linux-androideabi-4.4.3 |
155 # toolchain (circa Gingerbread) will exhibit strange errors. | 158 # toolchain (circa Gingerbread) will exhibit strange errors. |
156 # The include ordering here is important; change with caution. | 159 # The include ordering here is important; change with caution. |
157 ['use_system_stlport==0', { | 160 ['use_system_stlport==0', { |
158 'cflags': [ | 161 'cflags': [ |
159 '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport', | 162 '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport', |
160 ], | 163 ], |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 'ldflags!': [ | 219 'ldflags!': [ |
217 '-Wl,-z,noexecstack', | 220 '-Wl,-z,noexecstack', |
218 '-Wl,--gc-sections', | 221 '-Wl,--gc-sections', |
219 '-Wl,-O1', | 222 '-Wl,-O1', |
220 '-Wl,--as-needed', | 223 '-Wl,--as-needed', |
221 ], | 224 ], |
222 }], | 225 }], |
223 ], # target_conditions | 226 ], # target_conditions |
224 }, # target_defaults | 227 }, # target_defaults |
225 } | 228 } |
OLD | NEW |