From 6ab055d78161d36975e6fb05625d3e6c114486a3 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Feb 02 2016 18:38:52 +0000 Subject: Remove -fno-if-conversion and patch floating point comparisons --- diff --git a/nodejs-mapnik-rgbtohsl.patch b/nodejs-mapnik-rgbtohsl.patch new file mode 100644 index 0000000..47d6bad --- /dev/null +++ b/nodejs-mapnik-rgbtohsl.patch @@ -0,0 +1,32 @@ +commit 23f0a7361ebcdbab92cf270b848b3f4c96441c77 +Author: Tom Hughes +Date: Tue Feb 2 17:22:47 2016 +0000 + + Avoid equality comparisons of floating point numbers + + Equality comparisons of floating point numbers are always + dangerous and this case the code was actually failing on x86 + with gcc 6 because one side of the comparison was still in a + register and hence had 80 bit precision while the other side + had been stored to memory and reduced to 64 bit precision: + + https://bugzilla.redhat.com/show_bug.cgi?id=1303315 + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69570 + +diff --git a/src/tint.hpp b/src/tint.hpp +index 21009d2..3644b46 100644 +--- a/src/tint.hpp ++++ b/src/tint.hpp +@@ -16,9 +16,9 @@ static inline void rgb_to_hsl(unsigned red, unsigned green, unsigned blue, + h = 0.0, s = 0.0, l = gamma / 2.0; + if (delta > 0.0) { + s = l > 0.5 ? delta / (2.0 - gamma) : delta / gamma; +- if (max == r && max != g) h = (g - b) / delta + (g < b ? 6.0 : 0.0); +- if (max == g && max != b) h = (b - r) / delta + 2.0; +- if (max == b && max != r) h = (r - g) / delta + 4.0; ++ if (r >= b && r > g) h = (g - b) / delta + (g < b ? 6.0 : 0.0); ++ if (g >= r && g > b) h = (b - r) / delta + 2.0; ++ if (b >= g && b > r) h = (r - g) / delta + 4.0; + h /= 6.0; + } + } diff --git a/nodejs-mapnik.spec b/nodejs-mapnik.spec index f549369..77a2686 100644 --- a/nodejs-mapnik.spec +++ b/nodejs-mapnik.spec @@ -1,6 +1,6 @@ Name: nodejs-mapnik Version: 3.4.16 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Bindings to Mapnik tile rendering library for Node.js License: BSD @@ -12,6 +12,8 @@ Patch0: nodejs-mapnik-pregyp.patch Patch1: nodejs-mapnik-relax-tests.patch # Disable some tests that fail on non-x86_64 platforms Patch2: nodejs-mapnik-failing-tests-otherarchs.patch +# https://github.com/mapnik/node-mapnik/pull/589 +Patch3: nodejs-mapnik-rgbtohsl.patch ExclusiveArch: %{nodejs_arches} @@ -54,17 +56,16 @@ BuildRequires: npm(nan) >= 2.2.0 %ifnarch x86_64 %patch2 -p1 %endif -%nodejs_fixdep -r nan -%nodejs_fixdep --dev nan "^2.1.0" -%nodejs_fixdep -r mapnik-vector-tile -%nodejs_fixdep --dev mapnik-vector-tile "0.14.2" +%patch3 -p1 +%nodejs_fixdep --dev --move nan +%nodejs_fixdep --dev --move mapnik-vector-tile rm -rf deps/protozero node_modules echo '{}' > common.gypi %build %nodejs_symlink_deps --build -export CXXFLAGS="%{optflags} -fno-if-conversion" +export CXXFLAGS="%{optflags}" export LDFLAGS="%{?__global_ldflags}" node-gyp configure -- -Dmodule_name=mapnik -Dmodule_path=lib/binding node-gyp build @@ -93,6 +94,9 @@ ln -s %{nodejs_sitelib}/mapnik/bin/mapnik-inspect.js %{buildroot}/%{_bindir}/ma %changelog +* Tue Feb 2 2016 Tom Hughes - 3.4.16-3 +- Remove -fno-if-conversion and patch floating point comparisons + * Sat Jan 30 2016 Tom Hughes - 3.4.16-2 - Add -fno-if-conversion to avoid gcc 6 bug