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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ This builds both components and runs some tests.
```
scons --mode=opt-host,nacl saigo=1 platform=x86-64 --keep-going small_tests medium_tests

To enable crash dump tests, add the option `breakpad_tools_dir=<path to breakpad>`. The
repository can be found at `daemon/libs/breakpad`. You need to have built the Breakpad
tools in-source.
To enable crash dump tests, add the option `breakpad_install_dir=<breakpad install prefix>`,
OR install Breakpad to toolchain/linux_x86/breakpad/`. The
repository can be found at `daemon/libs/breakpad`. You need to build the Breakpad
tools and run `make install`.
```
---

Expand Down
18 changes: 11 additions & 7 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ ACCEPTABLE_ARGUMENTS = set([
'libdir',
# Where to install trusted-code binaries for public (SDK) consumption.
'bindir',
# Where a Breakpad build output directory is for optional Breakpad testing.
'breakpad_tools_dir',
# Breakpad install directory (configure --prefix=...) for optional Breakpad testing.
'breakpad_install_dir',
# Allows overriding of the nacl newlib toolchain directory.
'nacl_newlib_dir',
# Allows override of the nacl glibc toolchain directory.
Expand Down Expand Up @@ -491,11 +491,6 @@ if 'generate_ninja' in ARGUMENTS:
pre_base_env, dest_file=ARGUMENTS['generate_ninja'])


breakpad_tools_dir = ARGUMENTS.get('breakpad_tools_dir')
if breakpad_tools_dir is not None:
pre_base_env['BREAKPAD_TOOLS_DIR'] = pre_base_env.Dir(
os.path.abspath(breakpad_tools_dir))

sysroot_flags = []
if ARGUMENTS.get('sysroot') is not None:
sysroot_flags.append('--sysroot=' + os.path.abspath(ARGUMENTS.get('sysroot')))
Expand Down Expand Up @@ -1189,6 +1184,15 @@ def GetToolchainDir(env, platform_build_dir=None, toolchain_name=None,
pre_base_env.AddMethod(GetToolchainDir)


breakpad_install_dir = ARGUMENTS.get('breakpad_install_dir')
if breakpad_install_dir is None:
default_location = pre_base_env.GetToolchainDir(toolchain_name='breakpad')
if os.path.isdir(default_location):
breakpad_install_dir = default_location
if breakpad_install_dir:
pre_base_env['BREAKPAD_INSTALL_DIR'] = os.path.abspath(breakpad_install_dir)


def GetSelLdr(env):
sel_ldr = ARGUMENTS.get('force_sel_ldr')
if sel_ldr:
Expand Down
6 changes: 4 additions & 2 deletions src/untrusted/minidump_generator/nacl.scons
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

Import('env')

# DAEMON: use the same dir as Breakpad tools for Breakpad includes
if env.get('BREAKPAD_INSTALL_DIR') is None:
Return()

# Allow Breakpad headers to #include other Breakpad headers.
env.Append(CPPPATH=['${BREAKPAD_TOOLS_DIR}/src'])
env.Append(CPPPATH=['${BREAKPAD_INSTALL_DIR}/include/breakpad'])
# Breakpad's headers do not compile with "-pedantic".
env.FilterOut(CCFLAGS=['-pedantic'])

Expand Down
19 changes: 9 additions & 10 deletions tests/untrusted_minidump/nacl.scons
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Import('env')
if not env.SetNonStableBitcodeIfAllowed():
Return()

if env.get('BREAKPAD_TOOLS_DIR') is None:
if env.get('BREAKPAD_INSTALL_DIR') is None:
Return() # DAEMON: avoid building minidump_generator

if env.Bit('bitcode'):
Expand Down Expand Up @@ -44,24 +44,23 @@ for crash_in_lib in [0, 1]:
]),
]
env.SideEffect(output_dump_file, nodes[0])
breakpad_tools_dir = env.get('BREAKPAD_TOOLS_DIR')
if breakpad_tools_dir is not None:
breakpad_install_dir = env.get('BREAKPAD_INSTALL_DIR')
if breakpad_install_dir is not None:
# Check that the minidump can be decoded.
minidump_dump = breakpad_tools_dir.File('src/processor/minidump_dump')
if not os.path.exists(minidump_dump.abspath):
minidump_dump = os.path.join(breakpad_install_dir, 'bin', 'minidump_dump')
if not os.path.exists(minidump_dump):
raise Exception('minidump_dump not available, '
'but breakpad_tools_dir=%s specified' % breakpad_tools_dir)
'but breakpad_install_dir=%s specified' % breakpad_install_dir)
nodes.append(env.AutoDepsCommand(
[name + '.dump', name + '.dump_errors'],
[minidump_dump, output_dump_file,
'>${TARGETS[0]}', '2>${TARGETS[1]}']))
# Check that a stack trace can be extracted from the minidump.
# TODO(bradnelson): Check the trace is actually right.
minidump_stackwalk = breakpad_tools_dir.File(
'src/processor/minidump_stackwalk')
if not os.path.exists(minidump_dump.abspath):
minidump_stackwalk = os.path.join(breakpad_install_dir, 'bin', 'minidump_stackwalk')
if not os.path.exists(minidump_stackwalk):
raise Exception('minidump_stackwalk not available, '
'but breakpad_tools_dir=%s specified' % breakpad_tools_dir)
'but breakpad_install_dir=%s specified' % breakpad_install_dir)
nodes.append(env.AutoDepsCommand(
[name + '.stackwalk', name + '.stackwalk_errors'],
[minidump_stackwalk, output_dump_file,
Expand Down