Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: build/android-ia32.gypi

Issue 10382121: Add Android cross-compilation support for x86 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/android-arm.gypi ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are
4 # met:
5 #
6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided
11 # with the distribution.
12 # * Neither the name of Google Inc. nor the names of its
13 # contributors may be used to endorse or promote products derived
14 # from this software without specific prior written permission.
15 #
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 # Definitions for building standalone V8 binaries to run on Android.
29 # This is mostly excerpted from:
30 # http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi
31
32 {
33 'variables': {
34 # Location of Android NDK.
35 'variables': {
36 'variables': {
37 'android_ndk_root%': '<!(/bin/echo -n $ANDROID_NDK_ROOT)',
38 'android_target_arch%': 'ia32', # target_arch in android terms.
39
40 # Switch between different build types, currently only '0' is
41 # supported.
42 'android_build_type%': 0,
43 },
44 'android_ndk_root%': '<(android_ndk_root)',
45 'android_ndk_sysroot': '<(android_ndk_root)/platforms/android-9/arch-x86',
46 'android_build_type%': '<(android_build_type)',
47 },
48 'android_ndk_root%': '<(android_ndk_root)',
49 'android_ndk_sysroot': '<(android_ndk_sysroot)',
50 'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
51 'android_ndk_lib': '<(android_ndk_sysroot)/usr/lib',
52 # Enable to use the system stlport, otherwise statically
53 # link the NDK one?
54 'use_system_stlport%': '<(android_build_type)',
55 'android_stlport_library': 'stlport_static',
56 # Copy it out one scope.
57 'android_build_type%': '<(android_build_type)',
58
59 'OS': 'android',
60 'target_arch': 'ia32',
61 'v8_target_arch': 'ia32',
62 }, # variables
63 'target_defaults': {
64 'defines': [
65 'ANDROID',
66 'V8_ANDROID_LOG_STDOUT',
67 ],
68 'configurations': {
69 'Release': {
70 'cflags!': [
71 '-O2',
72 '-Os',
73 ],
74 'cflags': [
75 '-m32',
76 '-fdata-sections',
77 '-ffunction-sections',
78 '-fomit-frame-pointer',
79 '-O3',
80 ],
81 }, # Release
82 }, # configurations
83 'cflags': [ '-Wno-abi', '-Wall', '-W', '-Wno-unused-parameter',
84 '-Wnon-virtual-dtor', '-fno-rtti', '-fno-exceptions', ],
85 'target_conditions': [
86 ['_toolset=="target"', {
87 'cflags!': [
88 '-pthread', # Not supported by Android toolchain.
89 ],
90 'cflags': [
91 '-U__linux__', # Don't allow toolchain to claim -D__linux__
92 '-ffunction-sections',
93 '-funwind-tables',
94 '-fstack-protector',
95 '-fno-short-enums',
96 '-finline-limit=64',
97 '-Wa,--noexecstack',
98 '-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings.
99 # Note: This include is in cflags to ensure that it comes after
100 # all of the includes.
101 '-I<(android_ndk_include)',
102 ],
103 'defines': [
104 'ANDROID',
105 #'__GNU_SOURCE=1', # Necessary for clone()
106 'USE_STLPORT=1',
107 '_STLP_USE_PTR_SPECIALIZATIONS=1',
108 'HAVE_OFF64_T',
109 'HAVE_SYS_UIO_H',
110 'ANDROID_BINSIZE_HACK', # Enable temporary hacks to reduce binsize.
111 ],
112 'ldflags!': [
113 '-pthread', # Not supported by Android toolchain.
114 ],
115 'ldflags': [
116 '-m32',
117 '-nostdlib',
118 '-Wl,--no-undefined',
119 # Don't export symbols from statically linked libraries.
120 '-Wl,--exclude-libs=ALL',
121 ],
122 'libraries!': [
123 '-lrt', # librt is built into Bionic.
124 # Not supported by Android toolchain.
125 # Where do these come from? Can't find references in
126 # any Chromium gyp or gypi file. Maybe they come from
127 # gyp itself?
128 '-lpthread', '-lnss3', '-lnssutil3', '-lsmime3', '-lplds4', '-lplc4' , '-lnspr4',
129 ],
130 'libraries': [
131 '-l<(android_stlport_library)',
132 # Manually link the libgcc.a that the cross compiler uses.
133 '<!($CC -print-libgcc-file-name)',
134 '-lc',
135 '-ldl',
136 '-lstdc++',
137 '-lm',
138 ],
139 'conditions': [
140 ['android_build_type==0', {
141 'ldflags': [
142 '-Wl,-rpath-link=<(android_ndk_lib)',
143 '-L<(android_ndk_lib)',
144 ],
145 }],
146 # NOTE: The stlport header include paths below are specified in
147 # cflags rather than include_dirs because they need to come
148 # after include_dirs. Think of them like system headers, but
149 # don't use '-isystem' because the arm-linux-androideabi-4.4.3
150 # toolchain (circa Gingerbread) will exhibit strange errors.
151 # The include ordering here is important; change with caution.
152 ['use_system_stlport==0', {
153 'cflags': [
154 '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport',
155 ],
156 'conditions': [
157 ['target_arch=="ia32"', {
158 'ldflags': [
159 '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/x86',
160 ],
161 }],
162 ],
163 }],
164 ['target_arch=="ia32"', {
165 # The x86 toolchain currently has problems with stack-protector.
166 'cflags!': [
167 '-fstack-protector',
168 ],
169 'cflags': [
170 '-fno-stack-protector',
171 ],
172 }],
173 ],
174 'target_conditions': [
175 ['_type=="executable"', {
176 'ldflags': [
177 '-Bdynamic',
178 '-Wl,-dynamic-linker,/system/bin/linker',
179 '-Wl,--gc-sections',
180 '-Wl,-z,nocopyreloc',
181 # crtbegin_dynamic.o should be the last item in ldflags.
182 '<(android_ndk_lib)/crtbegin_dynamic.o',
183 ],
184 'libraries': [
185 # crtend_android.o needs to be the last item in libraries.
186 # Do not add any libraries after this!
187 '<(android_ndk_lib)/crtend_android.o',
188 ],
189 }],
190 ['_type=="shared_library"', {
191 'ldflags': [
192 '-Wl,-shared,-Bsymbolic',
193 ],
194 }],
195 ],
196 }], # _toolset=="target"
197 # Settings for building host targets using the system toolchain.
198 ['_toolset=="host"', {
199 'cflags': [ '-m32', '-pthread' ],
200 'ldflags': [ '-m32', '-pthread' ],
201 'ldflags!': [
202 '-Wl,-z,noexecstack',
203 '-Wl,--gc-sections',
204 '-Wl,-O1',
205 '-Wl,--as-needed',
206 ],
207 }],
208 ], # target_conditions
209 }, # target_defaults
210 }
OLDNEW
« no previous file with comments | « build/android-arm.gypi ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698