diff --git a/Makefile.in b/Makefile.in index 573b2f2baa1..2b1c3b88a62 100644 --- a/Makefile.in +++ b/Makefile.in @@ -172,6 +172,7 @@ endif $(RM) -r $(DIST)/crashreporter-symbols $(RM) "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip" $(NSINSTALL) -D $(DIST)/crashreporter-symbols + OBJCOPY="$(OBJCOPY)" \ $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \ $(MAKE_SYM_STORE_ARGS) \ $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \ diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index a190d34b67d..0265e09c59d 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -416,6 +416,7 @@ GMAKE = @GMAKE@ PERL = @PERL@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ +OBJCOPY = @OBJCOPY@ UNZIP = @UNZIP@ ZIP = @ZIP@ XARGS = @XARGS@ diff --git a/configure.in b/configure.in index c663f0353f6..2d83ad14ee0 100644 --- a/configure.in +++ b/configure.in @@ -371,6 +371,7 @@ case "$target" in AR="$android_toolchain"/bin/"$android_tool_prefix"-ar RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip + OBJCOPY="$android_toolchain"/bin/"$android_tool_prefix"-objcopy case "${target_cpu}" in arm*) @@ -443,6 +444,9 @@ case "$target" in MOZ_CHROME_FILE_FORMAT=omni ZLIB_DIR=yes ;; +*-linux*) + AC_PATH_PROG(OBJCOPY,objcopy) + ;; esac AC_SUBST(ANDROID_NDK) @@ -451,6 +455,7 @@ AC_SUBST(ANDROID_PLATFORM) AC_SUBST(ANDROID_SDK) AC_SUBST(ANDROID_PLATFORM_TOOLS) AC_SUBST(ANDROID_PACKAGE_NAME) +AC_SUBST(OBJCOPY) dnl ======================================================== dnl Checks for compilers. diff --git a/toolkit/crashreporter/tools/symbolstore.py b/toolkit/crashreporter/tools/symbolstore.py index b5d8695b272..b96131da37e 100755 --- a/toolkit/crashreporter/tools/symbolstore.py +++ b/toolkit/crashreporter/tools/symbolstore.py @@ -634,6 +634,7 @@ class Dumper_Win32(Dumper): return result class Dumper_Linux(Dumper): + objcopy = os.environ['OBJCOPY'] if 'OBJCOPY' in os.environ else 'objcopy' def ShouldProcess(self, file): """This function will allow processing of files that are executable, or end with the .so extension, and additionally @@ -648,8 +649,8 @@ class Dumper_Linux(Dumper): # .gnu_debuglink section to the object, so the debugger can # actually load our debug info later. file_dbg = file + ".dbg" - if call(['objcopy', '--only-keep-debug', file, file_dbg]) == 0 and \ - call(['objcopy', '--add-gnu-debuglink=%s' % file_dbg, file]) == 0: + if call([self.objcopy, '--only-keep-debug', file, file_dbg]) == 0 and \ + call([self.objcopy, '--add-gnu-debuglink=%s' % file_dbg, file]) == 0: rel_path = os.path.join(debug_file, guid, debug_file + ".dbg")