Revision: 11597
Author: [email protected]
Date: Mon May 21 02:01:19 2012
Log: 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'.
Review URL: https://chromiumcodereview.appspot.com/10335014
Patch from Yongsheng Zhu <[email protected]>.
http://code.google.com/p/v8/source/detail?r=11597
Modified:
/branches/bleeding_edge/Makefile
/branches/bleeding_edge/build/common.gypi
=======================================
--- /branches/bleeding_edge/Makefile Fri May 11 05:18:09 2012
+++ /branches/bleeding_edge/Makefile Mon May 21 02:01:19 2012
@@ -228,6 +228,7 @@
must-set-ANDROID_NDK_ROOT
GYP_GENERATORS=make \
CC="${ANDROID_TOOL_PREFIX}-gcc" \
+ CXX="${ANDROID_TOOL_PREFIX}-g++" \
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \
-S.android $(GYPFLAGS)
=======================================
--- /branches/bleeding_edge/build/common.gypi Fri May 11 05:18:09 2012
+++ /branches/bleeding_edge/build/common.gypi Mon May 21 02:01:19 2012
@@ -151,16 +151,6 @@
'defines': [
'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'],
- }],
- ],
}],
],
}],
@@ -222,16 +212,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'],
- }],
- ],
}],
],
}],
@@ -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' ],
}],
@@ -305,6 +277,29 @@
}],
['OS=="solaris"', {
'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
+ }],
+ ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
+ or OS=="netbsd" or OS=="mac" or OS=="android") and \
+ (v8_target_arch=="arm" or v8_target_arch=="ia32" or \
+ v8_target_arch=="mips")', {
+ # Check whether the host compiler and target compiler support the
+ # '-m32' option and set it if so.
+ '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': {
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev