[cross-binutils/f19] Fix build errors in xtensa

David Howells dhowells at fedoraproject.org
Fri Aug 9 08:36:02 UTC 2013


commit 9b0bba2d78ebd6cf766520a21b43a5e777e0db6f
Author: David Howells <dhowells at redhat.com>
Date:   Fri Aug 9 09:18:04 2013 +0100

    Fix build errors in xtensa
    
    The build errors in xtensa whereby memset() is given sizeof(pointer) as its
    size argument when it should be sizeof(*pointer).

 cross-binutils-2.23.2-xtensa-memset.patch |   22 ++++++++++++++++++++++
 cross-binutils.spec                       |    8 ++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/cross-binutils-2.23.2-xtensa-memset.patch b/cross-binutils-2.23.2-xtensa-memset.patch
new file mode 100644
index 0000000..de891ac
--- /dev/null
+++ b/cross-binutils-2.23.2-xtensa-memset.patch
@@ -0,0 +1,22 @@
+diff -ur binutils-2.23.2-old/bfd/elf32-xtensa.c binutils-2.23.2/bfd/elf32-xtensa.c
+--- binutils-2.23.2-old/bfd/elf32-xtensa.c	2012-06-29 15:46:01.000000000 +0100
++++ binutils-2.23.2/bfd/elf32-xtensa.c	2013-08-09 09:06:51.271162551 +0100
+@@ -6075,7 +6075,7 @@
+       release_internal_relocs (sec_cache->sec, sec_cache->relocs);
+       if (sec_cache->ptbl)
+ 	free (sec_cache->ptbl);
+-      memset (sec_cache, 0, sizeof (sec_cache));
++      memset (sec_cache, 0, sizeof (*sec_cache));
+     }
+ }
+ 
+@@ -6117,7 +6117,7 @@
+ 
+   /* Fill in the new section cache.  */
+   clear_section_cache (sec_cache);
+-  memset (sec_cache, 0, sizeof (sec_cache));
++  memset (sec_cache, 0, sizeof (*sec_cache));
+ 
+   sec_cache->sec = sec;
+   sec_cache->contents = contents;
+
diff --git a/cross-binutils.spec b/cross-binutils.spec
index 4be0a57..dbec74f 100644
--- a/cross-binutils.spec
+++ b/cross-binutils.spec
@@ -103,6 +103,9 @@ Patch19: binutils-2.23.2-aarch64-em.patch
 # Add support for the .machinemode pseudo-op to the S/390 assembler.
 patch20: binutils-2.23.2-s390-gas-machinemode.patch
 
+# Fix for xtensa memset length
+Patch100: cross-binutils-2.23.2-xtensa-memset.patch
+
 Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 BuildRequires: texinfo >= 4.0, gettext, flex, bison, zlib-devel
 # BZ 920545: We need pod2man in order to build the manual pages.
@@ -233,6 +236,8 @@ cd %{srcdir}
 %patch19 -p0 -b .aarch64~
 %patch20 -p0 -b .machinemode~
 
+%patch100 -p1 -b .xtensa~
+
 # We cannot run autotools as there is an exact requirement of autoconf-2.59.
 
 # On ppc64 we might use 64KiB pages
@@ -670,6 +675,9 @@ rm -rf %{buildroot}
 %do_files xtensa-linux-gnu	%{build_xtensa}
 
 %changelog
+* Fri Aug 9 2013 David Howells <dhowells at redhat.com> - 2.23.88.0.1-2
+- Fix a build error in xtensa
+
 * Thu Aug 8 2013 David Howells <dhowells at redhat.com> - 2.23.88.0.1-2
 - Backport S390 .machinemode pseudo-op support from binutils-2.23.88.0.1-10.
 - Add pod2man as a build requirement.


More information about the scm-commits mailing list