aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-27 18:52:15 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-27 19:06:34 +0000
commit9e8be8c45a36e9f53a586a79acb726d74f5c687b (patch)
tree3de8c1295ab9c7910197246a2e246efc70168a52
parent899374110f3929278af84f575ebaeff039439bdb (diff)
downloadpaludis-9e8be8c45a36e9f53a586a79acb726d74f5c687b.tar.gz
paludis-9e8be8c45a36e9f53a586a79acb726d74f5c687b.tar.xz
Support compressing split debug symbols
-rw-r--r--paludis/repositories/e/e_stripper.cc1
-rw-r--r--paludis/repositories/unpackaged/unpackaged_stripper.cc1
-rw-r--r--paludis/stripper.cc7
-rw-r--r--paludis/stripper.hh2
-rw-r--r--paludis/stripper_TEST.cc3
5 files changed, 12 insertions, 2 deletions
diff --git a/paludis/repositories/e/e_stripper.cc b/paludis/repositories/e/e_stripper.cc
index 0ed20a4..8d4324b 100644
--- a/paludis/repositories/e/e_stripper.cc
+++ b/paludis/repositories/e/e_stripper.cc
@@ -42,6 +42,7 @@ namespace paludis
EStripper::EStripper(const EStripperOptions & options) :
Stripper(make_named_values<StripperOptions>(
+ n::compress_splits() = false,
n::debug_dir() = options.debug_dir(),
n::image_dir() = options.image_dir(),
n::split() = options.split(),
diff --git a/paludis/repositories/unpackaged/unpackaged_stripper.cc b/paludis/repositories/unpackaged/unpackaged_stripper.cc
index b414740..899c250 100644
--- a/paludis/repositories/unpackaged/unpackaged_stripper.cc
+++ b/paludis/repositories/unpackaged/unpackaged_stripper.cc
@@ -42,6 +42,7 @@ namespace paludis
UnpackagedStripper::UnpackagedStripper(const UnpackagedStripperOptions & options) :
Stripper(make_named_values<StripperOptions>(
+ n::compress_splits() = false,
n::debug_dir() = options.debug_dir(),
n::image_dir() = options.image_dir(),
n::split() = options.split(),
diff --git a/paludis/stripper.cc b/paludis/stripper.cc
index fae2a23..49e5805 100644
--- a/paludis/stripper.cc
+++ b/paludis/stripper.cc
@@ -267,8 +267,13 @@ Stripper::do_split(const FSPath & f, const FSPath & g)
std::for_each(to_make.begin(), to_make.end(), std::bind(std::mem_fn(&FSPath::mkdir), _1, 0755, FSPathMkdirOptions() + fspmkdo_ok_if_exists));
}
- Process objcopy_copy_process(ProcessCommand({ "objcopy", "--only-keep-debug", stringify(f), stringify(g) }));
+ ProcessCommand objcopy_copy_process_args({ "objcopy", "--only-keep-debug", stringify(f), stringify(g) });
+ if (_imp->options.compress_splits())
+ objcopy_copy_process_args.append_args({ "--compress-debug-sections" });
+ Process objcopy_copy_process(std::move(objcopy_copy_process_args));
+
Process objcopy_link_process(ProcessCommand({ "objcopy", "--add-gnu-debuglink=" + stringify(g), stringify(f) }));
+
if (0 != objcopy_copy_process.run().wait())
Log::get_instance()->message("strip.failure", ll_warning, lc_context) << "Couldn't copy debug information for '" << f << "'";
else if (0 != objcopy_link_process.run().wait())
diff --git a/paludis/stripper.hh b/paludis/stripper.hh
index fa1d17a..f768e8b 100644
--- a/paludis/stripper.hh
+++ b/paludis/stripper.hh
@@ -32,6 +32,7 @@ namespace paludis
{
namespace n
{
+ typedef Name<struct name_compress_splits> compress_splits;
typedef Name<struct name_debug_dir> debug_dir;
typedef Name<struct name_image_dir> image_dir;
typedef Name<struct name_split> split;
@@ -40,6 +41,7 @@ namespace paludis
struct StripperOptions
{
+ NamedValue<n::compress_splits, bool> compress_splits;
NamedValue<n::debug_dir, FSPath> debug_dir;
NamedValue<n::image_dir, FSPath> image_dir;
NamedValue<n::split, bool> split;
diff --git a/paludis/stripper_TEST.cc b/paludis/stripper_TEST.cc
index 550c822..6ddc866 100644
--- a/paludis/stripper_TEST.cc
+++ b/paludis/stripper_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2008, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -69,6 +69,7 @@ namespace test_cases
void run()
{
TestStripper s(make_named_values<StripperOptions>(
+ n::compress_splits() = false,
n::debug_dir() = FSPath("stripper_TEST_dir/image").realpath() / "usr" / "lib" / "debug",
n::image_dir() = FSPath("stripper_TEST_dir/image").realpath(),
n::split() = true,