diff --git a/README.md b/README.md index 9af4038326..ea65984aaa 100644 --- a/README.md +++ b/README.md @@ -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=`. 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=`, +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`. ``` --- diff --git a/SConstruct b/SConstruct index cf2aca4857..f468448ac3 100755 --- a/SConstruct +++ b/SConstruct @@ -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. @@ -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'))) @@ -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: diff --git a/src/untrusted/minidump_generator/nacl.scons b/src/untrusted/minidump_generator/nacl.scons index 5c7d0d6f70..835b585c48 100644 --- a/src/untrusted/minidump_generator/nacl.scons +++ b/src/untrusted/minidump_generator/nacl.scons @@ -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']) diff --git a/tests/untrusted_minidump/nacl.scons b/tests/untrusted_minidump/nacl.scons index c586075afe..5b4b2426f4 100644 --- a/tests/untrusted_minidump/nacl.scons +++ b/tests/untrusted_minidump/nacl.scons @@ -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'): @@ -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,