From 9a9de1654be17381e662733c6c6a25802e56b108 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Sun, 10 Sep 2017 13:51:18 +0200 Subject: [PATCH] Add %mingw_nm macro --- macros.mingw | 1 + mingw-filesystem.spec | 5 ++++- mingw-find-debuginfo.sh | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/macros.mingw b/macros.mingw index a0bd07f..9d1b869 100644 --- a/macros.mingw +++ b/macros.mingw @@ -7,6 +7,7 @@ %mingw_strip mingw-strip %mingw_objdump mingw-objdump %mingw_objcopy mingw-objcopy +%mingw_nm mingw-nm %mingw_findprovides %{_rpmconfigdir}/mingw-find-provides.sh %{mingw_build_targets} %mingw_findrequires %{_rpmconfigdir}/mingw-find-requires.sh %{mingw_build_targets} diff --git a/mingw-filesystem.spec b/mingw-filesystem.spec index c9638b5..eee47d6 100644 --- a/mingw-filesystem.spec +++ b/mingw-filesystem.spec @@ -6,7 +6,7 @@ %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) Name: mingw-filesystem -Version: 102 +Version: 103 Release: 1%{?dist} Summary: MinGW cross compiler base filesystem and environment @@ -309,6 +309,9 @@ install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_datadir}/mingw/ %changelog +* Sun Sep 10 2017 Sandro Mani - 103-1 +- Add %%mingw_nm macro + * Sat Sep 09 2017 Sandro Mani - 102-1 - Also extract debuginfo data from pyd binaries diff --git a/mingw-find-debuginfo.sh b/mingw-find-debuginfo.sh index de6dee1..261385f 100755 --- a/mingw-find-debuginfo.sh +++ b/mingw-find-debuginfo.sh @@ -25,7 +25,10 @@ do echo extracting debug info from $f mingw-objcopy --only-keep-debug $f $f.debug || : pushd `dirname $f` - mingw-objcopy --add-gnu-debuglink=`basename $f.debug` --strip-unneeded `basename $f` || : + keep_symbols=`mktemp` + mingw-nm $f.debug --format=sysv --defined-only | awk -F \| '{ if ($4 ~ "Function") print $1 }' | sort > "$keep_symbols" + mingw-objcopy --add-gnu-debuglink=`basename $f.debug` --strip-unneeded `basename $f` --keep-symbols="$keep_symbols" || : + rm -f "$keep_symbols" popd done