| 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 os | 7 import os |
| 8 import platform | 8 import platform |
| 9 import re | 9 import re |
| 10 import subprocess | 10 import subprocess |
| (...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 def FakeInstall(dest, source, env): | 2354 def FakeInstall(dest, source, env): |
| 2355 print 'Not installing', dest | 2355 print 'Not installing', dest |
| 2356 # Replace build commands with no-ops | 2356 # Replace build commands with no-ops |
| 2357 env.Replace(CC='true', CXX='true', LD='true', | 2357 env.Replace(CC='true', CXX='true', LD='true', |
| 2358 AR='true', RANLIB='true', INSTALL=FakeInstall) | 2358 AR='true', RANLIB='true', INSTALL=FakeInstall) |
| 2359 # Allow emulation on x86 hosts for testing built_elsewhere flag | 2359 # Allow emulation on x86 hosts for testing built_elsewhere flag |
| 2360 if not platform.machine().startswith('mips'): | 2360 if not platform.machine().startswith('mips'): |
| 2361 env.Replace(EMULATOR=jail + '/run_under_qemu_mips32') | 2361 env.Replace(EMULATOR=jail + '/run_under_qemu_mips32') |
| 2362 else: | 2362 else: |
| 2363 tc_dir = os.path.join(os.getcwd(), 'toolchain', 'linux_mips-trusted', | 2363 tc_dir = os.path.join(os.getcwd(), 'toolchain', 'linux_mips-trusted', |
| 2364 'mips-release', 'bin') | 2364 'bin') |
| 2365 if not which(os.path.join(tc_dir, 'mips-linux-gnu-gcc')): | 2365 if not which(os.path.join(tc_dir, 'mipsel-linux-gnu-gcc')): |
| 2366 print ("\nERRROR: MIPS trusted TC is not installed - try running:\n" | 2366 print ("\nERRROR: MIPS trusted TC is not installed - try running:\n" |
| 2367 "tools/trusted_cross_toolchains/trusted-toolchain-creator" | 2367 "tools/trusted_cross_toolchains/trusted-toolchain-creator" |
| 2368 ".mipsel.squeeze.sh trusted_sdk") | 2368 ".mipsel.squeeze.sh trusted_sdk") |
| 2369 sys.exit(-1) | 2369 sys.exit(-1) |
| 2370 env.Replace(CC=os.path.join(tc_dir, 'mips-linux-gnu-gcc'), | 2370 env.Replace(CC=os.path.join(tc_dir, 'mipsel-linux-gnu-gcc'), |
| 2371 CXX=os.path.join(tc_dir, 'mips-linux-gnu-g++'), | 2371 CXX=os.path.join(tc_dir, 'mipsel-linux-gnu-g++'), |
| 2372 LD=os.path.join(tc_dir, 'mips-linux-gnu-ld'), | 2372 LD=os.path.join(tc_dir, 'mipsel-linux-gnu-ld'), |
| 2373 EMULATOR=os.path.join(jail, | 2373 EMULATOR=os.path.join(jail, |
| 2374 'run_under_qemu_mips32'), | 2374 'run_under_qemu_mips32'), |
| 2375 ASFLAGS=[], | 2375 ASFLAGS=[], |
| 2376 LIBPATH=['${LIB_DIR}', | 2376 LIBPATH=['${LIB_DIR}', |
| 2377 jail + '/mips-release/mips-linux-gnu/libc/el/usr/lib'], | 2377 jail + '/sysroot/usr/lib'], |
| 2378 LINKFLAGS=['-EL', '-T', | 2378 LINKFLAGS=['-T', |
| 2379 os.path.join(jail, 'ld_script_mips_trusted')] | 2379 os.path.join(jail, 'ld_script_mips_trusted')] |
| 2380 ) | 2380 ) |
| 2381 | 2381 |
| 2382 env.Append(LIBS=['rt', 'dl', 'pthread'], | 2382 env.Append(LIBS=['rt', 'dl', 'pthread'], |
| 2383 CCFLAGS=['-EL', '-Wl, -EL', '-march=mips32r2']) | 2383 CCFLAGS=['-march=mips32r2']) |
| 2384 | 2384 |
| 2385 | 2385 |
| 2386 def MakeLinuxEnv(): | 2386 def MakeLinuxEnv(): |
| 2387 linux_env = MakeUnixLikeEnv().Clone( | 2387 linux_env = MakeUnixLikeEnv().Clone( |
| 2388 BUILD_TYPE = '${OPTIMIZATION_LEVEL}-linux', | 2388 BUILD_TYPE = '${OPTIMIZATION_LEVEL}-linux', |
| 2389 BUILD_TYPE_DESCRIPTION = 'Linux ${OPTIMIZATION_LEVEL} build', | 2389 BUILD_TYPE_DESCRIPTION = 'Linux ${OPTIMIZATION_LEVEL} build', |
| 2390 tools = ['target_platform_linux'], | 2390 tools = ['target_platform_linux'], |
| 2391 # TODO(bradnelson): this should really be able to live in unix_like_env | 2391 # TODO(bradnelson): this should really be able to live in unix_like_env |
| 2392 # but can't due to what the target_platform_x module is | 2392 # but can't due to what the target_platform_x module is |
| 2393 # doing. | 2393 # doing. |
| (...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3411 nacl_env.ValidateSdk() | 3411 nacl_env.ValidateSdk() |
| 3412 | 3412 |
| 3413 if BROKEN_TEST_COUNT > 0: | 3413 if BROKEN_TEST_COUNT > 0: |
| 3414 msg = "There are %d broken tests." % BROKEN_TEST_COUNT | 3414 msg = "There are %d broken tests." % BROKEN_TEST_COUNT |
| 3415 if GetOption('brief_comstr'): | 3415 if GetOption('brief_comstr'): |
| 3416 msg += " Add --verbose to the command line for more information." | 3416 msg += " Add --verbose to the command line for more information." |
| 3417 print msg | 3417 print msg |
| 3418 | 3418 |
| 3419 # separate warnings from actual build output | 3419 # separate warnings from actual build output |
| 3420 Banner('B U I L D - O U T P U T:') | 3420 Banner('B U I L D - O U T P U T:') |
| OLD | NEW |