diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-14 02:36:21 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-14 02:36:21 +0000 |
commit | 04b482600c4a8d04c0de4911303deb92d635fb17 (patch) | |
tree | 65fa8c92cc2261ec25e17e3b78ba7fb746715dcf | |
parent | 476035dd55c983f9c63ba5ab4a68d24bf2fedbb8 (diff) | |
download | chromium_src-04b482600c4a8d04c0de4911303deb92d635fb17.zip chromium_src-04b482600c4a8d04c0de4911303deb92d635fb17.tar.gz chromium_src-04b482600c4a8d04c0de4911303deb92d635fb17.tar.bz2 |
When cross-compiling for ia32, do not build 'host' targets with -m32
BUG=94852
TEST=it (cross-)compiles
Review URL: http://codereview.chromium.org/7811014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101014 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | build/common.gypi | 128 |
1 files changed, 66 insertions, 62 deletions
diff --git a/build/common.gypi b/build/common.gypi index a4734cd..d5bd6d2 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -1428,74 +1428,78 @@ }, }, 'conditions': [ - [ 'target_arch=="ia32"', { - 'asflags': [ - # Needed so that libs with .s files (e.g. libicudata.a) - # are compatible with the general 32-bit-ness. - '-32', - ], - # All floating-point computations on x87 happens in 80-bit - # precision. Because the C and C++ language standards allow - # the compiler to keep the floating-point values in higher - # precision than what's specified in the source and doing so - # is more efficient than constantly rounding up to 64-bit or - # 32-bit precision as specified in the source, the compiler, - # especially in the optimized mode, tries very hard to keep - # values in x87 floating-point stack (in 80-bit precision) - # as long as possible. This has important side effects, that - # the real value used in computation may change depending on - # how the compiler did the optimization - that is, the value - # kept in 80-bit is different than the value rounded down to - # 64-bit or 32-bit. There are possible compiler options to make - # this behavior consistent (e.g. -ffloat-store would keep all - # floating-values in the memory, thus force them to be rounded - # to its original precision) but they have significant runtime - # performance penalty. - # - # -mfpmath=sse -msse2 makes the compiler use SSE instructions - # which keep floating-point values in SSE registers in its - # native precision (32-bit for single precision, and 64-bit for - # double precision values). This means the floating-point value - # used during computation does not change depending on how the - # compiler optimized the code, since the value is always kept - # in its specified precision. - 'conditions': [ - ['branding=="Chromium" and disable_sse2==0', { - 'cflags': [ - '-march=pentium4', - '-msse2', - '-mfpmath=sse', + ['target_arch=="ia32"', { + 'target_conditions': [ + ['_toolset=="target"', { + 'asflags': [ + # Needed so that libs with .s files (e.g. libicudata.a) + # are compatible with the general 32-bit-ness. + '-32', ], - }], - # ChromeOS targets Pinetrail, which is sse3, but most of the - # benefit comes from sse2 so this setting allows ChromeOS - # to build on other CPUs. In the future -march=atom would help - # but requires a newer compiler. - ['chromeos==1 and disable_sse2==0', { + # All floating-point computations on x87 happens in 80-bit + # precision. Because the C and C++ language standards allow + # the compiler to keep the floating-point values in higher + # precision than what's specified in the source and doing so + # is more efficient than constantly rounding up to 64-bit or + # 32-bit precision as specified in the source, the compiler, + # especially in the optimized mode, tries very hard to keep + # values in x87 floating-point stack (in 80-bit precision) + # as long as possible. This has important side effects, that + # the real value used in computation may change depending on + # how the compiler did the optimization - that is, the value + # kept in 80-bit is different than the value rounded down to + # 64-bit or 32-bit. There are possible compiler options to + # make this behavior consistent (e.g. -ffloat-store would keep + # all floating-values in the memory, thus force them to be + # rounded to its original precision) but they have significant + # runtime performance penalty. + # + # -mfpmath=sse -msse2 makes the compiler use SSE instructions + # which keep floating-point values in SSE registers in its + # native precision (32-bit for single precision, and 64-bit + # for double precision values). This means the floating-point + # value used during computation does not change depending on + # how the compiler optimized the code, since the value is + # always kept in its specified precision. + 'conditions': [ + ['branding=="Chromium" and disable_sse2==0', { + 'cflags': [ + '-march=pentium4', + '-msse2', + '-mfpmath=sse', + ], + }], + # ChromeOS targets Pinetrail, which is sse3, but most of the + # benefit comes from sse2 so this setting allows ChromeOS + # to build on other CPUs. In the future -march=atom would + # help but requires a newer compiler. + ['chromeos==1 and disable_sse2==0', { + 'cflags': [ + '-msse2', + ], + }], + # Install packages have started cropping up with + # different headers between the 32-bit and 64-bit + # versions, so we have to shadow those differences off + # and make sure a 32-bit-on-64-bit build picks up the + # right files. + ['host_arch!="ia32"', { + 'include_dirs+': [ + '/usr/include32', + ], + }], + ], + # -mmmx allows mmintrin.h to be used for mmx intrinsics. + # video playback is mmx and sse2 optimized. 'cflags': [ - '-msse2', + '-m32', + '-mmmx', ], - }], - # Install packages have started cropping up with - # different headers between the 32-bit and 64-bit - # versions, so we have to shadow those differences off - # and make sure a 32-bit-on-64-bit build picks up the - # right files. - ['host_arch!="ia32"', { - 'include_dirs+': [ - '/usr/include32', + 'ldflags': [ + '-m32', ], }], ], - # -mmmx allows mmintrin.h to be used for mmx intrinsics. - # video playback is mmx and sse2 optimized. - 'cflags': [ - '-m32', - '-mmmx', - ], - 'ldflags': [ - '-m32', - ], }], ['target_arch=="arm"', { 'target_conditions': [ |