[sdcc/el6] upstream update to 3.4.0

Roy Rankin rrankin at fedoraproject.org
Sat Oct 25 00:01:29 UTC 2014


commit 058ba7a0d88c508da17c8c9d7785a2672f706ce8
Author: Roy Rankin <rrankin at ihug.com.au>
Date:   Sat Oct 25 11:01:27 2014 +1100

    upstream update to 3.4.0

 .gitignore                 |    1 +
 binutils-2.24-bfd.patch    |  177 ++++++++++++++++++++++++++++++++++++++++++++
 sdcc-3.4.0-libiberty.patch |   55 ++++++++++++++
 sdcc-3.4.0-strndup.patch   |   19 +++++
 sdcc.spec                  |   21 +++++-
 sources                    |    3 +-
 6 files changed, 271 insertions(+), 5 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 9f3aabb..a926804 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 sdcc-src-2.9.0.tar.bz2
 /sdcc-src-3.2.0.tar.bz2
 /sdcc-3.2.0-libiberty.patch
+/sdcc-src-3.4.0.tar.bz2
diff --git a/binutils-2.24-bfd.patch b/binutils-2.24-bfd.patch
new file mode 100644
index 0000000..2674a55
--- /dev/null
+++ b/binutils-2.24-bfd.patch
@@ -0,0 +1,177 @@
+commit 27b829ee701e29804216b3803fbaeb629be27491
+Author: Nick Clifton <nickc at redhat.com>
+Date:   Wed Jan 29 13:46:39 2014 +0000
+
+    Following up on Tom's suggestion I am checking in a patch to replace the various
+    bfd_xxx_set macros with static inline functions, so that we can avoid compile time
+    warnings about comma expressions with unused values.
+    
+    	* bfd-in.h (bfd_set_section_vma): Delete.
+    	(bfd_set_section_alignment): Delete.
+    	(bfd_set_section_userdata): Delete.
+    	(bfd_set_cacheable): Delete.
+    	* bfd.c (bfd_set_cacheable): New static inline function.
+    	* section.c (bfd_set_section_userdata): Likewise.
+    	(bfd_set_section_vma): Likewise.
+    	(bfd_set_section_alignment): Likewise.
+    	* bfd-in2.h: Regenerate.
+
+diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
+index 3afd71b..c7c5a7d 100644
+--- a/bfd/bfd-in.h
++++ b/bfd/bfd-in.h
+@@ -292,9 +292,6 @@ typedef struct bfd_section *sec_ptr;
+ 
+ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+ 
+-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
+-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+ /* Find the address one past the end of SEC.  */
+ #define bfd_get_section_limit(bfd, sec) \
+   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
+@@ -517,8 +514,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *);
+ 
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+ 
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+-
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
+ /* NB: This declaration should match the autogenerated one in libbfd.h.  */
+diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
+index 71996db..b5aeb40 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -299,9 +299,6 @@ typedef struct bfd_section *sec_ptr;
+ 
+ #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+ 
+-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
+-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+ /* Find the address one past the end of SEC.  */
+ #define bfd_get_section_limit(bfd, sec) \
+   (((bfd)->direction != write_direction && (sec)->rawsize != 0	\
+@@ -524,8 +521,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *);
+ 
+ #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+ 
+-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+-
+ extern bfd_boolean bfd_cache_close
+   (bfd *abfd);
+ /* NB: This declaration should match the autogenerated one in libbfd.h.  */
+@@ -1029,7 +1024,7 @@ bfd *bfd_openr (const char *filename, const char *target);
+ 
+ bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
+ 
+-bfd *bfd_openstreamr (const char *, const char *, void *);
++bfd *bfd_openstreamr (const char * filename, const char * target, void * stream);
+ 
+ bfd *bfd_openr_iovec (const char *filename, const char *target,
+     void *(*open_func) (struct bfd *nbfd,
+@@ -1596,6 +1591,32 @@ struct relax_table {
+   int size;
+ };
+ 
++/* Note: the following are provided as inline functions rather than macros
++   because not all callers use the return value.  A macro implementation
++   would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
++   compilers will complain about comma expressions that have no effect.  */
++static inline bfd_boolean
++bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
++{
++  ptr->userdata = val;
++  return TRUE;
++}
++
++static inline bfd_boolean
++bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
++{
++  ptr->vma = ptr->lma = val;
++  ptr->user_set_vma = TRUE;
++  return TRUE;
++}
++
++static inline bfd_boolean
++bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
++{
++  ptr->alignment_power = val;
++  return TRUE;
++}
++
+ /* These sections are global, and are managed by BFD.  The application
+    and target back end are not permitted to change the values in
+    these sections.  */
+@@ -6415,6 +6436,14 @@ struct bfd
+   unsigned int selective_search : 1;
+ };
+ 
++/* See note beside bfd_set_section_userdata.  */
++static inline bfd_boolean
++bfd_set_cacheable (bfd * abfd, bfd_boolean val)
++{
++  abfd->cacheable = val;
++  return TRUE;
++}
++
+ typedef enum bfd_error
+ {
+   bfd_error_no_error = 0,
+diff --git a/bfd/bfd.c b/bfd/bfd.c
+index 8d0580c..2d174f3 100644
+--- a/bfd/bfd.c
++++ b/bfd/bfd.c
+@@ -311,6 +311,14 @@ CODE_FRAGMENT
+ .  unsigned int selective_search : 1;
+ .};
+ .
++.{* See note beside bfd_set_section_userdata.  *}
++.static inline bfd_boolean
++.bfd_set_cacheable (bfd * abfd, bfd_boolean val)
++.{
++.  abfd->cacheable = val;
++.  return TRUE;
++.}
++.
+ */
+ 
+ #include "sysdep.h"
+diff --git a/bfd/section.c b/bfd/section.c
+index fb19d8c..a661228 100644
+--- a/bfd/section.c
++++ b/bfd/section.c
+@@ -542,6 +542,32 @@ CODE_FRAGMENT
+ .  int size;
+ .};
+ .
++.{* Note: the following are provided as inline functions rather than macros
++.   because not all callers use the return value.  A macro implementation
++.   would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
++.   compilers will complain about comma expressions that have no effect.  *}
++.static inline bfd_boolean
++.bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
++.{
++.  ptr->userdata = val;
++.  return TRUE;
++.}
++.
++.static inline bfd_boolean
++.bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
++.{
++.  ptr->vma = ptr->lma = val;
++.  ptr->user_set_vma = TRUE;
++.  return TRUE;
++.}
++.
++.static inline bfd_boolean
++.bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
++.{
++.  ptr->alignment_power = val;
++.  return TRUE;
++.}
++.
+ .{* These sections are global, and are managed by BFD.  The application
+ .   and target back end are not permitted to change the values in
+ .   these sections.  *}
diff --git a/sdcc-3.4.0-libiberty.patch b/sdcc-3.4.0-libiberty.patch
new file mode 100644
index 0000000..90a2b49
--- /dev/null
+++ b/sdcc-3.4.0-libiberty.patch
@@ -0,0 +1,55 @@
+diff --git a/support/sdbinutils/include/objalloc.h b/support/sdbinutils/include/objalloc.h
+index 36772d1..5285766 100644
+--- a/support/sdbinutils/include/objalloc.h
++++ b/support/sdbinutils/include/objalloc.h
+@@ -1,5 +1,5 @@
+ /* objalloc.h -- routines to allocate memory for objects
+-   Copyright 1997, 2001 Free Software Foundation, Inc.
++   Copyright 1997-2012 Free Software Foundation, Inc.
+    Written by Ian Lance Taylor, Cygnus Solutions.
+ 
+ This program is free software; you can redistribute it and/or modify it
+@@ -91,7 +91,7 @@ extern void *_objalloc_alloc (struct objalloc *, unsigned long);
+      if (__len == 0)							\
+        __len = 1;							\
+      __len = (__len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1);	\
+-     (__len <= __o->current_space					\
++     (__len != 0 && __len <= __o->current_space				\
+       ? (__o->current_ptr += __len,					\
+ 	 __o->current_space -= __len,					\
+ 	 (void *) (__o->current_ptr - __len))				\
+diff --git a/support/sdbinutils/libiberty/objalloc.c b/support/sdbinutils/libiberty/objalloc.c
+index 3ddac2c..72e92d2 100644
+--- a/support/sdbinutils/libiberty/objalloc.c
++++ b/support/sdbinutils/libiberty/objalloc.c
+@@ -1,5 +1,5 @@
+ /* objalloc.c -- routines to allocate memory for objects
+-   Copyright 1997 Free Software Foundation, Inc.
++   Copyright 1997-2012 Free Software Foundation, Inc.
+    Written by Ian Lance Taylor, Cygnus Solutions.
+ 
+ This program is free software; you can redistribute it and/or modify it
+@@ -112,8 +112,10 @@ objalloc_create (void)
+ /* Allocate space from an objalloc structure.  */
+ 
+ PTR
+-_objalloc_alloc (struct objalloc *o, unsigned long len)
++_objalloc_alloc (struct objalloc *o, unsigned long original_len)
+ {
++  unsigned long len = original_len;
++
+   /* We avoid confusion from zero sized objects by always allocating
+      at least 1 byte.  */
+   if (len == 0)
+@@ -121,6 +123,11 @@ _objalloc_alloc (struct objalloc *o, unsigned long len)
+ 
+   len = (len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1);
+ 
++  /* Check for overflow in the alignment operation above and the
++     malloc argument below. */
++  if (len + CHUNK_HEADER_SIZE < original_len)
++    return NULL;
++
+   if (len <= o->current_space)
+     {
+       o->current_ptr += len;
diff --git a/sdcc-3.4.0-strndup.patch b/sdcc-3.4.0-strndup.patch
new file mode 100644
index 0000000..b263bac
--- /dev/null
+++ b/sdcc-3.4.0-strndup.patch
@@ -0,0 +1,19 @@
+diff --git a/sdas/linksrc/lkar.c b/sdas/linksrc/lkar.c
+index 7fa2ece..dd72e81 100644
+--- a/sdas/linksrc/lkar.c
++++ b/sdas/linksrc/lkar.c
+@@ -46,14 +46,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+ #endif
+ 
+ 
+-char *
+-strndup (const char *str, size_t len)
+-{
+-  char *s = (char *) malloc (len + 1);
+-  memcpy (s, str, len);
+-  s[len] = '\0';
+-  return s;
+-}
+ 
+ static int
+ is_ar (FILE * libfp)
diff --git a/sdcc.spec b/sdcc.spec
index 772f09f..5a6c2fe 100644
--- a/sdcc.spec
+++ b/sdcc.spec
@@ -1,13 +1,15 @@
 Name:           sdcc
-Version:        3.2.0
-Release:        1%{?dist}
+Version:        3.4.0
+Release:        0%{?dist}
 Summary:        Small Device C Compiler
 Group:          Applications/Engineering
 License:        GPLv2+
 URL:            http://sdcc.sourceforge.net/
 Source0:        http://downloads.sourceforge.net/sdcc/sdcc-src-%{version}.tar.bz2
 Source1:        README.fedora
+Patch0:         binutils-2.24-bfd.patch
 Patch1:         sdcc-%{version}-libiberty.patch
+Patch2:         sdcc-%{version}-strndup.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  autoconf
@@ -52,12 +54,17 @@ Emacs extensions for SDCC.
 
 %prep
 %setup -q -n sdcc
+pushd support/sdbinutils
+%patch0 -p1
+popd
 %patch1 -p1
+%patch2 -p1
+
 find -name '*.[ch]' -exec chmod -x '{}' \;
 
 # Disable brp-strip-static-archive for now because it errors trying to
 # strip foreign binaries.
-%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's#/usr/lib/rpm/redhat/brp-strip-static-archive .*##g')
+%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's#/usr/lib/rpm.*/brp-strip-static-archive .*##g')
 
 
 %build
@@ -80,6 +87,10 @@ find $RPM_BUILD_ROOT -type f -name \*.c -exec chmod a-x '{}' \;
 mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/sdcc
 mv $RPM_BUILD_ROOT%{_bindir}/* $RPM_BUILD_ROOT%{_libexecdir}/sdcc
 
+# remove non-free component
+rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/non-free
+
+
 # Create launch scripts in _bindir
 pushd $RPM_BUILD_ROOT%{_bindir}
 for x in ../libexec/sdcc/*; do
@@ -123,6 +134,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Mon Jul 14 2014 Roy Rankin <rrankin at ihug.com.au> - 3.4.0-0
+- Upstream update 3.4.0
+- remove non-free directories from package
+
 * Thu Jul 17 2014 Roy Rankin <rrankin at ihug.com.au> - 3.2.0-1
 - Security patch for libiberty
 
diff --git a/sources b/sources
index 13cfe5d..5028cbe 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-0808a9b4109d2ba6046ddd7b679a0012  sdcc-src-3.2.0.tar.bz2
-40ac3e0ed7033016dc83656e638bdfa7  sdcc-3.2.0-libiberty.patch
+92db2ea2526f6cef412547bb1e759a48  sdcc-src-3.4.0.tar.bz2


More information about the scm-commits mailing list