Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #! -*- python -*- | 1 #! -*- python -*- |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import atexit | 6 import atexit |
| 7 import json | 7 import json |
| 8 import os | 8 import os |
| 9 import platform | 9 import platform |
| 10 import re | 10 import re |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 def SetUpArgumentBits(env): | 262 def SetUpArgumentBits(env): |
| 263 BitFromArgument(env, 'bitcode', default=False, | 263 BitFromArgument(env, 'bitcode', default=False, |
| 264 desc='We are building bitcode') | 264 desc='We are building bitcode') |
| 265 | 265 |
| 266 BitFromArgument(env, 'nacl_clang', default=False, | 266 BitFromArgument(env, 'nacl_clang', default=False, |
| 267 desc='Use the native nacl-clang newlib compiler instead of nacl-gcc') | 267 desc='Use the native nacl-clang newlib compiler instead of nacl-gcc') |
| 268 | 268 |
| 269 BitFromArgument(env, 'translate_fast', default=False, | 269 BitFromArgument(env, 'translate_fast', default=False, |
| 270 desc='When using pnacl TC (bitcode=1) use accelerated translation step') | 270 desc='When using pnacl TC (bitcode=1) use accelerated translation step') |
| 271 | 271 |
| 272 BitFromArgument(env, 'use_sz', default=False, | |
| 273 desc='When using pnacl TC (bitcode=1) use Subzero for fast translation') | |
| 274 | |
| 272 BitFromArgument(env, 'built_elsewhere', default=False, | 275 BitFromArgument(env, 'built_elsewhere', default=False, |
| 273 desc='The programs have already been built by another system') | 276 desc='The programs have already been built by another system') |
| 274 | 277 |
| 275 BitFromArgument(env, 'skip_trusted_tests', default=False, | 278 BitFromArgument(env, 'skip_trusted_tests', default=False, |
| 276 desc='Only run untrusted tests - useful for translator testing' | 279 desc='Only run untrusted tests - useful for translator testing' |
| 277 ' (also skips tests of the IRT itself') | 280 ' (also skips tests of the IRT itself') |
| 278 | 281 |
| 279 BitFromArgument(env, 'nacl_pic', default=False, | 282 BitFromArgument(env, 'nacl_pic', default=False, |
| 280 desc='generate position indepent code for (P)NaCl modules') | 283 desc='generate position indepent code for (P)NaCl modules') |
| 281 | 284 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 desc='EXPERIMENTAL: Compile validator code for testing within enuminsts') | 400 desc='EXPERIMENTAL: Compile validator code for testing within enuminsts') |
| 398 | 401 |
| 399 # PNaCl sanity checks | 402 # PNaCl sanity checks |
| 400 if not env.Bit('bitcode'): | 403 if not env.Bit('bitcode'): |
| 401 pnacl_only_flags = ('minsfi', | 404 pnacl_only_flags = ('minsfi', |
| 402 'nonsfi_nacl', | 405 'nonsfi_nacl', |
| 403 'pnacl_generate_pexe', | 406 'pnacl_generate_pexe', |
| 404 'pnacl_unsandboxed', | 407 'pnacl_unsandboxed', |
| 405 'skip_nonstable_bitcode', | 408 'skip_nonstable_bitcode', |
| 406 'translate_fast', | 409 'translate_fast', |
| 410 'use_sz', | |
| 407 'use_sandboxed_translator') | 411 'use_sandboxed_translator') |
| 408 | 412 |
| 409 for flag_name in pnacl_only_flags: | 413 for flag_name in pnacl_only_flags: |
| 410 if env.Bit(flag_name): | 414 if env.Bit(flag_name): |
| 411 raise UserError('The option %r only makes sense when using the ' | 415 raise UserError('The option %r only makes sense when using the ' |
| 412 'PNaCl toolchain (i.e. with bitcode=1)' | 416 'PNaCl toolchain (i.e. with bitcode=1)' |
| 413 % flag_name) | 417 % flag_name) |
| 414 else: | 418 else: |
| 415 pnacl_incompatible_flags = ('nacl_clang', | 419 pnacl_incompatible_flags = ('nacl_clang', |
| 416 'nacl_glibc') | 420 'nacl_glibc') |
| (...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1820 # whether or not the IRT is used, etc. | 1824 # whether or not the IRT is used, etc. |
| 1821 description_list = ['trusted', | 1825 description_list = ['trusted', |
| 1822 env['TARGET_PLATFORM'].lower(), | 1826 env['TARGET_PLATFORM'].lower(), |
| 1823 env['TARGET_FULLARCH']] | 1827 env['TARGET_FULLARCH']] |
| 1824 return ARGUMENTS.get('perf_prefix', '') + '_'.join(description_list) | 1828 return ARGUMENTS.get('perf_prefix', '') + '_'.join(description_list) |
| 1825 description_list = [env['TARGET_FULLARCH']] | 1829 description_list = [env['TARGET_FULLARCH']] |
| 1826 # Using a list to keep the order consistent. | 1830 # Using a list to keep the order consistent. |
| 1827 bit_to_description = [ ('tests_use_irt', ('with_irt', '')), | 1831 bit_to_description = [ ('tests_use_irt', ('with_irt', '')), |
| 1828 ('bitcode', ('pnacl', 'nnacl')), | 1832 ('bitcode', ('pnacl', 'nnacl')), |
| 1829 ('translate_fast', ('fast', '')), | 1833 ('translate_fast', ('fast', '')), |
| 1834 ('use_sz', ('sz', '')), | |
| 1830 ('nacl_glibc', ('glibc', 'newlib')), | 1835 ('nacl_glibc', ('glibc', 'newlib')), |
| 1831 ('nacl_static_link', ('static', 'dynamic')), | 1836 ('nacl_static_link', ('static', 'dynamic')), |
| 1832 ] | 1837 ] |
| 1833 for (bit, (descr_yes, descr_no)) in bit_to_description: | 1838 for (bit, (descr_yes, descr_no)) in bit_to_description: |
| 1834 if env.Bit(bit): | 1839 if env.Bit(bit): |
| 1835 additional = descr_yes | 1840 additional = descr_yes |
| 1836 else: | 1841 else: |
| 1837 additional = descr_no | 1842 additional = descr_no |
| 1838 if additional: | 1843 if additional: |
| 1839 description_list.append(additional) | 1844 description_list.append(additional) |
| (...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3128 if nacl_env.Bit('bitcode'): | 3133 if nacl_env.Bit('bitcode'): |
| 3129 # passing -O when linking requests LTO, which does additional global | 3134 # passing -O when linking requests LTO, which does additional global |
| 3130 # optimizations at link time | 3135 # optimizations at link time |
| 3131 nacl_env.Append(LINKFLAGS=['-O3']) | 3136 nacl_env.Append(LINKFLAGS=['-O3']) |
| 3132 if not nacl_env.Bit('nacl_glibc'): | 3137 if not nacl_env.Bit('nacl_glibc'): |
| 3133 nacl_env.Append(LINKFLAGS=['-static']) | 3138 nacl_env.Append(LINKFLAGS=['-static']) |
| 3134 | 3139 |
| 3135 if nacl_env.Bit('translate_fast'): | 3140 if nacl_env.Bit('translate_fast'): |
| 3136 nacl_env.Append(LINKFLAGS=['-Xlinker', '-translate-fast']) | 3141 nacl_env.Append(LINKFLAGS=['-Xlinker', '-translate-fast']) |
| 3137 nacl_env.Append(TRANSLATEFLAGS=['-translate-fast']) | 3142 nacl_env.Append(TRANSLATEFLAGS=['-translate-fast']) |
| 3143 if nacl_env.Bit('use_sz'): | |
| 3144 nacl_env.Append(TRANSLATEFLAGS=['--use-sz']) | |
| 3138 | 3145 |
| 3139 # With pnacl's clang base/ code uses the "override" keyword. | 3146 # With pnacl's clang base/ code uses the "override" keyword. |
| 3140 nacl_env.Append(CXXFLAGS=['-Wno-c++11-extensions']) | 3147 nacl_env.Append(CXXFLAGS=['-Wno-c++11-extensions']) |
| 3141 # Allow extraneous semicolons. (Until these are removed.) | 3148 # Allow extraneous semicolons. (Until these are removed.) |
| 3142 # http://code.google.com/p/nativeclient/issues/detail?id=2861 | 3149 # http://code.google.com/p/nativeclient/issues/detail?id=2861 |
| 3143 nacl_env.Append(CCFLAGS=['-Wno-extra-semi']) | 3150 nacl_env.Append(CCFLAGS=['-Wno-extra-semi']) |
| 3144 # Allow unused private fields. (Until these are removed.) | 3151 # Allow unused private fields. (Until these are removed.) |
| 3145 # http://code.google.com/p/nativeclient/issues/detail?id=2861 | 3152 # http://code.google.com/p/nativeclient/issues/detail?id=2861 |
| 3146 nacl_env.Append(CCFLAGS=['-Wno-unused-private-field']) | 3153 nacl_env.Append(CCFLAGS=['-Wno-unused-private-field']) |
| 3147 # native_client/src/nonsfi/linux/linux_syscall_structs.h uses designated | 3154 # native_client/src/nonsfi/linux/linux_syscall_structs.h uses designated |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 3170 | 3177 |
| 3171 # Since we don't build src/untrusted/pthread/nacl.scons in | 3178 # Since we don't build src/untrusted/pthread/nacl.scons in |
| 3172 # nacl_irt_env, we must tell the IRT how to find the pthread.h header. | 3179 # nacl_irt_env, we must tell the IRT how to find the pthread.h header. |
| 3173 nacl_irt_env.Append(CPPPATH='${MAIN_DIR}/src/untrusted/pthread') | 3180 nacl_irt_env.Append(CPPPATH='${MAIN_DIR}/src/untrusted/pthread') |
| 3174 | 3181 |
| 3175 # Map certain flag bits to suffices on the build output. This needs to | 3182 # Map certain flag bits to suffices on the build output. This needs to |
| 3176 # happen pretty early, because it affects any concretized directory names. | 3183 # happen pretty early, because it affects any concretized directory names. |
| 3177 target_variant_map = [ | 3184 target_variant_map = [ |
| 3178 ('bitcode', 'pnacl'), | 3185 ('bitcode', 'pnacl'), |
| 3179 ('translate_fast', 'fast'), | 3186 ('translate_fast', 'fast'), |
| 3187 ('use_sz', 'sz'), | |
|
jvoung (off chromium)
2015/03/25 18:41:38
maybe expand the directory name suffix to "subzero
Jim Stichnoth
2015/03/25 20:13:17
Done.
| |
| 3180 ('nacl_pic', 'pic'), | 3188 ('nacl_pic', 'pic'), |
| 3181 ('use_sandboxed_translator', 'sbtc'), | 3189 ('use_sandboxed_translator', 'sbtc'), |
| 3182 ('nacl_glibc', 'glibc'), | 3190 ('nacl_glibc', 'glibc'), |
| 3183 ('pnacl_generate_pexe', 'pexe'), | 3191 ('pnacl_generate_pexe', 'pexe'), |
| 3184 ('nonsfi_nacl', 'nonsfi'), | 3192 ('nonsfi_nacl', 'nonsfi'), |
| 3185 ('nacl_clang', 'clang'), | 3193 ('nacl_clang', 'clang'), |
| 3186 ] | 3194 ] |
| 3187 for variant_bit, variant_suffix in target_variant_map: | 3195 for variant_bit, variant_suffix in target_variant_map: |
| 3188 if nacl_env.Bit(variant_bit): | 3196 if nacl_env.Bit(variant_bit): |
| 3189 nacl_env['TARGET_VARIANT'] += '-' + variant_suffix | 3197 nacl_env['TARGET_VARIANT'] += '-' + variant_suffix |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4019 nacl_env.ValidateSdk() | 4027 nacl_env.ValidateSdk() |
| 4020 | 4028 |
| 4021 if BROKEN_TEST_COUNT > 0: | 4029 if BROKEN_TEST_COUNT > 0: |
| 4022 msg = "There are %d broken tests." % BROKEN_TEST_COUNT | 4030 msg = "There are %d broken tests." % BROKEN_TEST_COUNT |
| 4023 if GetOption('brief_comstr'): | 4031 if GetOption('brief_comstr'): |
| 4024 msg += " Add --verbose to the command line for more information." | 4032 msg += " Add --verbose to the command line for more information." |
| 4025 print msg | 4033 print msg |
| 4026 | 4034 |
| 4027 # separate warnings from actual build output | 4035 # separate warnings from actual build output |
| 4028 Banner('B U I L D - O U T P U T:') | 4036 Banner('B U I L D - O U T P U T:') |
| OLD | NEW |