CMAKE_INSTALL:=1
PKG_BUILD_DEPENDS:=gzdoom/host vulkan-loader
+PKG_BUILD_FLAGS:=no-mips16
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
-DVULKAN_USE_XLIB=OFF \
-DVULKAN_USE_WAYLAND=ON
+TARGET_LDFLAGS += -latomic
+
define Package/gzdoom
SECTION:=games
CATEGORY:=Games
TITLE:=GZDoom
URL:=https://zdoom.org/
- DEPENDS:=+alsa-lib +glib2 +libbz2 +libstdcpp +libzmusic +libvpx +libsdl2 +USE_MUSL:musl-fts
+ DEPENDS:=+alsa-lib +glib2 +libatomic +libbz2 +libstdcpp +libzmusic +libvpx +libsdl2 +USE_MUSL:musl-fts @(ARCH_64BIT||BROKEN)
endef
define Package/gzdoom/description
+++ /dev/null
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -291,6 +291,7 @@ else()
- if ( NOT HAVE_FTS )
- include ( FindPkgConfig )
- pkg_check_modules( MUSL_FTS musl-fts )
-+ string(REPLACE ";" " " MUSL_FTS_LDFLAGS "${MUSL_FTS_LDFLAGS}")
- if ( MUSL_FTS_FOUND )
- set ( ALL_C_FLAGS "${ALL_C_FLAGS} ${MUSL_FTS_LDFLAGS}" )
- else ( MUSL_FTS_FOUND )
+++ /dev/null
-From https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/35711#note_243863
-_GNU_SOURCE is needed for cpu_set_t, and affinity disable is needed to work around lack of pthread_attr_setaffinity_np
---- a/libraries/lzma/CMakeLists.txt
-+++ b/libraries/lzma/CMakeLists.txt
-@@ -1,6 +1,6 @@
- make_release_only()
-
--set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DZ7_PPMD_SUPPORT" )
-+set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE -DZ7_PPMD_SUPPORT -DZ7_AFFINITY_DISABLE" )
-
- find_package(Threads)
-
--- /dev/null
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -291,6 +291,7 @@ else()
+ if ( NOT HAVE_FTS )
+ include ( FindPkgConfig )
+ pkg_check_modules( MUSL_FTS musl-fts )
++ string(REPLACE ";" " " MUSL_FTS_LDFLAGS "${MUSL_FTS_LDFLAGS}")
+ if ( MUSL_FTS_FOUND )
+ set ( ALL_C_FLAGS "${ALL_C_FLAGS} ${MUSL_FTS_LDFLAGS}" )
+ else ( MUSL_FTS_FOUND )
--- /dev/null
+From https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/35711#note_243863
+_GNU_SOURCE is needed for cpu_set_t, and affinity disable is needed to work around lack of pthread_attr_setaffinity_np
+--- a/libraries/lzma/CMakeLists.txt
++++ b/libraries/lzma/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ make_release_only()
+
+-set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DZ7_PPMD_SUPPORT" )
++set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE -DZ7_PPMD_SUPPORT -DZ7_AFFINITY_DISABLE" )
+
+ find_package(Threads)
+
--- /dev/null
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -358,7 +358,7 @@ if( HAVE_VM_JIT AND UNIX )
+ if( HAVE_LIBEXECINFO )
+ set( ALL_C_FLAGS "${ALL_C_FLAGS} -lexecinfo" )
+ else( HAVE_LIBEXECINFO )
+- set( HAVE_VM_JIT NO )
++ # set( HAVE_VM_JIT NO )
+ endif( HAVE_LIBEXECINFO )
+ set( CMAKE_REQUIRED_FLAGS )
+ endif( NOT HAVE_BACKTRACE )
+--- a/src/common/scripting/jit/jit_runtime.cpp
++++ b/src/common/scripting/jit/jit_runtime.cpp
+@@ -7,7 +7,6 @@
+ #include <DbgHelp.h>
+ #include <psapi.h>
+ #else
+-#include <execinfo.h>
+ #include <cxxabi.h>
+ #include <cstring>
+ #include <cstdlib>
+@@ -806,7 +805,7 @@ static int CaptureStackTrace(int max_fra
+ // JIT isn't supported here, so just do nothing.
+ return 0;//return RtlCaptureStackBackTrace(0, min(max_frames, 32), out_frames, nullptr);
+ #else
+- return backtrace(out_frames, max_frames);
++ return 0;
+ #endif
+ }
+
+@@ -868,7 +867,9 @@ class NativeSymbolResolver
+ public:
+ FString GetName(void *frame)
+ {
+- FString s;
++ FString s = "no backtrace";
++ return s;
++ #if 0
+ char **strings;
+ void *frames[1] = { frame };
+ strings = backtrace_symbols(frames, 1);
+@@ -925,6 +926,7 @@ public:
+
+ free(strings);
+ return s;
++ #endif
+ }
+ };
+ #endif
--- /dev/null
+--- a/src/common/platform/posix/sdl/sdlglvideo.cpp
++++ b/src/common/platform/posix/sdl/sdlglvideo.cpp
+@@ -400,7 +400,7 @@ DFrameBuffer *SDLVideo::CreateFrameBuffe
+ builder.RequireExtension(names[i]);
+ auto instance = builder.Create();
+
+- VkSurfaceKHR surfacehandle = nullptr;
++ VkSurfaceKHR surfacehandle = (VkSurfaceKHR)nullptr;
+ if (!I_CreateVulkanSurface(instance->Instance, &surfacehandle))
+ VulkanError("I_CreateVulkanSurface failed");
+
--- /dev/null
+--- a/src/common/engine/i_interface.cpp
++++ b/src/common/engine/i_interface.cpp
+@@ -6,13 +6,13 @@
+ #include "gstrings.h"
+ #include "version.h"
+
+-static_assert(sizeof(void*) == 8,
+- "Only LP64/LLP64 builds are officially supported. "
+- "Please do not attempt to build for other platforms; "
+- "even if the program succeeds in a MAP01 smoke test, "
+- "there are e.g. known visual artifacts "
+- "<https://forum.zdoom.org/viewtopic.php?f=7&t=75673> "
+- "that lead to a bad user experience.");
++//static_assert(sizeof(void*) == 8,
++// "Only LP64/LLP64 builds are officially supported. "
++// "Please do not attempt to build for other platforms; "
++// "even if the program succeeds in a MAP01 smoke test, "
++// "there are e.g. known visual artifacts "
++// "<https://forum.zdoom.org/viewtopic.php?f=7&t=75673> "
++// "that lead to a bad user experience.");
+
+ // Some global engine variables taken out of the backend code.
+ FStartupScreen* StartWindow;
+++ /dev/null
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -358,7 +358,7 @@ if( HAVE_VM_JIT AND UNIX )
- if( HAVE_LIBEXECINFO )
- set( ALL_C_FLAGS "${ALL_C_FLAGS} -lexecinfo" )
- else( HAVE_LIBEXECINFO )
-- set( HAVE_VM_JIT NO )
-+ # set( HAVE_VM_JIT NO )
- endif( HAVE_LIBEXECINFO )
- set( CMAKE_REQUIRED_FLAGS )
- endif( NOT HAVE_BACKTRACE )
---- a/src/common/scripting/jit/jit_runtime.cpp
-+++ b/src/common/scripting/jit/jit_runtime.cpp
-@@ -7,7 +7,6 @@
- #include <DbgHelp.h>
- #include <psapi.h>
- #else
--#include <execinfo.h>
- #include <cxxabi.h>
- #include <cstring>
- #include <cstdlib>
-@@ -806,7 +805,7 @@ static int CaptureStackTrace(int max_fra
- // JIT isn't supported here, so just do nothing.
- return 0;//return RtlCaptureStackBackTrace(0, min(max_frames, 32), out_frames, nullptr);
- #else
-- return backtrace(out_frames, max_frames);
-+ return 0;
- #endif
- }
-
-@@ -868,7 +867,9 @@ class NativeSymbolResolver
- public:
- FString GetName(void *frame)
- {
-- FString s;
-+ FString s = "no backtrace";
-+ return s;
-+ #if 0
- char **strings;
- void *frames[1] = { frame };
- strings = backtrace_symbols(frames, 1);
-@@ -925,6 +926,7 @@ public:
-
- free(strings);
- return s;
-+ #endif
- }
- };
- #endif