Add workaround for %%check failure with gcc 4.9 on i686

This commit is contained in:
pcpa 2014-04-18 19:20:11 -03:00
parent e1c8ae485f
commit 91ebe26aff
2 changed files with 29 additions and 1 deletions

21
0ad-check.patch Normal file
View File

@ -0,0 +1,21 @@
diff -up 0ad-0.0.15-alpha/source/lib/allocators/tests/test_headerless.h.orig 0ad-0.0.15-alpha/source/lib/allocators/tests/test_headerless.h
--- 0ad-0.0.15-alpha/source/lib/allocators/tests/test_headerless.h.orig 2014-04-18 18:59:21.714584836 -0300
+++ 0ad-0.0.15-alpha/source/lib/allocators/tests/test_headerless.h 2014-04-18 19:00:01.101586345 -0300
@@ -114,14 +114,14 @@ public:
srand(1);
+ const size_t maxSize = (size_t)((rand() / (float)RAND_MAX) * poolSize);
+ const size_t size = std::max((size_t)HeaderlessAllocator::minAllocationSize, round_down(maxSize, HeaderlessAllocator::allocationAlignment));
+ // (the size_t cast on minAllocationSize prevents max taking a reference to the non-defined variable)
for(int i = 0; i < 1000; i++)
{
// allocate
if(rand() >= RAND_MAX/2)
{
- const size_t maxSize = (size_t)((rand() / (float)RAND_MAX) * poolSize);
- const size_t size = std::max((size_t)HeaderlessAllocator::minAllocationSize, round_down(maxSize, HeaderlessAllocator::allocationAlignment));
- // (the size_t cast on minAllocationSize prevents max taking a reference to the non-defined variable)
void* p = a.Allocate(size);
if(!p)
continue;

View File

@ -25,7 +25,7 @@
Name: 0ad
Version: 0.0.15
Release: 3%{?dist}
Release: 4%{?dist}
# BSD License:
# build/premake/*
# libraries/valgrind/* (not built/used)
@ -113,6 +113,9 @@ Patch1: %{name}-debug.patch
# Build with miniupnpc-1.9
Patch2: %{name}-miniupnpc.patch
# After some trial&error this corrects a %%check failure with gcc 4.9 on i686
Patch3: %{name}-check.patch
%description
0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
real-time strategy (RTS) game of ancient warfare. In short, it is a
@ -134,6 +137,7 @@ hobbyist game developers, since 2001.
%patch1 -p1
%endif
%patch2 -p1
%patch3 -p1
%if %{with_system_nvtt}
rm -fr libraries/nvtt
@ -234,6 +238,9 @@ export STRIP=/bin/true
%{_mandir}/man6/*.6*
%changelog
* Fri Apr 18 2014 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.0.15-4
- Add workaround for %%check failure with gcc 4.9 on i686
* Fri Apr 18 2014 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 0.0.15-3
- Rebuild with minupnpc 1.9