diff --git a/sdcc-2.9.0-r5476-fix-doublefree.diff b/sdcc-2.9.0-r5476-fix-doublefree.diff new file mode 100644 index 0000000..ab69503 --- /dev/null +++ b/sdcc-2.9.0-r5476-fix-doublefree.diff @@ -0,0 +1,20 @@ +--- trunk/sdcc/as/link/lkar.c 2009/07/18 08:25:57 5475 ++++ trunk/sdcc/as/link/lkar.c 2009/07/18 09:11:36 5476 +@@ -454,8 +454,6 @@ + { + long moduleOffset = ftell (libfp); + +- free (obj_name); +- + /* Opened OK - create a new libraryfile object for it */ + if (This == NULL) + { +@@ -484,7 +482,7 @@ + + add_rel_index (libfp, hdr.ar_size, This); + +- fseek (libfp, moduleOffset + hdr.ar_size + (hdr.ar_size & 1), SEEK_SET); ++ fseek (libfp, moduleOffset + hdr.ar_size + (hdr.ar_size & 1), SEEK_SET);; + } + } + diff --git a/sdcc.spec b/sdcc.spec index be6dab0..5cb8c61 100644 --- a/sdcc.spec +++ b/sdcc.spec @@ -1,6 +1,6 @@ Name: sdcc Version: 2.9.0 -Release: 1%{?dist} +Release: 3%{?dist} Summary: Small Device C Compiler Group: Applications/Engineering License: GPLv2+ @@ -9,14 +9,14 @@ Source0: http://downloads.sourceforge.net/sdcc/sdcc-src-%{version}.tar.bz Source1: README.fedora Patch0: sdcc-2.9.0-patch-out-getline.diff Patch1: sdcc-2.9.0-configure.diff -#Patch1: sdcc-2.8.0-debugger-makefile.diff -#Patch2: sdcc-2.8.0-doc-lyx.diff +Patch2: sdcc-2.9.0-r5476-fix-doublefree.diff BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf BuildRequires: bison BuildRequires: flex BuildRequires: gc-devel +BuilDrequires: gputils BuildRequires: lyx BuildRequires: latex2html @@ -55,10 +55,29 @@ Emacs extensions for SDCC. %setup -q -n sdcc %patch0 -p1 %patch1 -p1 -#%%patch1 -p0 -#%%patch2 -p1 +%patch2 -p2 find -name '*.[ch]' -exec chmod -x '{}' \; +# Extract %%__os_install_post into os_install_post~ +cat << \EOF > os_install_post~ +%__os_install_post +EOF + +# Generate customized brp-*scripts +cat os_install_post~ | while read a x y; do +case $a in +# Prevent brp-strip* from trying to handle foreign binaries +*/brp-strip*) + b=$(basename $a) + sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b + chmod a+x $b + ;; +esac +done + +sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ +< os_install_post~ > os_install_post + %build # Rebuild configure scripts (patched configure.in s in patch0). @@ -116,6 +135,12 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Jul 20 2009 Conrad Meyer - 2.9.0-3 +- Fix double-free (rhbz# 509278) with patch from upstream. + +* Wed Jul 1 2009 Conrad Meyer - 2.9.0-2 +- Fix #454205 by BR'ing gputils and re-adding install_post hack. + * Thu Apr 30 2009 Conrad Meyer - 2.9.0-1 - Bump to 2.9.0.