From 0c282de11eacf64a047d569a8d04bdf8696c6a0d Mon Sep 17 00:00:00 2001 From: "Tom G. Christensen" Date: Mon, 27 Apr 2015 20:53:55 +0200 Subject: [PATCH] binutils: update to 2.25 --- binutils/build.sh | 5 +- binutils/meta/ChangeLog | 3 + ...s-2.25-use-strtod-instead-of-strtold.patch | 92 +++++++++++++++++++ 3 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 binutils/src/binutils-2.25-use-strtod-instead-of-strtold.patch diff --git a/binutils/build.sh b/binutils/build.sh index 33b3612..d5ab180 100755 --- a/binutils/build.sh +++ b/binutils/build.sh @@ -6,11 +6,11 @@ ########################################################### # Check the following 4 variables before running the script topdir=binutils -version=2.23.2 +version=2.25 pkgver=1 source[0]=ftp://ftp.sunet.se/pub/gnu/binutils/$topdir-$version.tar.bz2 # If there are no patches, simply comment this -#patch[0]= +patch[0]=binutils-2.25-use-strtod-instead-of-strtold.patch # Source function library . ${BUILDPKG_SCRIPTS}/buildpkg.functions @@ -45,6 +45,7 @@ install() ${__rm} -f ${stagedir}${prefix}/${_mandir}/man1/g{dlltool,nlmconv,windres,windmc}* doc COPYING* compat binutils 2.18 1 1 + compat binutils 2.23.2 1 1 } reg pack diff --git a/binutils/meta/ChangeLog b/binutils/meta/ChangeLog index 19fdcba..a4eef35 100644 --- a/binutils/meta/ChangeLog +++ b/binutils/meta/ChangeLog @@ -1,4 +1,7 @@ CHANGELOG --------- +* Sat Apr 25 2015 Tom G. Christensen - 2.25-1 +- Update to 2.25 + * Wed Sep 30 2013 Tom G. Christensen - 2.23.2-1 - Update to 2.23.2 diff --git a/binutils/src/binutils-2.25-use-strtod-instead-of-strtold.patch b/binutils/src/binutils-2.25-use-strtod-instead-of-strtold.patch new file mode 100644 index 0000000..c2da7ca --- /dev/null +++ b/binutils/src/binutils-2.25-use-strtod-instead-of-strtold.patch @@ -0,0 +1,92 @@ +From 5af04e20f6333dc224d1668dcd433d7c8ca84e71 Mon Sep 17 00:00:00 2001 +From: Joel Brobecker +Date: Tue, 14 Oct 2014 12:47:43 -0400 +Subject: [PATCH] Use strtod instead of strtold in libiberty/d-demangle.c + +strtold is currently used to decode templates which have a floating-point +value encoded inside; but this routine is not available on some systems, +such as Solaris 2.9 for instance. + +This patch fixes the issue by replace the use of strtold by strtod. +It reduces a bit the precision, but it should still remain acceptable +in most cases. + +libiberty/ChangeLog: + + * d-demangle.c: Replace strtold with strtod in global comment. + (strtold): Remove declaration. + (strtod): New declaration. + (dlang_parse_real): Declare value as double instead of long + double. Replace call to strtold by call to strtod. + Update format in call to snprintf. +--- + libiberty/ChangeLog | 9 +++++++++ + libiberty/d-demangle.c | 10 +++++----- + 2 files changed, 14 insertions(+), 5 deletions(-) + +diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog +index 829f684..9e91cce 100644 +--- a/libiberty/ChangeLog ++++ b/libiberty/ChangeLog +@@ -1,3 +1,12 @@ ++2014-10-16 Joel Brobecker ++ ++ * d-demangle.c: Replace strtold with strtod in global comment. ++ (strtold): Remove declaration. ++ (strtod): New declaration. ++ (dlang_parse_real): Declare value as double instead of long ++ double. Replace call to strtold by call to strtod. ++ Update format in call to snprintf. ++ + 2014-09-26 Jason Merrill + + * cp-demangle.c (d_substitution): Handle abi tags on abbreviation. +diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c +index d31bf94..bb481c0 100644 +--- a/libiberty/d-demangle.c ++++ b/libiberty/d-demangle.c +@@ -28,7 +28,7 @@ If not, see . */ + + /* This file exports one function; dlang_demangle. + +- This file imports strtol and strtold for decoding mangled literals. */ ++ This file imports strtol and strtod for decoding mangled literals. */ + + #ifdef HAVE_CONFIG_H + #include "config.h" +@@ -44,7 +44,7 @@ If not, see . */ + #include + #else + extern long strtol (const char *nptr, char **endptr, int base); +-extern long double strtold (const char *nptr, char **endptr); ++extern double strtod (const char *nptr, char **endptr); + #endif + + #include +@@ -810,7 +810,7 @@ dlang_parse_real (string *decl, const char *mangled) + { + char buffer[64]; + int len = 0; +- long double value; ++ double value; + char *endptr; + + /* Handle NAN and +-INF. */ +@@ -877,12 +877,12 @@ dlang_parse_real (string *decl, const char *mangled) + + /* Convert buffer from hexadecimal to floating-point. */ + buffer[len] = '\0'; +- value = strtold (buffer, &endptr); ++ value = strtod (buffer, &endptr); + + if (endptr == NULL || endptr != (buffer + len)) + return NULL; + +- len = snprintf (buffer, sizeof(buffer), "%#Lg", value); ++ len = snprintf (buffer, sizeof(buffer), "%#g", value); + string_appendn (decl, buffer, len); + return mangled; + } +-- +1.9.4 +