diff --git a/debian/control b/debian/control index 2cc5a7e450a73814881f5929caadfe6993264b51..2f78268b49bb13d02225582533ca6faf0b4f2485 100644 --- a/debian/control +++ b/debian/control @@ -7,9 +7,9 @@ Build-Depends: debhelper-compat (= 12), dh-cargo, librust-anyhow-1-dev, librust-fallible-iterator-0-dev, - librust-gimli-0+indexmap-dev (>= 0.19), + librust-gimli-0+indexmap-dev (>= 0.26), librust-memmap-0-dev (>= 0.7), - librust-object-0+default-dev (>= 0.12), + librust-object-0+default-dev (>= 0.29), librust-serde-1+derive-dev, librust-serde-json-1-dev, librust-structopt-0+default-dev (>= 0.3), diff --git a/debian/patches/relax-deps.patch b/debian/patches/relax-deps.patch index 88e3eda7ed6118e61baecb201df22d60ded04cc9..3203e18912accc4e22e3396ff8a8ba3b2264e37a 100644 --- a/debian/patches/relax-deps.patch +++ b/debian/patches/relax-deps.patch @@ -4,13 +4,13 @@ anyhow = "1.0" serde = { version = "1", features = ["derive"] } serde_json = "1.0" --gimli = "0.19" +-gimli = "0.26" -fallible-iterator = "0.2" -+gimli = ">= 0.19" ++gimli = ">= 0.26" +fallible-iterator = "0" memmap = "0.7" --object = { version = "0.12", features = [ "std", "compression" ] } -+object = { version = ">= 0.12", features = [ "std", "compression" ] } +-object = { version = "0.29", features = [ "std", "compression" ] } ++object = { version = ">= 0.29", features = [ "std", "compression" ] } typed-arena = "2" -structopt = "0.3" +structopt = ">= 0.3" diff --git a/debian/patches/series b/debian/patches/series index bdddf05ae546555b06f7432fa9bd69cb4590599a..65bf1769587e30d808801eeba298af7d2f528a52 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ +update-gimli+object-bookworm.patch relax-deps.patch diff --git a/debian/patches/update-gimli+object-bookworm.patch b/debian/patches/update-gimli+object-bookworm.patch new file mode 100644 index 0000000000000000000000000000000000000000..0d1a07bfd33e7f9e1a17d6852777aa96c5fb714f --- /dev/null +++ b/debian/patches/update-gimli+object-bookworm.patch @@ -0,0 +1,53 @@ +From: Andrej Shadura <andrew.shadura@collabora.co.uk> +Date: Sun, 1 Jan 2023 00:40:08 +0100 +Subject: Update gimli to 0.26 and object to 0.29 + +Object 0.18 removed section_data_by_name. + +Bug-Debian: https://bugs.debian.org/998306 + +Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk> +--- + Cargo.toml | 4 ++-- + src/main.rs | 5 +++-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/Cargo.toml b/Cargo.toml +index 4bab46a..f0700c0 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -9,9 +9,9 @@ edition = "2018" + anyhow = "1.0" + serde = { version = "1", features = ["derive"] } + serde_json = "1.0" +-gimli = "0.19" ++gimli = "0.26" + fallible-iterator = "0.2" + memmap = "0.7" +-object = { version = "0.12", features = [ "std", "compression" ] } ++object = { version = "0.29", features = [ "std", "compression" ] } + typed-arena = "2" + structopt = "0.3" +diff --git a/src/main.rs b/src/main.rs +index b370e4e..e89c157 100644 +--- a/src/main.rs ++++ b/src/main.rs +@@ -2,7 +2,7 @@ + use anyhow::{anyhow, Error, Result}; + use fallible_iterator::{convert, FallibleIterator}; + use gimli::{AttributeValue, Endianity, Reader}; +-use object::Object; ++use object::{Object, ObjectSection}; + use serde::ser::SerializeMap; + use serde::{Serialize, Serializer}; + use std::borrow::{Borrow, Cow}; +@@ -26,7 +26,8 @@ fn list_file<E: Endianity>(file: &object::File, endian: E) -> Result<Vec<Unit>> + 'a: 'file, + { + let data = file +- .section_data_by_name(S::section_name()) ++ .section_by_name(S::section_name()) ++ .and_then(|section| section.uncompressed_data().ok()) + .unwrap_or(Cow::Borrowed(&[])); + let data_ref = (*arena.alloc(data)).borrow(); + S::from(gimli::EndianSlice::new(data_ref, endian))