From b8fb244a48941d76834d7eb26f07fc00988f85c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Fri, 20 Dec 2019 23:55:05 +0100 Subject: [PATCH] =?UTF-8?q?Add=20patch=20to=20generate=20DWARF=C2=A0debugi?= =?UTF-8?q?nfo=20instead=20of=20STAB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- ...orce-the-dwarf-debug-for-elf-targets.patch | 74 +++++++++++++++++++ rust-nasm-rs.spec | 8 +- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 0001-nasm_rs-Force-the-dwarf-debug-for-elf-targets.patch diff --git a/0001-nasm_rs-Force-the-dwarf-debug-for-elf-targets.patch b/0001-nasm_rs-Force-the-dwarf-debug-for-elf-targets.patch new file mode 100644 index 0000000..740a0bf --- /dev/null +++ b/0001-nasm_rs-Force-the-dwarf-debug-for-elf-targets.patch @@ -0,0 +1,74 @@ +From 3f711947d749ecdfbbec5af236e97d5b760b7710 Mon Sep 17 00:00:00 2001 +From: Luca Barbato +Date: Tue, 10 Dec 2019 11:44:19 +0100 +Subject: [PATCH] nasm_rs: Force the dwarf debug for elf targets + +--- + src/lib.rs | 27 ++++++++++++++------------- + 1 file changed, 14 insertions(+), 13 deletions(-) + +diff --git a/src/lib.rs b/src/lib.rs +index eb032a0a0..c48a84efc 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -9,35 +9,35 @@ use std::process::Stdio; + use std::path::{Path, PathBuf}; + use std::ffi::OsString; + +-fn x86_triple(os: &str) -> &'static str { ++fn x86_triple(os: &str) -> (&'static str, &'static str) { + match os { +- "darwin" | "ios" => "-fmacho32", +- "windows" => "-fwin32", +- _ => "-felf32" ++ "darwin" => ("-fmacho32", "-g"), ++ "windows" => ("-fwin32", "-g"), ++ _ => ("-felf32", "-gdwarf"), + } + } + +-fn x86_64_triple(os: &str) -> &'static str { ++fn x86_64_triple(os: &str) -> (&'static str, &'static str) { + match os { +- "darwin" | "ios" => "-fmacho64", +- "windows" => "-fwin64", +- _ => "-felf64" ++ "darwin" => ("-fmacho64", "-g"), ++ "windows" => ("-fwin64", "-g"), ++ _ => ("-felf64", "-gdwarf"), + } + } + +-fn parse_triple(trip: &str) -> &'static str { ++fn parse_triple(trip: &str) -> (&'static str, &'static str) { + let parts = trip.split('-').collect::>(); + // ARCH-VENDOR-OS-ENVIRONMENT + // or ARCH-VENDOR-OS + // we don't care about environ so doesn't matter if triple doesn't have it + if parts.len() < 3 { +- return "" ++ return ("", ""); + } + + match parts[0] { + "x86_64" => x86_64_triple(parts[2]), + "x86" | "i386" | "i586" | "i686" => x86_triple(parts[2]), +- _ => "" ++ _ => ("", ""), + } + } + +@@ -228,10 +228,11 @@ impl Build { + } + + fn get_args(&self, target: &str) -> Vec<&str> { +- let mut args = vec![parse_triple(&target)]; ++ let (arch_flag, debug_flag) = parse_triple(&target); ++ let mut args = vec![arch_flag]; + + if self.debug { +- args.push("-g"); ++ args.push(debug_flag); + } + + for arg in &self.flags { diff --git a/rust-nasm-rs.spec b/rust-nasm-rs.spec index 64d1b1e..7099671 100644 --- a/rust-nasm-rs.spec +++ b/rust-nasm-rs.spec @@ -6,13 +6,16 @@ Name: rust-%{crate} Version: 0.1.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Run NASM during your Cargo build # Upstream license specification: MIT OR Apache-2.0 License: MIT or ASL 2.0 URL: https://crates.io/crates/nasm-rs Source: %{crates_source} +# Patch to generate DWARF debuginfo instead of STABS. Needed for Rav1e. +# https://github.com/xiph/rav1e/commit/3f711947d749ecdfbbec5af236e97d5b760b7710#diff-3374eb4653baa3be440910b43b58ca64.patch +Patch0: 0001-nasm_rs-Force-the-dwarf-debug-for-elf-targets.patch ExclusiveArch: %{rust_arches} @@ -91,6 +94,9 @@ which use "rayon" feature of "%{crate}" crate. %endif %changelog +* Fri Dec 20 23:53:53 CET 2019 Robert-André Mauchin - 0.1.5-2 +- Add patch to generate DWARF debuginfo instead of STAB + * Thu Dec 05 18:36:07 CET 2019 Robert-André Mauchin - 0.1.5-1 - Release 0.1.5