From 1b0fe91eb0b6c5484ddabf3988db9c652601f438 Mon Sep 17 00:00:00 2001 From: slipher Date: Thu, 2 Jul 2026 01:27:46 -0500 Subject: [PATCH 1/4] Fix possible build error when Breakpad not provided --- src/untrusted/minidump_generator/nacl.scons | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/untrusted/minidump_generator/nacl.scons b/src/untrusted/minidump_generator/nacl.scons index 5c7d0d6f70..3155a6be83 100644 --- a/src/untrusted/minidump_generator/nacl.scons +++ b/src/untrusted/minidump_generator/nacl.scons @@ -5,6 +5,9 @@ Import('env') +if env.get('BREAKPAD_TOOLS_DIR') is None: + Return() + # DAEMON: use the same dir as Breakpad tools for Breakpad includes # Allow Breakpad headers to #include other Breakpad headers. env.Append(CPPPATH=['${BREAKPAD_TOOLS_DIR}/src']) From e3354552ea4aa4cd540f52e6bcce2448311bcb1e Mon Sep 17 00:00:00 2001 From: slipher Date: Thu, 2 Jul 2026 05:18:41 -0500 Subject: [PATCH 2/4] scons: fix minidump_stackwalk existence check --- tests/untrusted_minidump/nacl.scons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/untrusted_minidump/nacl.scons b/tests/untrusted_minidump/nacl.scons index c586075afe..313180c833 100644 --- a/tests/untrusted_minidump/nacl.scons +++ b/tests/untrusted_minidump/nacl.scons @@ -59,7 +59,7 @@ for crash_in_lib in [0, 1]: # 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): + if not os.path.exists(minidump_stackwalk.abspath): raise Exception('minidump_stackwalk not available, ' 'but breakpad_tools_dir=%s specified' % breakpad_tools_dir) nodes.append(env.AutoDepsCommand( From 375500703425a747db31392ceaf6425fe0af62e8 Mon Sep 17 00:00:00 2001 From: slipher Date: Thu, 2 Jul 2026 05:07:34 -0500 Subject: [PATCH 3/4] Use Breakpad install dir instead of in-source build To activate Breakpad tests in Scons, you should now pass breakpad_install_dir= instead of breakpad_tools_dir=. --- README.md | 4 ++-- SConstruct | 12 ++++++------ src/untrusted/minidump_generator/nacl.scons | 5 ++--- tests/untrusted_minidump/nacl.scons | 16 ++++++++-------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 9af4038326..ebe568f6fa 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ 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 +To enable crash dump tests, add the option `breakpad_install_dir=`. The repository can be found at `daemon/libs/breakpad`. You need to have built the Breakpad -tools in-source. +tools and run `make install`. ``` --- diff --git a/SConstruct b/SConstruct index cf2aca4857..4c82162a9a 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,10 +491,10 @@ 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)) +breakpad_install_dir = ARGUMENTS.get('breakpad_install_dir') +if breakpad_install_dir is not None: + pre_base_env['BREAKPAD_INSTALL_DIR'] = pre_base_env.Dir( + os.path.abspath(breakpad_install_dir)) sysroot_flags = [] if ARGUMENTS.get('sysroot') is not None: diff --git a/src/untrusted/minidump_generator/nacl.scons b/src/untrusted/minidump_generator/nacl.scons index 3155a6be83..835b585c48 100644 --- a/src/untrusted/minidump_generator/nacl.scons +++ b/src/untrusted/minidump_generator/nacl.scons @@ -5,12 +5,11 @@ Import('env') -if env.get('BREAKPAD_TOOLS_DIR') is None: +if env.get('BREAKPAD_INSTALL_DIR') is None: Return() -# DAEMON: use the same dir as Breakpad tools for Breakpad includes # 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 313180c833..064c1abf61 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,24 @@ 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') + minidump_dump = breakpad_install_dir.File('bin/minidump_dump') if not os.path.exists(minidump_dump.abspath): 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') + minidump_stackwalk = breakpad_install_dir.File( + 'bin/minidump_stackwalk') if not os.path.exists(minidump_stackwalk.abspath): 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, From bd2f84f34f0bca15c5edb8f09ad316f2efce74f2 Mon Sep 17 00:00:00 2001 From: slipher Date: Thu, 2 Jul 2026 05:57:55 -0500 Subject: [PATCH 4/4] Allow installing Breakpad in tools/linux_x86/breakpad It will be automatically used if found there. The scons 'Dir' object had to be dropped in favor of plain strings for the related paths since it goes crazy if the path is inside the source tree. --- README.md | 5 +++-- SConstruct | 14 +++++++++----- tests/untrusted_minidump/nacl.scons | 9 ++++----- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ebe568f6fa..ea65984aaa 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,9 @@ 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_install_dir=`. The -repository can be found at `daemon/libs/breakpad`. You need to have built the Breakpad +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 4c82162a9a..f468448ac3 100755 --- a/SConstruct +++ b/SConstruct @@ -491,11 +491,6 @@ if 'generate_ninja' in ARGUMENTS: pre_base_env, dest_file=ARGUMENTS['generate_ninja']) -breakpad_install_dir = ARGUMENTS.get('breakpad_install_dir') -if breakpad_install_dir is not None: - pre_base_env['BREAKPAD_INSTALL_DIR'] = pre_base_env.Dir( - os.path.abspath(breakpad_install_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/tests/untrusted_minidump/nacl.scons b/tests/untrusted_minidump/nacl.scons index 064c1abf61..5b4b2426f4 100644 --- a/tests/untrusted_minidump/nacl.scons +++ b/tests/untrusted_minidump/nacl.scons @@ -47,8 +47,8 @@ for crash_in_lib in [0, 1]: 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_install_dir.File('bin/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_install_dir=%s specified' % breakpad_install_dir) nodes.append(env.AutoDepsCommand( @@ -57,9 +57,8 @@ for crash_in_lib in [0, 1]: '>${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_install_dir.File( - 'bin/minidump_stackwalk') - if not os.path.exists(minidump_stackwalk.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_install_dir=%s specified' % breakpad_install_dir) nodes.append(env.AutoDepsCommand(