Skip to content

Commit 8f53c13

Browse files
author
sgjesse@chromium.org
committed
Enable mksnapshot on ARM when cross-compiling using gyp
Review URL: http://codereview.chromium.org/351019 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3235 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
1 parent 9a7c403 commit 8f53c13

1 file changed

Lines changed: 38 additions & 3 deletions

File tree

tools/gyp/v8.gyp

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@
156156
'target_name': 'v8_snapshot',
157157
'type': '<(library)',
158158
'dependencies': [
159-
'mksnapshot',
160-
'js2c',
159+
'mksnapshot#host',
160+
'js2c#host',
161161
'v8_base',
162162
],
163163
'include_dirs+': [
@@ -183,8 +183,9 @@
183183
{
184184
'target_name': 'v8_nosnapshot',
185185
'type': '<(library)',
186+
'toolsets': ['host', 'target'],
186187
'dependencies': [
187-
'js2c',
188+
'js2c#host',
188189
'v8_base',
189190
],
190191
'include_dirs+': [
@@ -194,10 +195,21 @@
194195
'<(SHARED_INTERMEDIATE_DIR)/libraries.cc',
195196
'../../src/snapshot-empty.cc',
196197
],
198+
'conditions': [
199+
# The ARM assembler assumes the host is 32 bits, so force building
200+
# 32-bit host tools.
201+
# TODO(piman): This assumes that the host is ia32 or amd64. Fixing the
202+
# code would be better
203+
['target_arch=="arm" and _toolset=="host"', {
204+
'cflags': ['-m32'],
205+
'ldflags': ['-m32'],
206+
}]
207+
]
197208
},
198209
{
199210
'target_name': 'v8_base',
200211
'type': '<(library)',
212+
'toolsets': ['host', 'target'],
201213
'include_dirs+': [
202214
'../../src',
203215
],
@@ -393,6 +405,7 @@
393405
'../../src/arm/codegen-arm.cc',
394406
'../../src/arm/codegen-arm.h',
395407
'../../src/arm/constants-arm.h',
408+
'../../src/arm/constants-arm.cc',
396409
'../../src/arm/cpu-arm.cc',
397410
'../../src/arm/debug-arm.cc',
398411
'../../src/arm/disasm-arm.cc',
@@ -411,6 +424,16 @@
411424
'../../src/arm/virtual-frame-arm.cc',
412425
'../../src/arm/virtual-frame-arm.h',
413426
],
427+
'conditions': [
428+
# The ARM assembler assumes the host is 32 bits, so force building
429+
# 32-bit host tools.
430+
# TODO(piman): This assumes that the host is ia32 or amd64. Fixing
431+
# the code would be better
432+
['_toolset=="host"', {
433+
'cflags': ['-m32'],
434+
'ldflags': ['-m32'],
435+
}]
436+
]
414437
}],
415438
['target_arch=="ia32"', {
416439
'include_dirs+': [
@@ -507,6 +530,7 @@
507530
{
508531
'target_name': 'js2c',
509532
'type': 'none',
533+
'toolsets': ['host'],
510534
'variables': {
511535
'library_files': [
512536
'../../src/runtime.js',
@@ -549,6 +573,7 @@
549573
{
550574
'target_name': 'mksnapshot',
551575
'type': 'executable',
576+
'toolsets': ['host'],
552577
'dependencies': [
553578
'v8_nosnapshot',
554579
],
@@ -558,6 +583,16 @@
558583
'sources': [
559584
'../../src/mksnapshot.cc',
560585
],
586+
'conditions': [
587+
# The ARM assembler assumes the host is 32 bits, so force building
588+
# 32-bit host tools.
589+
# TODO(piman): This assumes that the host is ia32 or amd64. Fixing
590+
# the code would be better
591+
['target_arch=="arm" and _toolset=="host"', {
592+
'cflags': ['-m32'],
593+
'ldflags': ['-m32'],
594+
}]
595+
]
561596
},
562597
{
563598
'target_name': 'v8_shell',

0 commit comments

Comments
 (0)