diff --git a/SConstruct b/SConstruct index a579737e2..538b271b1 100755 --- a/SConstruct +++ b/SConstruct @@ -2520,42 +2520,47 @@ def which(cmd, paths=os.environ.get('PATH', '').split(os.pathsep)): return True return False +def SetUpNoBuildEnv(env): + def FakeInstall(dest, source, env): + print('Not installing', dest) + # Replace build commands with no-ops + env.Replace(CC='true', CXX='true', LD='true', + AR='true', RANLIB='true', INSTALL=FakeInstall) + def SetUpLinuxEnvX86(env): if env.Bit('built_elsewhere'): - def FakeInstall(dest, source, env): - print('Not installing', dest) - # Replace build commands with no-ops - env.Replace(CC='true', CXX='true', LD='true', - AR='true', RANLIB='true', INSTALL=FakeInstall) + SetUpNoBuildEnv(env) else: - env.Prepend(CCFLAGS=sysroot_flags, - ASFLAGS=[], - ) + env.Prepend(CCFLAGS=sysroot_flags) if env.Bit('clang'): # TODO use --target=i386-linux-gnu or whetever? env.Prepend( - CCFLAGS = ['-m32'] + sysroot_flags, - LINKFLAGS = ['-m32'] + sysroot_flags, + CCFLAGS = ['-m32'], + LINKFLAGS = ['-m32'], ) else: env.Replace(CC='i686-linux-gnu-gcc', CXX='i686-linux-gnu-g++', LD='i686-linux-gnu-ld') +def SetUpLinuxEnvX8664(env): + if env.Bit('built_elsewhere'): + SetUpNoBuildEnv(env) + else: + # Assumes x86-64 is the native platform for now + env.Prepend( + CCFLAGS = ['-m64'] + sysroot_flags, + LINKFLAGS = ['-m64'] + sysroot_flags, + ) + def SetUpLinuxEnvArm(env): if not platform.machine().startswith('a'): # Allow emulation on non-ARM hosts. env.Replace(EMULATOR='qemu-armhf -L /usr/arm-linux-gnueabihf/ -cpu cortex-a9') if env.Bit('built_elsewhere'): - def FakeInstall(dest, source, env): - print('Not installing', dest) - # Replace build commands with no-ops - env.Replace(CC='true', CXX='true', LD='true', - AR='true', RANLIB='true', INSTALL=FakeInstall) + SetUpNoBuildEnv(env) else: - env.Prepend(CCFLAGS=sysroot_flags, - ASFLAGS=[], - ) + env.Prepend(CCFLAGS=sysroot_flags) if env.Bit('clang'): env.Prepend(CCFLAGS=['--target=arm-linux-gnueabihf']) env.Prepend(LINKFLAGS=['--target=arm-linux-gnueabihf']) @@ -2752,10 +2757,7 @@ def MakeGenericLinuxEnv(platform=None): if linux_env.Bit('build_x86_32'): SetUpLinuxEnvX86(linux_env) elif linux_env.Bit('build_x86_64'): - linux_env.Prepend( - CCFLAGS = ['-m64'] + sysroot_flags, - LINKFLAGS = ['-m64'] + sysroot_flags, - ) + SetUpLinuxEnvX8664(linux_env) elif linux_env.Bit('build_arm'): SetUpLinuxEnvArm(linux_env) elif linux_env.Bit('build_mips32'): diff --git a/site_scons/site_tools/naclsdk.py b/site_scons/site_tools/naclsdk.py index 28ad4aa63..419166ae6 100755 --- a/site_scons/site_tools/naclsdk.py +++ b/site_scons/site_tools/naclsdk.py @@ -65,7 +65,8 @@ def _StubOutEnvToolsForBuiltElsewhere(env): env.Replace(CC='true', CXX='true', LINK='true', AR='true', RANLIB='true', AS='true', ASPP='true', LD='true', STRIP='true', OBJDUMP='true', OBJCOPY='true', - PNACLOPT='true', PNACLFINALIZE='true') + PNACLOPT='true', PNACLFINALIZE='true', + GDB='false') def _SetEnvForNativeSdk(env, sdk_path): diff --git a/src/shared/platform/nacl_sync_test.c b/src/shared/platform/nacl_sync_test.c index 8aeb5ee93..4a29c568d 100644 --- a/src/shared/platform/nacl_sync_test.c +++ b/src/shared/platform/nacl_sync_test.c @@ -80,6 +80,8 @@ */ uint32_t g_timeout_milliseconds = 500; +volatile int g_done = 0; + /* * TimeOutThread is responsible for doing deadlock detection. If the * main thread hits a deadlock, then this thread will time out and @@ -114,7 +116,9 @@ void WINAPI TimeOutThread(void *thread_state) { * If we reach here, we assume that the main thread has deadlocked * and so we optimistically report that via the exit status. */ - exit(time_out_exit_status); + if (!g_done) { + exit(time_out_exit_status); + } } /* @@ -178,7 +182,7 @@ int TestLockTrylock(void) { int TestTrylockLock(void) { struct NaClMutex mu; struct NaClThread nt; - printf("TestLockTrylock\n"); + printf("TestTrylockLock\n"); printf("Constructing mutex\n"); if (!NaClMutexCtor(&mu)) return 1; printf("Trylocking mutex\n"); @@ -200,7 +204,7 @@ int TestTrylockLock(void) { int TestTrylockTrylock(void) { struct NaClMutex mu; struct NaClThread nt; - printf("TestLockTrylock\n"); + printf("TestTrylockTrylock\n"); printf("Constructing mutex\n"); if (!NaClMutexCtor(&mu)) return 1; printf("Trylocking mutex\n"); @@ -276,6 +280,7 @@ int main(int ac, char **av) { } NaClPlatformInit(); retcode = (*test_fn)(); + g_done = 1; NaClPlatformFini(); return retcode; } diff --git a/src/trusted/validator_ragel/build.scons b/src/trusted/validator_ragel/build.scons index 0ecf5b70b..cbbc888b7 100644 --- a/src/trusted/validator_ragel/build.scons +++ b/src/trusted/validator_ragel/build.scons @@ -548,6 +548,7 @@ for bits in ['32', '64']: env.AddNodeToTestSuite( dis_section_test, ['small_tests', 'validator_tests'], + is_broken=env.Bit('built_elsewhere'), # OBJDUMP is stubbed out node_name='run_dis_section_test_%s' % bits) if env.Bit('regenerate_golden'): diff --git a/tests/toolchain/nacl.scons b/tests/toolchain/nacl.scons index a098fbd17..9dedce569 100644 --- a/tests/toolchain/nacl.scons +++ b/tests/toolchain/nacl.scons @@ -515,6 +515,7 @@ if not env.Bit('pnacl_generate_pexe'): # Test that both the layout and the nops are not munged by stripping. stripped_nexe = asm_env.Command('strip_test.nexe', nexe, '${STRIP} -o ${TARGET} ${SOURCES}') + asm_env.Alias('all_programs', stripped_nexe) node = asm_env.CommandSelLdrTestNacl('strip_test.out', stripped_nexe) asm_env.AddNodeToTestSuite(node, testsuite, 'run_strip_test')