From f6b43dd9a38f97b5a3dd5c0f2c3bc12cc8da105d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Wed, 28 Jan 2015 11:07:52 +0100 Subject: [PATCH] - fix build on big endian arches, patch by Jakub Cajka from #1185298 --- glm-0.9.6.1-bigendian.patch | 29 +++++++++++++++++++++++++++++ glm.spec | 8 +++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 glm-0.9.6.1-bigendian.patch diff --git a/glm-0.9.6.1-bigendian.patch b/glm-0.9.6.1-bigendian.patch new file mode 100644 index 0000000..b097412 --- /dev/null +++ b/glm-0.9.6.1-bigendian.patch @@ -0,0 +1,29 @@ +diff -up glm/glm/detail/func_integer.inl.befix glm/glm/detail/func_integer.inl +--- glm/glm/detail/func_integer.inl.befix 2015-01-28 08:44:30.468627717 +0100 ++++ glm/glm/detail/func_integer.inl 2015-01-28 08:46:19.990024091 +0100 +@@ -248,10 +248,8 @@ namespace detail + GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); + + uint64 Value64 = static_cast(x) * static_cast(y); +- uint32* PointerMSB = (reinterpret_cast(&Value64) + 1); +- msb = *PointerMSB; +- uint32* PointerLSB = (reinterpret_cast(&Value64) + 0); +- lsb = *PointerLSB; ++ msb = Value64 >> 32; ++ lsb = Value64; + } + + template class vecType> +@@ -270,10 +268,8 @@ namespace detail + GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch"); + + int64 Value64 = static_cast(x) * static_cast(y); +- int32* PointerMSB = (reinterpret_cast(&Value64) + 1); +- msb = *PointerMSB; +- int32* PointerLSB = (reinterpret_cast(&Value64)); +- lsb = *PointerLSB; ++ msb = Value64 >> 32; ++ lsb = Value64; + } + + template class vecType> diff --git a/glm.spec b/glm.spec index 8b771f5..182bce5 100644 --- a/glm.spec +++ b/glm.spec @@ -3,7 +3,7 @@ Name: glm Version: 0.9.6.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: C++ mathematics library for graphics programming License: MIT @@ -11,6 +11,8 @@ URL: http://glm.g-truc.net/ Source0: http://downloads.sourceforge.net/ogl-math/%{name}-%{version}/%{name}-%{version}.zip Patch0: glm-0.9.5.2-smallercount.patch Patch1: glm-0.9.6.1-ulp.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1185298 +Patch2: glm-0.9.6.1-bigendian.patch BuildRequires: cmake @@ -75,6 +77,7 @@ sed -i 's/\r//' doc/api/tabs.css %patch0 -p1 -b .smallercount %patch1 -p1 -b .ulp +%patch2 -p1 -b .bigendian %build mkdir build @@ -111,6 +114,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/cmake/FindGLM.cmake %doc doc/api/ %changelog +* Wed Jan 28 2015 Dan Horák - 0.9.6.1-2 +- fix build on big endian arches, patch by Jakub Cajka from #1185298 + * Tue Jan 06 2015 Joonas Sarajärvi - 0.9.6.1-1 - Update to upstream GLM version 0.9.6.1