Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down Expand Up @@ -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'):
Expand Down
3 changes: 2 additions & 1 deletion site_scons/site_tools/naclsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
11 changes: 8 additions & 3 deletions src/shared/platform/nacl_sync_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}

/*
Expand Down Expand Up @@ -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");
Expand All @@ -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");
Expand Down Expand Up @@ -276,6 +280,7 @@ int main(int ac, char **av) {
}
NaClPlatformInit();
retcode = (*test_fn)();
g_done = 1;
NaClPlatformFini();
return retcode;
}
1 change: 1 addition & 0 deletions src/trusted/validator_ragel/build.scons
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
1 change: 1 addition & 0 deletions tests/toolchain/nacl.scons
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down