From 6acb59d6748dd9c0530c9272e5ad2a6a696c3720 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Jan 29 2015 08:30:45 +0000 Subject: Make uriCompareRangeA() return -1/0/1 like tests assume it does so package will build on aarch64 --- diff --git a/uriparser-bug24.patch b/uriparser-bug24.patch new file mode 100644 index 0000000..6b2d012 --- /dev/null +++ b/uriparser-bug24.patch @@ -0,0 +1,34 @@ +testRangeComparison() in test/test.cpp assumes that strncmp() used by uriCompareRangeA() will always return -1/0/1 values. + +So it fails on AArch64: + +UriSuite: 50/52 +Comparing to yields -64, expected -1. +Comparing to yields 64, expected 1. +UriSuite: 51/52 + +Why? Simple. C standard says that strncmp() has to return <0/0/>0 values. + +Upstream bug: https://sourceforge.net/p/uriparser/bugs/24/ + +Index: uriparser-0.8.1/src/UriCommon.c +=================================================================== +--- uriparser-0.8.1.orig/src/UriCommon.c ++++ uriparser-0.8.1/src/UriCommon.c +@@ -98,7 +98,15 @@ int URI_FUNC(CompareRange)( + return -1; + } + +- return URI_STRNCMP(a->first, b->first, (a->afterLast - a->first)); ++ diff = URI_STRNCMP(a->first, b->first, (a->afterLast - a->first)); ++ ++ if (diff > 0) { ++ return 1; ++ } else if (diff < 0) { ++ return -1; ++ } ++ ++ return diff; + } + + diff --git a/uriparser.spec b/uriparser.spec index edf5444..97c6da9 100644 --- a/uriparser.spec +++ b/uriparser.spec @@ -4,13 +4,14 @@ Name: uriparser Version: 0.8.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: URI parsing library - RFC 3986 Group: System Environment/Libraries License: BSD URL: http://%{name}.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 +Patch0: uriparser-bug24.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: doxygen, graphviz, cpptest-devel Requires: cpptest @@ -31,6 +32,7 @@ developing applications that use %{name}. %prep %setup -q +%patch0 -p1 sed -i 's/\r//' THANKS sed -i 's/\r//' COPYING iconv -f iso-8859-1 -t utf-8 -o THANKS{.utf8,} @@ -89,6 +91,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/*.pc %changelog +* Wed Jan 28 2015 Marcin Juszkiewicz - 0.8.1-3 +- Make uriCompareRangeA() return -1/0/1 like tests assume it does + so package will build on aarch64. + * Fri Jan 09 2015 François Cami - 0.8.1-2 - Use PIC.