svn commit: r567405 - in head/games/0ad: . files
Guido Falsi
madpilot at FreeBSD.org
Fri Mar 5 18:51:33 UTC 2021
Author: madpilot
Date: Fri Mar 5 18:51:31 2021
New Revision: 567405
URL: https://svnweb.freebsd.org/changeset/ports/567405
Log:
- Import patches for powerpc64le
- Force the -msse2 option only for i386 where it is actually needed
PR: 253924
Submitted by: pkubaj@
Added:
head/games/0ad/files/patch-libraries_source_nvtt_src_src_nvcore_Debug.cpp (contents, props changed)
head/games/0ad/files/patch-source_lib_byte__order.h (contents, props changed)
head/games/0ad/files/patch-source_lib_sysdep_arch.h (contents, props changed)
head/games/0ad/files/patch-source_lib_sysdep_arch_ppc64_ppc64.cpp (contents, props changed)
head/games/0ad/files/patch-source_ps_GameSetup_HWDetect.cpp (contents, props changed)
Modified:
head/games/0ad/Makefile
head/games/0ad/files/patch-build_premake_premake5.lua
Modified: head/games/0ad/Makefile
==============================================================================
--- head/games/0ad/Makefile Fri Mar 5 18:28:34 2021 (r567404)
+++ head/games/0ad/Makefile Fri Mar 5 18:51:31 2021 (r567405)
@@ -45,7 +45,6 @@ WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-alpha
BUILD_WRKSRC= ${WRKSRC}/build/workspaces/gcc
MAKE_ARGS= config=release verbose=1
CPPFLAGS+= -DU_USING_ICU_NAMESPACE=1
-CFLAGS+= -msse2
BUNDLE_LIBS= yes
DOS2UNIX_REGEX= .*\.([ch]p{0,2}|make)
BINARY_ALIAS= python3=${PYTHON_CMD}
@@ -57,6 +56,10 @@ MAKE_ENV+= JOBS=${_MAKE_JOBS}
PORTDATA= *
.include <bsd.port.pre.mk>
+
+.if ${ARCH} == i386
+CFLAGS+= -msse2
+.endif
post-patch:
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
Modified: head/games/0ad/files/patch-build_premake_premake5.lua
==============================================================================
--- head/games/0ad/files/patch-build_premake_premake5.lua Fri Mar 5 18:28:34 2021 (r567404)
+++ head/games/0ad/files/patch-build_premake_premake5.lua Fri Mar 5 18:51:31 2021 (r567405)
@@ -1,5 +1,14 @@
---- build/premake/premake5.lua.orig 2021-02-06 00:32:37 UTC
+--- build/premake/premake5.lua.orig 2021-02-28 23:45:14 UTC
+++ build/premake/premake5.lua
+@@ -87,6 +87,8 @@ else
+ arch = "aarch64"
+ elseif string.find(machine, "e2k") == 1 then
+ arch = "e2k"
++ 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
@@ -365,7 +365,7 @@ function project_set_build_flags()
if os.istarget("linux") or os.istarget("bsd") then
@@ -9,3 +18,12 @@
end
-- To use our local shared libraries, they need to be found in the
+@@ -865,6 +867,8 @@ function setup_all_libs ()
+ table.insert(source_dirs, "lib/sysdep/arch/aarch64");
+ elseif arch == "e2k" then
+ table.insert(source_dirs, "lib/sysdep/arch/e2k");
++ elseif arch == "ppc64" then
++ table.insert(source_dirs, "lib/sysdep/arch/ppc64");
+ end
+
+ -- OS-specific
Added: head/games/0ad/files/patch-libraries_source_nvtt_src_src_nvcore_Debug.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/0ad/files/patch-libraries_source_nvtt_src_src_nvcore_Debug.cpp Fri Mar 5 18:51:31 2021 (r567405)
@@ -0,0 +1,12 @@
+--- libraries/source/nvtt/src/src/nvcore/Debug.cpp.orig 2021-02-28 23:45:14 UTC
++++ libraries/source/nvtt/src/src/nvcore/Debug.cpp
+@@ -628,6 +628,9 @@ namespace
+ # elif NV_CPU_X86
+ ucontext_t * ucp = (ucontext_t *)secret;
+ return (void *)ucp->uc_mcontext.mc_eip;
++# elif NV_CPU_PPC
++ ucontext_t * ucp = (ucontext_t *)secret;
++ return (void *)ucp->uc_mcontext.mc_srr0;
+ # else
+ # error "Unknown CPU"
+ # endif
Added: head/games/0ad/files/patch-source_lib_byte__order.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/0ad/files/patch-source_lib_byte__order.h Fri Mar 5 18:51:31 2021 (r567405)
@@ -0,0 +1,11 @@
+--- source/lib/byte_order.h.orig 2021-02-28 23:45:13 UTC
++++ 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 || ARCH_E2K || defined(__LITTLE_ENDIAN__)
++# if ARCH_IA32 || ARCH_IA64 || ARCH_AMD64 || ARCH_ALPHA || ARCH_ARM || ARCH_AARCH64 || ARCH_MIPS || ARCH_E2K || ARCH_PPC64 || defined(__LITTLE_ENDIAN__)
+ # define BYTE_ORDER LITTLE_ENDIAN
+ # else
+ # define BYTE_ORDER BIG_ENDIAN
Added: head/games/0ad/files/patch-source_lib_sysdep_arch.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/0ad/files/patch-source_lib_sysdep_arch.h Fri Mar 5 18:51:31 2021 (r567405)
@@ -0,0 +1,18 @@
+--- source/lib/sysdep/arch.h.orig 2021-02-28 23:45:13 UTC
++++ source/lib/sysdep/arch.h
+@@ -76,9 +76,14 @@
+ #else
+ # define ARCH_E2K 0
+ #endif
++#if defined(__PPC64__)
++# define ARCH_PPC64 1
++#else
++# define ARCH_PPC64 0
++#endif
+
+ // ensure exactly one architecture has been detected
+-#if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_AARCH64+ARCH_MIPS+ARCH_E2K) != 1
++#if (ARCH_IA32+ARCH_IA64+ARCH_AMD64+ARCH_ALPHA+ARCH_ARM+ARCH_AARCH64+ARCH_MIPS+ARCH_E2K+ARCH_PPC64) != 1
+ # error "architecture not correctly detected (either none or multiple ARCH_* defined)"
+ #endif
+
Added: head/games/0ad/files/patch-source_lib_sysdep_arch_ppc64_ppc64.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/0ad/files/patch-source_lib_sysdep_arch_ppc64_ppc64.cpp Fri Mar 5 18:51:31 2021 (r567405)
@@ -0,0 +1,53 @@
+--- source/lib/sysdep/arch/ppc64/ppc64.cpp.orig 2021-02-28 23:47:02 UTC
++++ 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
++}
Added: head/games/0ad/files/patch-source_ps_GameSetup_HWDetect.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/games/0ad/files/patch-source_ps_GameSetup_HWDetect.cpp Fri Mar 5 18:51:31 2021 (r567405)
@@ -0,0 +1,10 @@
+--- source/ps/GameSetup/HWDetect.cpp.orig 2021-02-28 23:45:13 UTC
++++ source/ps/GameSetup/HWDetect.cpp
+@@ -124,6 +124,7 @@ void RunHardwareDetection()
+ scriptInterface.SetProperty(settings, "arch_arm", ARCH_ARM);
+ scriptInterface.SetProperty(settings, "arch_aarch64", ARCH_AARCH64);
+ scriptInterface.SetProperty(settings, "arch_e2k", ARCH_E2K);
++ scriptInterface.SetProperty(settings, "arch_ppc64", ARCH_PPC64);
+
+ #ifdef NDEBUG
+ scriptInterface.SetProperty(settings, "build_debug", 0);
More information about the svn-ports-all
mailing list