The package rpms/0ad.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/0ad.git/commit/?id=c36c6b5a2c7f41891....
Change: +%ifnarch aarch64 ppc64le
Thanks.
Full change: ============
commit c36c6b5a2c7f41891542b3584c9a80cd1b4e8825 Author: dftxbs3e dftxbs3e@free.fr Date: Tue Aug 13 20:09:52 2019 +0200
Fix build on ppc64le
Signed-off-by: dftxbs3e dftxbs3e@free.fr
diff --git a/0ad-mozjs-incompatible.patch b/0ad-mozjs-incompatible.patch deleted file mode 100644 index 3d1d91a..0000000 --- a/0ad-mozjs-incompatible.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -uNr 0ad-0.0.21-alpha.orig/source/scriptinterface/ScriptTypes.h 0ad-0.0.21-alpha/source/scriptinterface/ScriptTypes.h ---- 0ad-0.0.21-alpha.orig/source/scriptinterface/ScriptTypes.h 2016-09-02 18:19:31.000000000 +0200 -+++ 0ad-0.0.21-alpha/source/scriptinterface/ScriptTypes.h 2016-11-09 07:14:16.227277422 +0100 -@@ -79,19 +79,6 @@ - include paths. - #endif - --#if MOZJS_MINOR_VERSION != 3 --#error Your compiler is trying to use an untested minor version of the \ --SpiderMonkey library. If you are a package maintainer, please make sure \ --to check very carefully that this version does not change the behaviour \ --of the code executed by SpiderMonkey. Different parts of the game (e.g. \ --the multiplayer mode) rely on deterministic behaviour of the JavaScript \ --engine. A simple way for testing this would be playing a network game \ --with one player using the old version and one player using the new \ --version. Another way for testing is running replays and comparing the \ --final hash (check trac.wildfiregames.com/wiki/Debugging#Replaymode). \ --For more information check this link: trac.wildfiregames.com/wiki/Debugging#Outofsync --#endif -- - class ScriptInterface; - - #endif // INCLUDED_SCRIPTTYPES -diff -uNr 0ad-0.0.21-alpha.orig/source/simulation2/serialization/BinarySerializer.cpp 0ad-0.0.21-alpha/source/simulation2/serialization/BinarySerializer.cpp ---- 0ad-0.0.21-alpha.orig/source/simulation2/serialization/BinarySerializer.cpp 2016-09-18 11:34:45.000000000 +0200 -+++ 0ad-0.0.21-alpha/source/simulation2/serialization/BinarySerializer.cpp 2016-11-09 07:29:10.293824242 +0100 -@@ -145,11 +145,7 @@ - const JSClass* jsclass = JS_GetClass(obj); - if (!jsclass) - throw PSERROR_Serialize_ScriptError("JS_GetClass failed"); --// TODO: Remove this workaround for upstream API breakage when updating SpiderMonkey --// See https://bugzilla.mozilla.org/show_bug.cgi?id=1236373 --#define JSCLASS_CACHED_PROTO_WIDTH js::JSCLASS_CACHED_PROTO_WIDTH - JSProtoKey protokey = JSCLASS_CACHED_PROTO_KEY(jsclass); --#undef JSCLASS_CACHED_PROTO_WIDTH - - if (protokey == JSProto_Object) - { diff --git a/0ad-ppc64.patch b/0ad-ppc64.patch new file mode 100644 index 0000000..b1042f9 --- /dev/null +++ b/0ad-ppc64.patch @@ -0,0 +1,336 @@ +commit 25511c8fd48533d34475dbc9215032ce76e77e93 +Author: root root@rcs-power9-talos +Date: Mon Aug 20 17:54:30 2018 -0400 + + Enable support for powerpc64 systems + + All features tested and work, internal checks pass + +diff --git a/build/premake/premake4.lua b/build/premake/premake4.lua +index 8b997e22a7..c62bcb3634 100644 +--- a/build/premake/premake4.lua ++++ b/build/premake/premake4.lua +@@ -88,6 +88,8 @@ else + arch = "arm" + elseif string.find(machine, "aarch64") == 1 then + arch = "aarch64" ++ elseif string.find(machine, "ppc64") == 1 or string.find(machine, "powerpc64") == 1 then ++ arch = "ppc64" + else + print("WARNING: Cannot determine architecture from GCC, assuming x86") + end +@@ -823,6 +825,8 @@ function setup_all_libs () + table.insert(source_dirs, "lib/sysdep/arch/x86_x64"); + elseif arch == "arm" then + table.insert(source_dirs, "lib/sysdep/arch/arm"); ++ elseif arch == "ppc64" then ++ table.insert(source_dirs, "lib/sysdep/arch/ppc64"); + elseif arch == "aarch64" then + table.insert(source_dirs, "lib/sysdep/arch/aarch64"); + end +diff --git a/build/premake/premake5.lua b/build/premake/premake5.lua +index 36928fb290..2dab672961 100644 +--- a/build/premake/premake5.lua ++++ b/build/premake/premake5.lua +@@ -81,6 +81,8 @@ else + arch = "arm" + elseif string.find(machine, "aarch64") == 1 then + arch = "aarch64" ++ elseif string.find(machine, "ppc64") == 1 or string.find(machine, "powerpc64") == 1 then ++ arch = "ppc64" + else + print("WARNING: Cannot determine architecture from GCC, assuming x86") + end +@@ -823,6 +825,8 @@ function setup_all_libs () + table.insert(source_dirs, "lib/sysdep/arch/x86_x64"); + elseif arch == "arm" then + table.insert(source_dirs, "lib/sysdep/arch/arm"); ++ elseif arch == "ppc64" then ++ table.insert(source_dirs, "lib/sysdep/arch/ppc64"); + elseif arch == "aarch64" then + table.insert(source_dirs, "lib/sysdep/arch/aarch64"); + end +diff --git a/libraries/source/nvtt/src/src/nvcore/poshlib/posh.h b/libraries/source/nvtt/src/src/nvcore/poshlib/posh.h +index 2a178ab843..953601b327 100644 +--- a/libraries/source/nvtt/src/src/nvcore/poshlib/posh.h ++++ b/libraries/source/nvtt/src/src/nvcore/poshlib/posh.h +@@ -663,7 +663,7 @@ Metrowerks: + ** the MIPS series, so we have to be careful about those. + ** ---------------------------------------------------------------------------- + */ +-#if defined POSH_CPU_X86 || defined POSH_CPU_AXP || defined POSH_CPU_STRONGARM || defined POSH_CPU_AARCH64 || defined POSH_OS_WIN32 || defined POSH_OS_WINCE || defined __MIPSEL__ ++#if defined POSH_CPU_X86 || defined POSH_CPU_AXP || defined POSH_CPU_STRONGARM || defined POSH_CPU_AARCH64 || defined POSH_OS_WIN32 || defined POSH_OS_WINCE || defined __MIPSEL__ || __LITTLE_ENDIAN__ + # define POSH_ENDIAN_STRING "little" + # define POSH_LITTLE_ENDIAN 1 + #else +diff --git a/libraries/source/nvtt/src/src/nvmath/Plane.h b/libraries/source/nvtt/src/src/nvmath/Plane.h +index bc7128c4f5..6c989fd075 100644 +--- a/libraries/source/nvtt/src/src/nvmath/Plane.h ++++ b/libraries/source/nvtt/src/src/nvmath/Plane.h +@@ -6,6 +6,10 @@ + #include <nvmath/nvmath.h> + #include <nvmath/Vector.h> + ++#if NV_USE_ALTIVEC ++#undef vector ++#endif ++ + namespace nv + { + class Matrix; +diff --git a/libraries/source/nvtt/src/src/nvtt/squish/simd_ve.h b/libraries/source/nvtt/src/src/nvtt/squish/simd_ve.h +index 56ed95e0a6..a21ea47fe0 100644 +--- a/libraries/source/nvtt/src/src/nvtt/squish/simd_ve.h ++++ b/libraries/source/nvtt/src/src/nvtt/squish/simd_ve.h +@@ -1,6 +1,7 @@ + /* ----------------------------------------------------------------------------- + + Copyright (c) 2006 Simon Brown si@sjbrown.co.uk ++ Copyright (c) 2016 Raptor Engineering, LLC + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -31,7 +32,7 @@ + + namespace squish { + +-#define VEC4_CONST( X ) Vec4( ( vector float )( X ) ) ++#define VEC4_CONST( X ) Vec4( vec_splats( (float)X ) ) + + class Vec4 + { +@@ -96,7 +97,7 @@ public: + + Vec4& operator*=( Arg v ) + { +- m_v = vec_madd( m_v, v.m_v, ( vector float )( -0.0f ) ); ++ m_v = vec_madd( m_v, v.m_v, vec_splats( -0.0f ) ); + return *this; + } + +@@ -112,7 +113,7 @@ public: + + friend Vec4 operator*( Vec4::Arg left, Vec4::Arg right ) + { +- return Vec4( vec_madd( left.m_v, right.m_v, ( vector float )( -0.0f ) ) ); ++ return Vec4( vec_madd( left.m_v, right.m_v, vec_splats( -0.0f ) ) ); + } + + //! Returns a*b + c +@@ -133,7 +134,7 @@ public: + vector float estimate = vec_re( v.m_v ); + + // one round of Newton-Rhaphson refinement +- vector float diff = vec_nmsub( estimate, v.m_v, ( vector float )( 1.0f ) ); ++ vector float diff = vec_nmsub( estimate, v.m_v, vec_splats( 1.0f ) ); + return Vec4( vec_madd( diff, estimate, estimate ) ); + } + +diff --git a/source/graphics/TextureConverter.cpp b/source/graphics/TextureConverter.cpp +index 05392da6ee..531aec74ca 100644 +--- a/source/graphics/TextureConverter.cpp ++++ b/source/graphics/TextureConverter.cpp +@@ -45,6 +45,10 @@ struct BufferOutputHandler : public nvtt::OutputHandler + { + } + ++ virtual void endImage() ++ { ++ } ++ + virtual bool writeData(const void* data, int size) + { + size_t off = buffer.size(); +diff --git a/source/lib/alignment.h b/source/lib/alignment.h +index f7b20dd29a..ad81081a55 100644 +--- a/source/lib/alignment.h ++++ b/source/lib/alignment.h +@@ -80,7 +80,18 @@ static const size_t cacheLineSize = 64; // (L2) + // MMU pages + // + ++#ifdef __PPC64__ ++// NOTE: ppc64 can operate in either 4k or 64k page size mode ++// If the define page size is larger than the active page size, ++// the allocator functions normally. If the defined page size ++// is less than the active page size, the allocator fails tests. ++// ++// Define the page size to the maximum known architectural page ++// size on ppc64 systems. ++static const size_t g_PageSize = 64 * 1024; // 64 KB ++#else + static const size_t g_PageSize = 4 * 1024; // 4 KB ++#endif + static const size_t g_LargePageSize = 2 * 1024 * 1024; // 2 MB + + +diff --git a/source/lib/byte_order.h b/source/lib/byte_order.h +index c75be1384e..32476eeccc 100644 +--- a/source/lib/byte_order.h ++++ b/source/lib/byte_order.h +@@ -33,7 +33,7 @@ + #ifndef BYTE_ORDER + # define LITTLE_ENDIAN 0x4321 + # define BIG_ENDIAN 0x1234 +-# if ARCH_IA32 || ARCH_IA64 || ARCH_AMD64 || ARCH_ALPHA || ARCH_ARM || ARCH_AARCH64 || ARCH_MIPS || defined(__LITTLE_ENDIAN__) ++# if ARCH_IA32 || ARCH_IA64 || ARCH_AMD64 || ARCH_ALPHA || ARCH_ARM || ARCH_AARCH64 || ARCH_PPC64 || ARCH_MIPS || defined(__LITTLE_ENDIAN__) + # define BYTE_ORDER LITTLE_ENDIAN + # else + # define BYTE_ORDER BIG_ENDIAN +diff --git a/source/lib/sysdep/arch.h b/source/lib/sysdep/arch.h +index e3e520f2e1..789a5e3ae3 100644 +--- a/source/lib/sysdep/arch.h ++++ b/source/lib/sysdep/arch.h +@@ -64,6 +64,12 @@ + #else + # define ARCH_AARCH64 0 + #endif ++// .. PowerPC64 (PPC64) ++#if defined(__PPC64__) ++# define ARCH_PPC64 1 ++#else ++# define ARCH_PPC64 0 ++#endif + // .. MIPS + #if defined(__MIPS__) || defined(__mips__) || defined(__mips) + # define ARCH_MIPS 1 +@@ -72,7 +78,7 @@ + #endif + + // ensure exactly one architecture has been detected +-#if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_AARCH64+ARCH_MIPS) != 1 ++#if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_AARCH64+ARCH_PPC64+ARCH_MIPS) != 1 + # error "architecture not correctly detected (either none or multiple ARCH_* defined)" + #endif + +diff --git a/source/lib/sysdep/arch/ppc64/ppc64.cpp b/source/lib/sysdep/arch/ppc64/ppc64.cpp +new file mode 100644 +index 0000000000..66a9b5ff75 +--- /dev/null ++++ b/source/lib/sysdep/arch/ppc64/ppc64.cpp +@@ -0,0 +1,50 @@ ++/* Copyright (C) 2012 Wildfire Games ++ * Copyright (C) 2018 Raptor Engineering, LLC ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining ++ * a copy of this software and associated documentation files (the ++ * "Software"), to deal in the Software without restriction, including ++ * without limitation the rights to use, copy, modify, merge, publish, ++ * distribute, sublicense, and/or sell copies of the Software, and to ++ * permit persons to whom the Software is furnished to do so, subject to ++ * the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included ++ * in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* ++ * routines specific to POWER ++ */ ++ ++#include "precompiled.h" ++ ++#include "lib/sysdep/cpu.h" ++ ++intptr_t cpu_AtomicAdd(volatile intptr_t* location, intptr_t increment) ++{ ++ return __sync_fetch_and_add(location, increment); ++} ++ ++bool cpu_CAS(volatile intptr_t* location, intptr_t expected, intptr_t newValue) ++{ ++ return __sync_bool_compare_and_swap(location, expected, newValue); ++} ++ ++bool cpu_CAS64(volatile i64* location, i64 expected, i64 newValue) ++{ ++ return __sync_bool_compare_and_swap(location, expected, newValue); ++} ++ ++const char* cpu_IdentifierString() ++{ ++ return "IBM POWER"; // TODO ++} +diff --git a/source/ps/GameSetup/HWDetect.cpp b/source/ps/GameSetup/HWDetect.cpp +index f2c0f4765f..82829d80bd 100644 +--- a/source/ps/GameSetup/HWDetect.cpp ++++ b/source/ps/GameSetup/HWDetect.cpp +@@ -247,6 +247,7 @@ void RunHardwareDetection() + scriptInterface.SetProperty(settings, "arch_amd64", ARCH_AMD64); + scriptInterface.SetProperty(settings, "arch_arm", ARCH_ARM); + scriptInterface.SetProperty(settings, "arch_aarch64", ARCH_AARCH64); ++ scriptInterface.SetProperty(settings, "arch_ppc64", ARCH_PPC64); + + #ifdef NDEBUG + scriptInterface.SetProperty(settings, "build_debug", 0); +diff --git a/extract/0ad-0.0.23b-alpha/libraries/source/spidermonkey/Fixppc64.diff b/extract/0ad-0.0.23b-alpha/libraries/source/spidermonkey/Fixppc64.diff +new file mode 100644 +index 0000000..7b8ea69 +--- /dev/null ++++ b/libraries/source/spidermonkey/Fixppc64.diff +@@ -0,0 +1,47 @@ ++From a0b0b09b078356dcc54113f085042c5deff9050d Mon Sep 17 00:00:00 2001 ++From: Mark Benvenuto mark.benvenuto@mongodb.com ++Date: Thu, 17 Dec 2015 15:13:41 -0500 ++Subject: [PATCH] SERVER-21845 Fix debug non-jit builds of spidermonkey ++ ++--- ++ .../mozjs-38/extract/js/src/jit/CodeGenerator.cpp | 6 +++--- ++ .../mozjs-38/extract/js/src/jit/none/MacroAssembler-none.h | 6 ++++++ ++ 2 files changed, 9 insertions(+), 3 deletions(-) ++ ++diff --git a/src/third_party/mozjs-38/extract/js/src/jit/CodeGenerator.cpp b/src/third_party/mozjs-38/extract/js/src/jit/CodeGenerator.cpp ++index 82f9cf6869c..f04ef3fa2b0 100644 ++--- a/js/src/jit/CodeGenerator.cpp +++++ b/js/src/jit/CodeGenerator.cpp ++@@ -3464,12 +3464,12 @@ CodeGenerator::visitCallDirectEvalV(LCallDirectEvalV* lir) ++ callVM(DirectEvalValueInfo, lir); ++ } ++ ++-// Registers safe for use before generatePrologue(). ++-static const uint32_t EntryTempMask = Registers::TempMask & ~(1 << OsrFrameReg.code()); ++- ++ void ++ CodeGenerator::generateArgumentsChecks(bool bailout) ++ { +++ // Registers safe for use before generatePrologue(). +++ static const uint32_t EntryTempMask = Registers::TempMask & ~(1 << OsrFrameReg.code()); +++ ++ // This function can be used the normal way to check the argument types, ++ // before entering the function and bailout when arguments don't match. ++ // For debug purpose, this is can also be used to force/check that the ++diff --git a/src/third_party/mozjs-38/extract/js/src/jit/none/MacroAssembler-none.h b/src/third_party/mozjs-38/extract/js/src/jit/none/MacroAssembler-none.h ++index 77ed4382749..ef1ec17d766 100644 ++--- a/js/src/jit/none/MacroAssembler-none.h +++++ b/js/src/jit/none/MacroAssembler-none.h ++@@ -131,6 +131,12 @@ class Assembler : public AssemblerShared ++ static void ToggleCall(CodeLocationLabel, bool) { MOZ_CRASH(); } ++ ++ static uintptr_t GetPointer(uint8_t*) { MOZ_CRASH(); } +++ +++ void verifyHeapAccessDisassembly(uint32_t begin, uint32_t end, +++ const Disassembler::HeapAccess &heapAccess) +++ { +++ MOZ_CRASH(); +++ } ++ }; ++ ++ class Operand +diff --git a/extract2/0ad-0.0.23b-alpha/libraries/source/spidermonkey/patch.sh b/extract/0ad-0.0.23b-alpha/libraries/source/spidermonkey/patch.sh +index b10d82f..dd1f6c6 100644 +--- a/libraries/source/spidermonkey/patch.sh ++++ b/libraries/source/spidermonkey/patch.sh +@@ -53,3 +53,5 @@ patch -p1 < ../FixTracelogger.diff + # Based on: https://svnweb.freebsd.org/ports/head/sysutils/py-psutil121/files/patch-_psu... + # Related: https://bugzilla.mozilla.org/show_bug.cgi?id=1238983 + patch -p0 < ../FixpsutilFreeBSD.diff ++ ++patch -p1 < ../Fixppc64.diff diff --git a/0ad.spec b/0ad.spec index fe76396..3806793 100644 --- a/0ad.spec +++ b/0ad.spec @@ -83,7 +83,6 @@ BuildRequires: libvorbis-devel BuildRequires: libxml2-devel BuildRequires: libzip-devel BuildRequires: miniupnpc-devel -BuildRequires: mozjs38-devel BuildRequires: libsodium-devel %if %{with system_nvtt} BuildRequires: nvidia-texture-tools-devel @@ -99,7 +98,20 @@ BuildRequires: wxGTK3-devel BuildRequires: /usr/bin/appstream-util BuildRequires: /usr/bin/python
-ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 +# bundled mozjs +BuildRequires: pkgconfig(nspr) +BuildRequires: pkgconfig(libffi) +BuildRequires: pkgconfig(zlib) +BuildRequires: readline-devel +BuildRequires: /usr/bin/zip + +# bundled mozjs: For build time tests only +BuildRequires: python2-devel +BuildRequires: perl-devel + +ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le + +Provides: bundled(mozjs) = 38
# Only do fcollada debug build with enabling debug maintainer mode # It also prevents assumption there that it is building in x86 @@ -108,9 +120,8 @@ Patch1: %{name}-debug.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1141464 Patch3: %{name}-valgrind.patch
-# We have don't want to ensure that we have 38.3.x of mozjs (we just don't have it) -# And other fixes -Patch4: %{name}-mozjs-incompatible.patch +# Fix build on ppc64le with patches from https://wiki.raptorcs.com/wiki/Porting/0ad +Patch5: %{name}-ppc64.patch
%description 0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform @@ -132,7 +143,7 @@ hobbyist game developers, since 2001. %patch1 -p0 %endif %patch3 -p1 -%patch4 -p1 +%patch5 -p1
%if %{with system_nvtt} rm -fr libraries/source/nvtt @@ -149,7 +160,6 @@ build/workspaces/update-workspaces.sh \ --bindir=%{_bindir} \ --datadir=%{_datadir}/%{name} \ --libdir=%{_libdir}/%{name} \ - --with-system-mozjs38 \ %if %{with system_nvtt} --with-system-nvtt \ %endif @@ -200,7 +210,7 @@ export STRIP=/bin/true #----------------------------------------------------------------------- %check # Depends on availablity of nvtt -%ifnarch aarch64 +%ifnarch aarch64 ppc64le %if %{with nvtt} LD_LIBRARY_PATH=binaries/system binaries/system/test%{dbg} -libdir binaries/system %endif @@ -224,6 +234,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/0ad.desktop %{_mandir}/man6/*.6*
%changelog +* Tue Aug 13 2019 dftxbs3e dftxbs3e@free.fr - 0.0.23b-8 +- Fix build on ppc64le + * Wed Jul 24 2019 Fedora Release Engineering releng@fedoraproject.org - 0.0.23b-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
arch-excludes@lists.fedoraproject.org