parent
3a9b0c55ee
commit
2c2940faf4
@ -0,0 +1 @@
|
|||||||
|
/addr2line-0.5.0.crate
|
@ -0,0 +1,42 @@
|
|||||||
|
From 0f5000c31db77cc4352f573eadd637958cf6b94c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||||
|
Date: Fri, 5 Jan 2018 21:10:04 +0100
|
||||||
|
Subject: [PATCH] bump memmap to 0.6
|
||||||
|
|
||||||
|
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||||
|
---
|
||||||
|
src/lib.rs | 9 +++++----
|
||||||
|
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/lib.rs b/src/lib.rs
|
||||||
|
index 99c911b..55ea1c6 100644
|
||||||
|
--- a/src/lib.rs
|
||||||
|
+++ b/src/lib.rs
|
||||||
|
@@ -41,6 +41,7 @@ use owning_ref::OwningHandle;
|
||||||
|
use fallible_iterator::FallibleIterator;
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
|
+use std::fs::File;
|
||||||
|
use std::path;
|
||||||
|
use std::error;
|
||||||
|
use std::borrow::Cow;
|
||||||
|
@@ -232,12 +233,12 @@ impl Mapping {
|
||||||
|
}
|
||||||
|
|
||||||
|
fn new_inner(file_path: &path::Path, opts: Options) -> Result<Mapping> {
|
||||||
|
- let file = memmap::Mmap::open_path(file_path, memmap::Protection::Read)
|
||||||
|
- .map_err(|e| ErrorKind::BadPath(e))?;
|
||||||
|
+ let file = File::open(file_path).map_err(ErrorKind::BadPath)?;
|
||||||
|
+ let map = unsafe { memmap::Mmap::map(&file).map_err(ErrorKind::BadPath)? };
|
||||||
|
|
||||||
|
- OwningHandle::try_new(Box::new(file), |mmap| -> Result<_> {
|
||||||
|
+ OwningHandle::try_new(Box::new(map), |mmap| -> Result<_> {
|
||||||
|
let mmap: &memmap::Mmap = unsafe { &*mmap };
|
||||||
|
- let bytes = unsafe { mmap.as_slice() };
|
||||||
|
+ let bytes = &*mmap;
|
||||||
|
EndianDebugInfo::new(bytes, opts)
|
||||||
|
.chain_err(|| "failed to analyze debug information")
|
||||||
|
.map(|di| Box::new(di))
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
@ -0,0 +1,49 @@
|
|||||||
|
From 14a771a4bf07050d6ebc3125fcd860bc95e89ba4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||||
|
Date: Fri, 5 Jan 2018 20:22:15 +0100
|
||||||
|
Subject: [PATCH] bump object to 0.7
|
||||||
|
|
||||||
|
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||||
|
---
|
||||||
|
src/lib.rs | 11 ++++++-----
|
||||||
|
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/lib.rs b/src/lib.rs
|
||||||
|
index 45da35c..99c911b 100644
|
||||||
|
--- a/src/lib.rs
|
||||||
|
+++ b/src/lib.rs
|
||||||
|
@@ -36,6 +36,7 @@ extern crate cpp_demangle;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate error_chain;
|
||||||
|
|
||||||
|
+use object::Object;
|
||||||
|
use owning_ref::OwningHandle;
|
||||||
|
use fallible_iterator::FallibleIterator;
|
||||||
|
|
||||||
|
@@ -311,18 +312,18 @@ where
|
||||||
|
opts: Options,
|
||||||
|
endian: Endian,
|
||||||
|
) -> Result<DebugInfo<'input, Endian>> {
|
||||||
|
- let debug_info = file.get_section(".debug_info")
|
||||||
|
+ let debug_info = file.section_data_by_name(".debug_info")
|
||||||
|
.ok_or(ErrorKind::MissingDebugSection("debug_info"))?;
|
||||||
|
let debug_info = gimli::DebugInfo::new(debug_info, endian);
|
||||||
|
- let debug_abbrev = file.get_section(".debug_abbrev")
|
||||||
|
+ let debug_abbrev = file.section_data_by_name(".debug_abbrev")
|
||||||
|
.ok_or(ErrorKind::MissingDebugSection("debug_abbrev"))?;
|
||||||
|
let debug_abbrev = gimli::DebugAbbrev::new(debug_abbrev, endian);
|
||||||
|
- let debug_line = file.get_section(".debug_line")
|
||||||
|
+ let debug_line = file.section_data_by_name(".debug_line")
|
||||||
|
.ok_or(ErrorKind::MissingDebugSection("debug_line"))?;
|
||||||
|
let debug_line = gimli::DebugLine::new(debug_line, endian);
|
||||||
|
- let debug_ranges = file.get_section(".debug_ranges").unwrap_or(&[]);
|
||||||
|
+ let debug_ranges = file.section_data_by_name(".debug_ranges").unwrap_or(&[]);
|
||||||
|
let debug_ranges = gimli::DebugRanges::new(debug_ranges, endian);
|
||||||
|
- let debug_str = file.get_section(".debug_str").unwrap_or(&[]);
|
||||||
|
+ let debug_str = file.section_data_by_name(".debug_str").unwrap_or(&[]);
|
||||||
|
let debug_str = gimli::DebugStr::new(debug_str, endian);
|
||||||
|
|
||||||
|
let mut units = Vec::new();
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
--- addr2line-0.5.0/Cargo.toml 1970-01-01T01:00:00+01:00
|
||||||
|
+++ addr2line-0.5.0/Cargo.toml 2018-01-05T19:45:38.710593+01:00
|
||||||
|
@@ -30,28 +30,28 @@
|
||||||
|
version = "2.19.1"
|
||||||
|
|
||||||
|
[dependencies.object]
|
||||||
|
-version = "0.4.1"
|
||||||
|
+version = "0.7"
|
||||||
|
|
||||||
|
[dependencies.owning_ref]
|
||||||
|
-version = "0.2.4"
|
||||||
|
+version = "0.3"
|
||||||
|
|
||||||
|
[dependencies.gimli]
|
||||||
|
-version = "0.14.0"
|
||||||
|
+version = "0.15"
|
||||||
|
|
||||||
|
[dependencies.error-chain]
|
||||||
|
-version = "0.7.1"
|
||||||
|
+version = "0.11"
|
||||||
|
|
||||||
|
[dependencies.fallible-iterator]
|
||||||
|
version = "0.1.3"
|
||||||
|
|
||||||
|
[dependencies.memmap]
|
||||||
|
-version = "0.5.0"
|
||||||
|
+version = "0.6"
|
||||||
|
|
||||||
|
[dependencies.rustc-demangle]
|
||||||
|
version = "0.1.3"
|
||||||
|
optional = true
|
||||||
|
[dev-dependencies.itertools]
|
||||||
|
-version = "0.5"
|
||||||
|
+version = "0.7"
|
||||||
|
|
||||||
|
[dev-dependencies.glob]
|
||||||
|
version = "0.2"
|
@ -0,0 +1,91 @@
|
|||||||
|
# Generated by rust2rpm
|
||||||
|
%bcond_without check
|
||||||
|
|
||||||
|
%global crate addr2line
|
||||||
|
|
||||||
|
Name: rust-%{crate}
|
||||||
|
Version: 0.5.0
|
||||||
|
Release: 1%{?dist}
|
||||||
|
Summary: Cross-platform `addr2line` clone written in Rust, using `gimli`
|
||||||
|
|
||||||
|
# https://github.com/gimli-rs/addr2line/issues/79
|
||||||
|
License: ASL 2.0 or MIT
|
||||||
|
URL: https://crates.io/crates/addr2line
|
||||||
|
Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
|
||||||
|
# Initial patched metadata
|
||||||
|
# * Bump object to 0.7
|
||||||
|
# * Bump owning_ref to 0.3
|
||||||
|
# * Bump gimli to 0.15
|
||||||
|
# * Bump error-chain to 0.11
|
||||||
|
# * Bump memmap to 0.6, https://github.com/gimli-rs/addr2line/pull/78
|
||||||
|
# * Bump itertools to 0.7
|
||||||
|
Patch0: addr2line-0.5.0-fix-metadata.diff
|
||||||
|
# Make it work with object v0.7
|
||||||
|
Patch1: 0001-bump-object-to-0.7.patch
|
||||||
|
# Make it work with memmap v0.6
|
||||||
|
Patch2: 0001-bump-memmap-to-0.6.patch
|
||||||
|
|
||||||
|
ExclusiveArch: %{rust_arches}
|
||||||
|
|
||||||
|
BuildRequires: rust-packaging
|
||||||
|
# [dependencies]
|
||||||
|
BuildRequires: (crate(clap) >= 2.19.1 with crate(clap) < 3.0.0)
|
||||||
|
BuildRequires: (crate(cpp_demangle) >= 0.2.0 with crate(cpp_demangle) < 0.3.0)
|
||||||
|
BuildRequires: (crate(error-chain) >= 0.11.0 with crate(error-chain) < 0.12.0)
|
||||||
|
BuildRequires: (crate(fallible-iterator) >= 0.1.3 with crate(fallible-iterator) < 0.2.0)
|
||||||
|
BuildRequires: (crate(gimli) >= 0.15.0 with crate(gimli) < 0.16.0)
|
||||||
|
BuildRequires: (crate(memmap) >= 0.6.0 with crate(memmap) < 0.7.0)
|
||||||
|
BuildRequires: (crate(object) >= 0.7.0 with crate(object) < 0.8.0)
|
||||||
|
BuildRequires: (crate(owning_ref) >= 0.3.0 with crate(owning_ref) < 0.4.0)
|
||||||
|
BuildRequires: (crate(rustc-demangle) >= 0.1.3 with crate(rustc-demangle) < 0.2.0)
|
||||||
|
%if %{with check}
|
||||||
|
# [dev-dependencies]
|
||||||
|
BuildRequires: (crate(glob) >= 0.2.0 with crate(glob) < 0.3.0)
|
||||||
|
BuildRequires: (crate(itertools) >= 0.7.0 with crate(itertools) < 0.8.0)
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%description
|
||||||
|
%{summary}.
|
||||||
|
|
||||||
|
%package -n %{crate}
|
||||||
|
Summary: %{summary}
|
||||||
|
|
||||||
|
%description -n %{crate}
|
||||||
|
%{summary}.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
A cross-platform `addr2line` clone written in Rust, using `gimli`.
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages
|
||||||
|
which use %{crate} from crates.io.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{crate}-%{version} -p1
|
||||||
|
%cargo_prep
|
||||||
|
|
||||||
|
%build
|
||||||
|
%cargo_build
|
||||||
|
|
||||||
|
%install
|
||||||
|
%cargo_install
|
||||||
|
|
||||||
|
%if %{with check}
|
||||||
|
%check
|
||||||
|
%cargo_test
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%files -n %{crate}
|
||||||
|
%{_bindir}/addr2line
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%doc README.md
|
||||||
|
%{cargo_registry}/%{crate}-%{version}/
|
||||||
|
%exclude %{cargo_registry}/%{crate}-%{version}/{benchmark.sh,bench.plot.r,coverage,memory.png,time.png}
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Fri Jan 05 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.0-1
|
||||||
|
- Initial package
|
Loading…
Reference in new issue