[macppc, sparc64] games/godot won't build there

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[macppc, sparc64] games/godot won't build there

Charlene Wendling

We're currently trying to build godot on these 2 archs for nothing and
it's pretty time consuming: ~6 hours on a PowerBook 5,8.

> http://build-failures.rhaalovely.net/powerpc/2019-07-14/games/godot.log

There were occurrences of NULL that gcc does not consider as boolean
false as you can read in the log, that was easy to fix, but then:

core/safe_refcount.h:126: undefined reference to `__sync_add_and_fetch_8'

(...and more). We don't support the 64-bit __sync_* family, only the
newer __atomic_* one. So i've marked it as BROKEN like the others.

> http://build-failures.rhaalovely.net/sparc64/2019-07-11/games/godot.log

The log says that the architecture is not supported.

OK?


Charlène.


Index: Makefile
===================================================================
RCS file: /cvs/ports/games/godot/Makefile,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 Makefile
--- Makefile 12 Jul 2019 20:46:19 -0000 1.7
+++ Makefile 31 Jul 2019 17:55:57 -0000
@@ -1,5 +1,8 @@
 # $OpenBSD: Makefile,v 1.7 2019/07/12 20:46:19 sthen Exp $
 
+NOT_FOR_ARCHS = sparc64
+BROKEN-powerpc = undefined reference to __sync_sub_and_fetch_8
+
 COMMENT = 2D and 3D game engine
 
 V = 3.0.6


Reply | Threaded
Open this post in threaded view
|

Re: [macppc, sparc64] games/godot won't build there

Jeremie Courreges-Anglas-5
On Wed, Jul 31 2019, Charlene Wendling <[hidden email]> wrote:
> We're currently trying to build godot on these 2 archs for nothing and
> it's pretty time consuming: ~6 hours on a PowerBook 5,8.
>
>> http://build-failures.rhaalovely.net/powerpc/2019-07-14/games/godot.log
>
> There were occurrences of NULL that gcc does not consider as boolean
> false as you can read in the log,

This would be an error on all architectures where ports-gcc is used, not
just powerpc or sparc64.

> that was easy to fix, but then:
>
> core/safe_refcount.h:126: undefined reference to `__sync_add_and_fetch_8'
>
> (...and more). We don't support the 64-bit __sync_* family, only the
> newer __atomic_* one. So i've marked it as BROKEN like the others.
>
>> http://build-failures.rhaalovely.net/sparc64/2019-07-11/games/godot.log
>
> The log says that the architecture is not supported.

This one looks a bit dumb.  The #ifdef "arch" block doesn't define
a macro common to all known archs so the #error doesn't make sense.

> OK?

I'd rather have something like NOT_FOR_ARCHS = ${GCC49_ARCHS} if we
don't fix the NULL vs false mismatch.

I'm running a build with the diff below, just to see if there are other
problems.  But maybe it would be better to restrict godot to
architectures where it can actually be used...


Index: patches/patch-servers_visual_shader_language_cpp
===================================================================
RCS file: patches/patch-servers_visual_shader_language_cpp
diff -N patches/patch-servers_visual_shader_language_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-servers_visual_shader_language_cpp 4 Aug 2019 13:47:47 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization
+
+Index: servers/visual/shader_language.cpp
+--- servers/visual/shader_language.cpp.orig
++++ servers/visual/shader_language.cpp
+@@ -1869,11 +1869,11 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::b
+
+ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type) {
+
+- ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, NULL);
++ ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, false);
+
+ Vector<DataType> args;
+
+- ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, NULL);
++ ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, false);
+
+ StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();
+
Index: patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
===================================================================
RCS file: patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
diff -N patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h 4 Aug 2019 13:47:47 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: thirdparty/thekla_atlas/nvcore/nvcore.h
+--- thirdparty/thekla_atlas/nvcore/nvcore.h.orig
++++ thirdparty/thekla_atlas/nvcore/nvcore.h
+@@ -115,7 +115,7 @@
+ #elif defined POSH_CPU_STRONGARM
+ #   define NV_CPU_ARM 1
+ #else
+-#   error "Unsupported CPU"
++//#   error "Unsupported CPU"
+ #endif
+
+


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: [macppc, sparc64] games/godot won't build there

Jeremie Courreges-Anglas-5
On Sun, Aug 04 2019, Jeremie Courreges-Anglas <[hidden email]> wrote:

> On Wed, Jul 31 2019, Charlene Wendling <[hidden email]> wrote:
>> We're currently trying to build godot on these 2 archs for nothing and
>> it's pretty time consuming: ~6 hours on a PowerBook 5,8.
>>
>>> http://build-failures.rhaalovely.net/powerpc/2019-07-14/games/godot.log
>>
>> There were occurrences of NULL that gcc does not consider as boolean
>> false as you can read in the log,
>
> This would be an error on all architectures where ports-gcc is used, not
> just powerpc or sparc64.
>
>> that was easy to fix, but then:
>>
>> core/safe_refcount.h:126: undefined reference to `__sync_add_and_fetch_8'
>>
>> (...and more). We don't support the 64-bit __sync_* family, only the
>> newer __atomic_* one. So i've marked it as BROKEN like the others.
>>
>>> http://build-failures.rhaalovely.net/sparc64/2019-07-11/games/godot.log
>>
>> The log says that the architecture is not supported.
>
> This one looks a bit dumb.  The #ifdef "arch" block doesn't define
> a macro common to all known archs so the #error doesn't make sense.
>
>> OK?
>
> I'd rather have something like NOT_FOR_ARCHS = ${GCC49_ARCHS} if we
> don't fix the NULL vs false mismatch.
>
> I'm running a build with the diff below, just to see if there are other
> problems.

There are no other problems, godot packages fine on sparc64 with that
diff.  Do you want to try to add -latomic to LINKFLAGS on powerpc/hppa,
or shall we mark godot as BROKEN there, as you suggested?

> But maybe it would be better to restrict godot to
> architectures where it can actually be used...
>
>
> Index: patches/patch-servers_visual_shader_language_cpp
> ===================================================================
> RCS file: patches/patch-servers_visual_shader_language_cpp
> diff -N patches/patch-servers_visual_shader_language_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-servers_visual_shader_language_cpp 4 Aug 2019 13:47:47 -0000
> @@ -0,0 +1,21 @@
> +$OpenBSD$
> +
> +error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization
> +
> +Index: servers/visual/shader_language.cpp
> +--- servers/visual/shader_language.cpp.orig
> ++++ servers/visual/shader_language.cpp
> +@@ -1869,11 +1869,11 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::b
> +
> + bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type) {
> +
> +- ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, NULL);
> ++ ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, false);
> +
> + Vector<DataType> args;
> +
> +- ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, NULL);
> ++ ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, false);
> +
> + StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();
> +
> Index: patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
> ===================================================================
> RCS file: patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
> diff -N patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h 4 Aug 2019 13:47:47 -0000
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: thirdparty/thekla_atlas/nvcore/nvcore.h
> +--- thirdparty/thekla_atlas/nvcore/nvcore.h.orig
> ++++ thirdparty/thekla_atlas/nvcore/nvcore.h
> +@@ -115,7 +115,7 @@
> + #elif defined POSH_CPU_STRONGARM
> + #   define NV_CPU_ARM 1
> + #else
> +-#   error "Unsupported CPU"
> ++//#   error "Unsupported CPU"
> + #endif
> +
> +

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: [macppc, sparc64] games/godot won't build there

Brian Callahan-5
(Excuse the top posting... traveling and on my phone)

Please don't mark it broken. The __sync functions can be trivially replaced by the __atomic functions, as the __sync functions are implemented in terms of the __atomic functions, which are supported on everything with ports-gcc. See https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html

If you don't want to do this conversion, I'll do it when I'm back (probably Tuesday night or Wednesday). These __sync functions are a general sticking point of mine, as they needlessly prevent ports from building and working on hppa.

~Brian

________________________________________
From: [hidden email] [[hidden email]] on behalf of Jeremie Courreges-Anglas [[hidden email]]
Sent: Sunday, August 04, 2019 12:37 PM
To: Charlene Wendling
Cc: [hidden email]; [hidden email]
Subject: Re: [macppc, sparc64] games/godot won't build there

On Sun, Aug 04 2019, Jeremie Courreges-Anglas <[hidden email]> wrote:

> On Wed, Jul 31 2019, Charlene Wendling <[hidden email]> wrote:
>> We're currently trying to build godot on these 2 archs for nothing and
>> it's pretty time consuming: ~6 hours on a PowerBook 5,8.
>>
>>> http://build-failures.rhaalovely.net/powerpc/2019-07-14/games/godot.log
>>
>> There were occurrences of NULL that gcc does not consider as boolean
>> false as you can read in the log,
>
> This would be an error on all architectures where ports-gcc is used, not
> just powerpc or sparc64.
>
>> that was easy to fix, but then:
>>
>> core/safe_refcount.h:126: undefined reference to `__sync_add_and_fetch_8'
>>
>> (...and more). We don't support the 64-bit __sync_* family, only the
>> newer __atomic_* one. So i've marked it as BROKEN like the others.
>>
>>> http://build-failures.rhaalovely.net/sparc64/2019-07-11/games/godot.log
>>
>> The log says that the architecture is not supported.
>
> This one looks a bit dumb.  The #ifdef "arch" block doesn't define
> a macro common to all known archs so the #error doesn't make sense.
>
>> OK?
>
> I'd rather have something like NOT_FOR_ARCHS = ${GCC49_ARCHS} if we
> don't fix the NULL vs false mismatch.
>
> I'm running a build with the diff below, just to see if there are other
> problems.

There are no other problems, godot packages fine on sparc64 with that
diff.  Do you want to try to add -latomic to LINKFLAGS on powerpc/hppa,
or shall we mark godot as BROKEN there, as you suggested?

> But maybe it would be better to restrict godot to
> architectures where it can actually be used...
>
>
> Index: patches/patch-servers_visual_shader_language_cpp
> ===================================================================
> RCS file: patches/patch-servers_visual_shader_language_cpp
> diff -N patches/patch-servers_visual_shader_language_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-servers_visual_shader_language_cpp  4 Aug 2019 13:47:47 -0000
> @@ -0,0 +1,21 @@
> +$OpenBSD$
> +
> +error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization
> +
> +Index: servers/visual/shader_language.cpp
> +--- servers/visual/shader_language.cpp.orig
> ++++ servers/visual/shader_language.cpp
> +@@ -1869,11 +1869,11 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::b
> +
> + bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type) {
> +
> +-    ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, NULL);
> ++    ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, false);
> +
> +     Vector<DataType> args;
> +
> +-    ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, NULL);
> ++    ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, false);
> +
> +     StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();
> +
> Index: patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
> ===================================================================
> RCS file: patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
> diff -N patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h     4 Aug 2019 13:47:47 -0000
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: thirdparty/thekla_atlas/nvcore/nvcore.h
> +--- thirdparty/thekla_atlas/nvcore/nvcore.h.orig
> ++++ thirdparty/thekla_atlas/nvcore/nvcore.h
> +@@ -115,7 +115,7 @@
> + #elif defined POSH_CPU_STRONGARM
> + #   define NV_CPU_ARM 1
> + #else
> +-#   error "Unsupported CPU"
> ++//#   error "Unsupported CPU"
> + #endif
> +
> +

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: [macppc, sparc64] games/godot won't build there

Jeremie Courreges-Anglas-5
On Sun, Aug 04 2019, "Callahan, Brian Robert" <[hidden email]> wrote:

> (Excuse the top posting... traveling and on my phone)
>
> Please don't mark it broken. The __sync functions can be trivially
> replaced by the __atomic functions, as the __sync functions are
> implemented in terms of the __atomic functions, which are supported on
> everything with ports-gcc. See
> https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html
>
> If you don't want to do this conversion, I'll do it when I'm back
> (probably Tuesday night or Wednesday). These __sync functions are
> a general sticking point of mine, as they needlessly prevent ports from
> building and working on hppa.

Ah ha, so just sticking -latomic somewhere would not be enough.  Thanks
for pointing that out.

Here's a diff with proper comments which I deem desirable.  Charlene,
Thomas, others: ok?


Index: Makefile
===================================================================
RCS file: /cvs/ports/games/godot/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- Makefile 12 Jul 2019 20:46:19 -0000 1.7
+++ Makefile 5 Aug 2019 10:01:21 -0000
@@ -8,7 +8,7 @@ PKGNAME = godot-${V}
 CATEGORIES = games
 HOMEPAGE = https://godotengine.org/
 MAINTAINER = Thomas Frohwein <[hidden email]>
-REVISION = 1
+REVISION = 2
 
 # MIT
 PERMIT_PACKAGE = Yes
Index: patches/patch-servers_visual_shader_language_cpp
===================================================================
RCS file: patches/patch-servers_visual_shader_language_cpp
diff -N patches/patch-servers_visual_shader_language_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-servers_visual_shader_language_cpp 5 Aug 2019 10:01:21 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Fix error with ports-gcc:
+  error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive]
+
+Index: servers/visual/shader_language.cpp
+--- servers/visual/shader_language.cpp.orig
++++ servers/visual/shader_language.cpp
+@@ -1869,11 +1869,11 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::b
+
+ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type) {
+
+- ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, NULL);
++ ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, false);
+
+ Vector<DataType> args;
+
+- ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, NULL);
++ ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, false);
+
+ StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();
+
Index: patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
===================================================================
RCS file: patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
diff -N patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-thirdparty_thekla_atlas_nvcore_nvcore_h 5 Aug 2019 10:01:21 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Overzealous #error, the code builds fine even if the CPU isn't known.
+
+Index: thirdparty/thekla_atlas/nvcore/nvcore.h
+--- thirdparty/thekla_atlas/nvcore/nvcore.h.orig
++++ thirdparty/thekla_atlas/nvcore/nvcore.h
+@@ -115,7 +115,7 @@
+ #elif defined POSH_CPU_STRONGARM
+ #   define NV_CPU_ARM 1
+ #else
+-#   error "Unsupported CPU"
++//#   error "Unsupported CPU"
+ #endif
+
+


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: [macppc, sparc64] games/godot won't build there

Thomas Frohwein-2
On Mon, Aug 05, 2019 at 12:05:05PM +0200, Jeremie Courreges-Anglas wrote:
[...]
> Here's a diff with proper comments which I deem desirable.  Charlene,
> Thomas, others: ok?

I'd like to combine this with the update to the latest release (3.1.1)
as previously proposed [1]. This update also does away with the
thirdparty module that included nvcore.h, so that patch isn't needed
anymore.

The combined diff is below. I did a build and runtime test on amd64
and didn't notice any issues.

ok for combined diff?

[1] https://marc.info/?l=openbsd-ports&m=155822680415354&w=2

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/godot/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- Makefile 12 Jul 2019 20:46:19 -0000 1.7
+++ Makefile 5 Aug 2019 16:56:19 -0000
@@ -1,25 +1,24 @@
-# $OpenBSD: Makefile,v 1.7 2019/07/12 20:46:19 sthen Exp $
+# $OpenBSD: Makefile,v 1.5 2018/10/24 14:28:03 sthen Exp $
 
 COMMENT = 2D and 3D game engine
 
-V = 3.0.6
+V = 3.1.1
 DISTNAME = godot-${V}-stable
 PKGNAME = godot-${V}
 CATEGORIES = games
 HOMEPAGE = https://godotengine.org/
 MAINTAINER = Thomas Frohwein <[hidden email]>
-REVISION = 1
 
 # MIT
 PERMIT_PACKAGE = Yes
 
 WANTLIB += ${COMPILER_LIBCXX}
 WANTLIB += GL X11 Xau Xcursor Xdmcp Xext Xfixes Xi Xinerama Xrandr
-WANTLIB += Xrender c crypto enet execinfo freetype intl m mpcdec
-WANTLIB += ogg opus opusfile png ssl theora theoradec vorbis vorbisfile
+WANTLIB += Xrender c enet execinfo freetype intl m mpcdec
+WANTLIB += ogg opus opusfile png pulse theora theoradec vorbis vorbisfile
 WANTLIB += webp xcb z pcre2-32 vpx zstd
 
-COMPILER = base-clang ports-gcc base-gcc
+COMPILER = base-clang ports-gcc base-gcc
 
 MASTER_SITES = https://downloads.tuxfamily.org/godotengine/${V}/
 EXTRACT_SUFX = .tar.xz
@@ -50,15 +49,17 @@ MODSCONS_FLAGS = CC="${CC}" \
  builtin_zlib=no \
  builtin_zstd=no \
  dev=yes \
+ module_upnp_enabled=no \
+ minizip=no \
  platform=x11 \
  progress=no \
- pulseaudio=no \
  target=release_debug
 LIB_DEPENDS = archivers/zstd \
  audio/libvorbis \
  audio/musepack \
  audio/opusfile \
- devel/gettext,-runtime \
+ audio/pulseaudio \
+ devel/gettext \
  devel/libexecinfo \
  devel/pcre2 \
  graphics/libwebp \
Index: distinfo
===================================================================
RCS file: /cvs/ports/games/godot/distinfo,v
retrieving revision 1.3
diff -u -p -r1.3 distinfo
--- distinfo 25 Aug 2018 19:20:29 -0000 1.3
+++ distinfo 5 Aug 2019 16:56:19 -0000
@@ -1,2 +1,2 @@
-SHA256 (godot-3.0.6-stable.tar.xz) = LfHLNqAMaHrnShHX31vcEyyBapNOJpbswzgnAI/5xrk=
-SIZE (godot-3.0.6-stable.tar.xz) = 12517428
+SHA256 (godot-3.1.1-stable.tar.xz) = ohunblBO84QLDcpKfc0eGE7UmuwoNWpo2JdXAKDZCiU=
+SIZE (godot-3.1.1-stable.tar.xz) = 13112996
Index: patches/patch-core_io_SCsub
===================================================================
RCS file: patches/patch-core_io_SCsub
diff -N patches/patch-core_io_SCsub
--- patches/patch-core_io_SCsub 27 Apr 2018 07:32:53 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
-$OpenBSD: patch-core_io_SCsub,v 1.1.1.1 2018/04/27 07:32:53 bentley Exp $
-
-revert long-distance matching in zstd which is based on private functions and
-doesn't compile if archivers/zstd is installed
-this is a revert of pertinent parts of commit
-f3436a841a3b59fc3a9deb94d5fdfd1e550d0351
-based on github issue #17374
-
-Index: core/io/SCsub
---- core/io/SCsub.orig
-+++ core/io/SCsub
-@@ -5,4 +5,4 @@ Import('env')
- env.add_source_files(env.core_sources, "*.cpp")
-
- Export('env')
--
-+env.Append(CCFLAGS="-DZSTD_STATIC_LINKING_ONLY")
Index: patches/patch-core_io_compression_cpp
===================================================================
RCS file: /cvs/ports/games/godot/patches/patch-core_io_compression_cpp,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-core_io_compression_cpp
--- patches/patch-core_io_compression_cpp 27 Apr 2018 07:32:53 -0000 1.1.1.1
+++ patches/patch-core_io_compression_cpp 5 Aug 2019 16:56:19 -0000
@@ -1,4 +1,4 @@
-$OpenBSD: patch-core_io_compression_cpp,v 1.1.1.1 2018/04/27 07:32:53 bentley Exp $
+$OpenBSD$
 
 revert long-distance matching in zstd which is based on private functions and
 doesn't compile if archivers/zstd is installed
@@ -9,17 +9,16 @@ based on github issue #17374
 Index: core/io/compression.cpp
 --- core/io/compression.cpp.orig
 +++ core/io/compression.cpp
-@@ -79,16 +79,9 @@ int Compression::compress(uint8_t *p_dst, const uint8_
+@@ -80,16 +80,8 @@ int Compression::compress(uint8_t *p_dst, const uint8_
 
  } break;
  case MODE_ZSTD: {
 - ZSTD_CCtx *cctx = ZSTD_createCCtx();
-- ZSTD_CCtx_setParameter(cctx, ZSTD_p_compressionLevel, zstd_level);
+- ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, zstd_level);
 - if (zstd_long_distance_matching) {
-- ZSTD_CCtx_setParameter(cctx, ZSTD_p_enableLongDistanceMatching, 1);
-- ZSTD_CCtx_setParameter(cctx, ZSTD_p_windowLog, zstd_window_log_size);
+- ZSTD_CCtx_setParameter(cctx, ZSTD_c_enableLongDistanceMatching, 1);
+- ZSTD_CCtx_setParameter(cctx, ZSTD_c_windowLog, zstd_window_log_size);
 - }
-+
  int max_dst_size = get_max_compressed_buffer_size(p_src_size, MODE_ZSTD);
 - int ret = ZSTD_compressCCtx(cctx, p_dst, max_dst_size, p_src, p_src_size, zstd_level);
 - ZSTD_freeCCtx(cctx);
@@ -28,23 +27,24 @@ Index: core/io/compression.cpp
  } break;
  }
 
-@@ -173,11 +166,8 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_
+@@ -174,13 +166,7 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_
  return total;
  } break;
  case MODE_ZSTD: {
 - ZSTD_DCtx *dctx = ZSTD_createDCtx();
-- if (zstd_long_distance_matching) ZSTD_DCtx_setMaxWindowSize(dctx, 1 << zstd_window_log_size);
+- if (zstd_long_distance_matching) {
+- ZSTD_DCtx_setParameter(dctx, ZSTD_d_windowLogMax, zstd_window_log_size);
+- }
 - int ret = ZSTD_decompressDCtx(dctx, p_dst, p_dst_max_size, p_src, p_src_size);
 - ZSTD_freeDCtx(dctx);
 - return ret;
-+
-+ return ZSTD_decompress(p_dst, p_dst_max_size, p_src, p_src_size);
++ return ZSTD_decompress(p_dst, p_dst_max_size, p_src, p_src_size);
  } break;
  }
 
-@@ -187,5 +177,3 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_
+@@ -190,5 +176,3 @@ int Compression::decompress(uint8_t *p_dst, int p_dst_
  int Compression::zlib_level = Z_DEFAULT_COMPRESSION;
  int Compression::gzip_level = Z_DEFAULT_COMPRESSION;
  int Compression::zstd_level = 3;
 -bool Compression::zstd_long_distance_matching = false;
--int Compression::zstd_window_log_size = 27;
+-int Compression::zstd_window_log_size = 27; // ZSTD_WINDOWLOG_LIMIT_DEFAULT
Index: patches/patch-core_io_compression_h
===================================================================
RCS file: /cvs/ports/games/godot/patches/patch-core_io_compression_h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-core_io_compression_h
--- patches/patch-core_io_compression_h 27 Apr 2018 07:32:53 -0000 1.1.1.1
+++ patches/patch-core_io_compression_h 5 Aug 2019 16:56:19 -0000
@@ -1,4 +1,4 @@
-$OpenBSD: patch-core_io_compression_h,v 1.1.1.1 2018/04/27 07:32:53 bentley Exp $
+$OpenBSD$
 
 revert long-distance matching in zstd which is based on private functions and
 doesn't compile if archivers/zstd is installed
Index: patches/patch-core_project_settings_cpp
===================================================================
RCS file: /cvs/ports/games/godot/patches/patch-core_project_settings_cpp,v
retrieving revision 1.2
diff -u -p -r1.2 patch-core_project_settings_cpp
--- patches/patch-core_project_settings_cpp 25 Aug 2018 19:20:29 -0000 1.2
+++ patches/patch-core_project_settings_cpp 5 Aug 2019 16:56:19 -0000
@@ -9,8 +9,8 @@ based on github issue #17374
 Index: core/project_settings.cpp
 --- core/project_settings.cpp.orig
 +++ core/project_settings.cpp
-@@ -1041,14 +1041,11 @@ ProjectSettings::ProjectSettings() {
- GLOBAL_DEF("debug/settings/profiler/max_functions", 16384);
+@@ -1172,14 +1172,11 @@ ProjectSettings::ProjectSettings() {
+ custom_prop_info["debug/settings/profiler/max_functions"] = PropertyInfo(Variant::INT, "debug/settings/profiler/max_functions", PROPERTY_HINT_RANGE, "128,65535,1");
 
  //assigning here, because using GLOBAL_GET on every block for compressing can be slow
 - Compression::zstd_long_distance_matching = GLOBAL_DEF("compression/formats/zstd/long_distance_matching", false);
Index: patches/patch-drivers_unix_os_unix_cpp
===================================================================
RCS file: /cvs/ports/games/godot/patches/patch-drivers_unix_os_unix_cpp,v
retrieving revision 1.3
diff -u -p -r1.3 patch-drivers_unix_os_unix_cpp
--- patches/patch-drivers_unix_os_unix_cpp 25 Aug 2018 19:20:29 -0000 1.3
+++ patches/patch-drivers_unix_os_unix_cpp 5 Aug 2019 16:56:19 -0000
@@ -5,7 +5,7 @@ $OpenBSD: patch-drivers_unix_os_unix_cpp
 Index: drivers/unix/os_unix.cpp
 --- drivers/unix/os_unix.cpp.orig
 +++ drivers/unix/os_unix.cpp
-@@ -462,7 +462,7 @@ String OS_Unix::get_executable_path() const {
+@@ -518,7 +518,7 @@ String OS_Unix::get_executable_path() const {
  #elif defined(__OpenBSD__)
  char resolved_path[MAXPATHLEN];
 
Index: patches/patch-main_main_cpp
===================================================================
RCS file: /cvs/ports/games/godot/patches/patch-main_main_cpp,v
retrieving revision 1.1
diff -u -p -r1.1 patch-main_main_cpp
--- patches/patch-main_main_cpp 25 Aug 2018 19:20:29 -0000 1.1
+++ patches/patch-main_main_cpp 5 Aug 2019 16:56:19 -0000
@@ -5,8 +5,8 @@ log on falling back to dummy audio drive
 Index: main/main.cpp
 --- main/main.cpp.orig
 +++ main/main.cpp
-@@ -938,6 +938,10 @@ Error Main::setup(const char *execpath, int argc, char
- audio_driver = GLOBAL_DEF("audio/driver", OS::get_singleton()->get_audio_driver_name(0));
+@@ -976,6 +976,10 @@ Error Main::setup(const char *execpath, int argc, char
+ audio_driver = GLOBAL_DEF_RST("audio/driver", OS::get_singleton()->get_audio_driver_name(0));
  }
 
 + if (audio_driver == "Dummy") {
Index: patches/patch-platform_x11_detect_py
===================================================================
RCS file: /cvs/ports/games/godot/patches/patch-platform_x11_detect_py,v
retrieving revision 1.1
diff -u -p -r1.1 patch-platform_x11_detect_py
--- patches/patch-platform_x11_detect_py 25 Aug 2018 19:20:29 -0000 1.1
+++ patches/patch-platform_x11_detect_py 5 Aug 2019 16:56:19 -0000
@@ -5,12 +5,15 @@ remove hardcoded -O2, found by bcallah@
 Index: platform/x11/detect.py
 --- platform/x11/detect.py.orig
 +++ platform/x11/detect.py
-@@ -84,7 +84,7 @@ def configure(env):
-             env.Prepend(CCFLAGS=['-g2'])
+@@ -97,9 +97,9 @@ def configure(env):
 
      elif (env["target"] == "release_debug"):
--        env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
-+        env.Prepend(CCFLAGS=['-ffast-math', '-DDEBUG_ENABLED'])
+         if (env["optimize"] == "speed"): #optimize for speed (default)
+-            env.Prepend(CCFLAGS=['-O2', '-DDEBUG_ENABLED'])
++            env.Prepend(CCFLAGS=['-DDEBUG_ENABLED'])
+         else: #optimize for size
+-            env.Prepend(CCFLAGS=['-Os', '-DDEBUG_ENABLED'])
++            env.Prepend(CCFLAGS=['-DDEBUG_ENABLED'])
+
          if (env["debug_symbols"] == "yes"):
              env.Prepend(CCFLAGS=['-g1'])
-         if (env["debug_symbols"] == "full"):
Index: patches/patch-platform_x11_os_x11_cpp
===================================================================
RCS file: /cvs/ports/games/godot/patches/patch-platform_x11_os_x11_cpp,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-platform_x11_os_x11_cpp
--- patches/patch-platform_x11_os_x11_cpp 27 Apr 2018 07:32:53 -0000 1.1.1.1
+++ patches/patch-platform_x11_os_x11_cpp 5 Aug 2019 16:56:19 -0000
@@ -5,7 +5,7 @@ fix libXrandr library name
 Index: platform/x11/os_x11.cpp
 --- platform/x11/os_x11.cpp.orig
 +++ platform/x11/os_x11.cpp
-@@ -160,7 +160,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, i
+@@ -157,7 +157,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, i
  int xrandr_minor = 0;
  int event_base, error_base;
  xrandr_ext_ok = XRRQueryExtension(x11_display, &event_base, &error_base);
Index: patches/patch-servers_audio_server_cpp
===================================================================
RCS file: patches/patch-servers_audio_server_cpp
diff -N patches/patch-servers_audio_server_cpp
--- patches/patch-servers_audio_server_cpp 25 Aug 2018 19:20:29 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,46 +0,0 @@
-$OpenBSD: patch-servers_audio_server_cpp,v 1.1 2018/08/25 19:20:29 thfr Exp $
-
-add dummy audio driver to AudioDriverManager list
-(github issue #20986)
-
-Index: servers/audio_server.cpp
---- servers/audio_server.cpp.orig
-+++ servers/audio_server.cpp
-@@ -119,14 +119,19 @@ AudioDriver::AudioDriver() {
- _mix_amount = 0;
- }
-
--AudioDriver *AudioDriverManager::drivers[MAX_DRIVERS];
--int AudioDriverManager::driver_count = 0;
- AudioDriverDummy AudioDriverManager::dummy_driver;
-+AudioDriver *AudioDriverManager::drivers[MAX_DRIVERS] = {
-+ &AudioDriverManager::dummy_driver,
-+};
-+int AudioDriverManager::driver_count = 1;
-
- void AudioDriverManager::add_driver(AudioDriver *p_driver) {
-
- ERR_FAIL_COND(driver_count >= MAX_DRIVERS);
-- drivers[driver_count++] = p_driver;
-+ drivers[driver_count - 1] = p_driver;
-+
-+ // Last driver is always our dummy driver
-+ drivers[driver_count++] = &AudioDriverManager::dummy_driver;
- }
-
- int AudioDriverManager::get_driver_count() {
-@@ -158,14 +163,6 @@ void AudioDriverManager::initialize(int p_driver) {
- drivers[i]->set_singleton();
- return;
- }
-- }
--
-- // Fallback to our dummy driver
-- if (dummy_driver.init() == OK) {
-- ERR_PRINT("AudioDriverManager: all drivers failed, falling back to dummy driver");
-- dummy_driver.set_singleton();
-- } else {
-- ERR_PRINT("AudioDriverManager: dummy driver failed to init()");
- }
- }
-
Index: patches/patch-servers_visual_shader_language_cpp
===================================================================
RCS file: patches/patch-servers_visual_shader_language_cpp
diff -N patches/patch-servers_visual_shader_language_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-servers_visual_shader_language_cpp 5 Aug 2019 16:56:19 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Fix error with ports-gcc:
+  error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive]
+
+Index: servers/visual/shader_language.cpp
+--- servers/visual/shader_language.cpp.orig
++++ servers/visual/shader_language.cpp
+@@ -2046,11 +2046,11 @@ const ShaderLanguage::BuiltinFuncOutArgs ShaderLanguag
+
+ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type) {
+
+- ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, NULL);
++ ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, false);
+
+ Vector<DataType> args;
+
+- ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, NULL);
++ ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, false);
+
+ StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();
+
Index: patches/patch-servers_visual_shader_language_cpp.orig
===================================================================
RCS file: patches/patch-servers_visual_shader_language_cpp.orig
diff -N patches/patch-servers_visual_shader_language_cpp.orig
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-servers_visual_shader_language_cpp.orig 5 Aug 2019 16:56:19 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Fix error with ports-gcc:
+  error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive]
+
+Index: servers/visual/shader_language.cpp
+--- servers/visual/shader_language.cpp.orig
++++ servers/visual/shader_language.cpp
+@@ -1869,11 +1869,11 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::b
+
+ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type) {
+
+- ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, NULL);
++ ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, false);
+
+ Vector<DataType> args;
+
+- ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, NULL);
++ ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, false);
+
+ StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();
+
Index: patches/patch-thirdparty_minizip_crypt_h
===================================================================
RCS file: patches/patch-thirdparty_minizip_crypt_h
diff -N patches/patch-thirdparty_minizip_crypt_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-thirdparty_minizip_crypt_h 5 Aug 2019 16:56:19 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+fix missing type z_crc_t; gleaned from
+https://github.com/ZipArchive/ZipArchive/issues/360
+
+Index: thirdparty/minizip/crypt.h
+--- thirdparty/minizip/crypt.h.orig
++++ thirdparty/minizip/crypt.h
+@@ -27,6 +27,8 @@
+    Encryption is not supported.
+ */
+
++typedef unsigned long z_crc_t;
++
+ #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
+
+ /***********************************************************************
Index: patches/patch-thirdparty_minizip_zip_c
===================================================================
RCS file: patches/patch-thirdparty_minizip_zip_c
diff -N patches/patch-thirdparty_minizip_zip_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-thirdparty_minizip_zip_c 5 Aug 2019 16:56:19 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+fix missing type z_crc_t; gleaned from
+https://github.com/ZipArchive/ZipArchive/issues/360
+
+Index: thirdparty/minizip/zip.c
+--- thirdparty/minizip/zip.c.orig
++++ thirdparty/minizip/zip.c
+@@ -21,6 +21,7 @@
+
+ */
+
++typedef unsigned long z_crc_t;
+
+ #include <stdio.h>
+ #include <stdlib.h>

Reply | Threaded
Open this post in threaded view
|

Re: [macppc, sparc64] games/godot won't build there

Jeremie Courreges-Anglas-2
On Mon, Aug 05 2019, Thomas Frohwein <[hidden email]> wrote:

> On Mon, Aug 05, 2019 at 12:05:05PM +0200, Jeremie Courreges-Anglas wrote:
> [...]
>> Here's a diff with proper comments which I deem desirable.  Charlene,
>> Thomas, others: ok?
>
> I'd like to combine this with the update to the latest release (3.1.1)
> as previously proposed [1]. This update also does away with the
> thirdparty module that included nvcore.h, so that patch isn't needed
> anymore.
>
> The combined diff is below. I did a build and runtime test on amd64
> and didn't notice any issues.
>
> ok for combined diff?

I tend to prefer separating fixes and updates because it makes cvs log
clearer. Please do whatever you prefer, but I'm not volunteering to test
godot updates.

Your diff includes this hunk, which I find weird (.orig filename).

> Index: patches/patch-servers_visual_shader_language_cpp.orig
> ===================================================================
> RCS file: patches/patch-servers_visual_shader_language_cpp.orig
> diff -N patches/patch-servers_visual_shader_language_cpp.orig
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-servers_visual_shader_language_cpp.orig 5 Aug 2019 16:56:19 -0000
> @@ -0,0 +1,22 @@
> +$OpenBSD$
> +
> +Fix error with ports-gcc:
> +  error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive]
> +
> +Index: servers/visual/shader_language.cpp
> +--- servers/visual/shader_language.cpp.orig
> ++++ servers/visual/shader_language.cpp
> +@@ -1869,11 +1869,11 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::b
> +
> + bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type) {
> +
> +- ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, NULL);
> ++ ERR_FAIL_COND_V(p_func->op != OP_CALL && p_func->op != OP_CONSTRUCT, false);
> +
> + Vector<DataType> args;
> +
> +- ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, NULL);
> ++ ERR_FAIL_COND_V(p_func->arguments[0]->type != Node::TYPE_VARIABLE, false);
> +
> + StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();
> +

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: [macppc, sparc64] games/godot won't build there

Charlene Wendling
Hi,

On Sun, 11 Aug 2019 21:13:11 +0200
Jeremie Courreges-Anglas wrote:

> On Mon, Aug 05 2019, Thomas Frohwein <[hidden email]> wrote:
> > On Mon, Aug 05, 2019 at 12:05:05PM +0200, Jeremie Courreges-Anglas
> > wrote: [...]
> >> Here's a diff with proper comments which I deem desirable.
> >> Charlene, Thomas, others: ok?
> >
> > I'd like to combine this with the update to the latest release
> > (3.1.1) as previously proposed [1]. This update also does away with
> > the thirdparty module that included nvcore.h, so that patch isn't
> > needed anymore.
> >
> > The combined diff is below. I did a build and runtime test on amd64
> > and didn't notice any issues.
> >
> > ok for combined diff?
>
> I tend to prefer separating fixes and updates because it makes cvs log
> clearer. Please do whatever you prefer, but I'm not volunteering to
> test godot updates.

I've tried the update on amd64, and it looks good to me, excepted the
the extra .orig patch. I've tried several demos without issues.

On macppc, i did the slightly intrusive conversion to __atomic_*
successfully. It builds but doesn't link due to relocation errors - i'm
working on it, but it's a long build at each try.

So i can't 100% confirm how godot does with ports-gcc at the moment.

I've no objection to see the update and (still needed btw) ports-gcc
fixes committed, i'll provide a hppa/powerpc patch later.

Charlène.