Reviewers: Jakob, danno, Michael Starzinger,
http://codereview.chromium.org/10335014/diff/1/build/common.gypi
File build/common.gypi (right):
http://codereview.chromium.org/10335014/diff/1/build/common.gypi#newcode281
build/common.gypi:281: ['v8_target_arch!="x64"', {
On 2012/05/15 14:05:34, Jakob wrote:
The condition must check for OS as well, as the shell commands are not
available
e.g. on Windows.
Also, I have a weak preference to explicitly list the affected
architectures,
but I don't feel strongly about that.
The following should work:
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or \
OS=="solaris" or OS=="netbsd" or OS=="mac") and \
(v8_target_arch=="arm" or v8_target_arch=="ia32" or \
v8_target_arch=="mips")', {
I'll change it.
(Mac is tricky since you can use GYP to generate either Xcode project
files or
Makefiles there. In order not to break the latter, I think we have to
include
OS=="mac" here, but I might be wrong. Do you have a Mac around where
you can
test this?)
Sorry, I don't have Mac. Buildbot will test this? right?
http://codereview.chromium.org/10335014/diff/1/build/common.gypi#newcode282
build/common.gypi:282: # Check whether the host compiler and target
compiler support '-m32' option and set it if yes
On 2012/05/15 14:05:34, Jakob wrote:
nit: for comments, please keep the 80-col limit per line, and end
sentences with
a full stop.
okay,thanks a lot for your review.
Description:
Set '-m32' option for host and target platforms
For different host and target archs, try to check whether
their compilers support '-m32' option individually. If yes,
then add this option into cflags and ldflags. The exception is
that both host and target archs are 'x64'.
Please review this at http://codereview.chromium.org/10335014/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M build/common.gypi
Index: build/common.gypi
===================================================================
--- build/common.gypi (revision 11553)
+++ build/common.gypi (working copy)
@@ -152,16 +152,6 @@
'USE_EABI_HARDFLOAT=0',
],
}],
- # The ARM assembler assumes the host is 32 bits,
- # so force building 32-bit host tools.
- ['host_arch=="x64" or OS=="android"', {
- 'target_conditions': [
- ['_toolset=="host"', {
- 'cflags': ['-m32'],
- 'ldflags': ['-m32'],
- }],
- ],
- }],
],
}],
['v8_target_arch=="ia32"', {
@@ -223,16 +213,6 @@
['mips_arch_variant=="loongson"', {
'defines': ['_MIPS_ARCH_LOONGSON',],
}],
- # The MIPS assembler assumes the host is 32 bits,
- # so force building 32-bit host tools.
- ['host_arch=="x64"', {
- 'target_conditions': [
- ['_toolset=="host"', {
- 'cflags': ['-m32'],
- 'ldflags': ['-m32'],
- }],
- ],
- }],
],
}],
['v8_target_arch=="x64"', {
@@ -290,14 +270,6 @@
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd"', {
'conditions': [
- [ 'v8_target_arch!="x64"', {
- # Pass -m32 to the compiler iff it understands the flag.
- 'variables': {
- 'm32flag': '<!((echo | $(echo ${CXX:-$(which g++)}) -m32 -E
- > /dev/null 2>&1) && echo -n "-m32" || true)',
- },
- 'cflags': [ '<(m32flag)' ],
- 'ldflags': [ '<(m32flag)' ],
- }],
[ 'v8_no_strict_aliasing==1', {
'cflags': [ '-fno-strict-aliasing' ],
}],
@@ -306,6 +278,26 @@
['OS=="solaris"', {
'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
}],
+ ['v8_target_arch!="x64"', {
+ # Check whether the host compiler and target compiler
support '-m32' option and set it if yes
+ # except that 'v8_target_arch'is x64
+ 'target_conditions': [
+ ['_toolset=="host"', {
+ 'variables': {
+ 'm32flag': '<!((echo | $(echo ${CXX_host:-${CXX:-$(which
g++)}}) -m32 -E - > /dev/null 2>&1) && echo -n "-m32" || true)',
+ },
+ 'cflags': [ '<(m32flag)' ],
+ 'ldflags': [ '<(m32flag)' ],
+ }],
+ ['_toolset=="target"', {
+ 'variables': {
+ 'm32flag': '<!((echo | $(echo ${CXX_target:-${CXX:-$(which
g++)}}) -m32 -E - > /dev/null 2>&1) && echo -n "-m32" || true)',
+ },
+ 'cflags': [ '<(m32flag)' ],
+ 'ldflags': [ '<(m32flag)' ],
+ }],
+ ],
+ }],
], # conditions
'configurations': {
'Debug': {
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev