Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index 3016d0c5573e1a4d1c92dadeab8dfda1435d2f7b..656f27c71d3720fe5ff1da392e04e1ac5eba99c7 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -280,9 +280,13 @@ |
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ |
or OS=="netbsd"', { |
'conditions': [ |
- [ 'target_arch=="ia32"', { |
- 'cflags': [ '-m32' ], |
- 'ldflags': [ '-m32' ], |
+ [ '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" || echo -n "")', |
danno
2012/04/13 07:44:30
nit: 80 col? and maybe Sven's || true suggestion?
|
+ }, |
+ 'cflags': [ '<(m32flag)' ], |
+ 'ldflags': [ '<(m32flag)' ], |
}], |
[ 'v8_no_strict_aliasing==1', { |
'cflags': [ '-fno-strict-aliasing' ], |