Merge branch 'boxedwine' into 'master'

Update Boxedwine from upstream

See merge request redox-os/redox!2183
This commit is contained in:
Wildan Mubarok 2026-06-07 14:34:56 +00:00
commit be1a3ed027
2 changed files with 202 additions and 73 deletions

View File

@ -1,88 +1,30 @@
#TODO runtime crash
[source]
git = "https://github.com/jackpot51/Boxedwine"
git = "https://github.com/danoon2/Boxedwine"
rev = "7328e70"
shallow_clone = true
patches = [
"redox.patch"
]
[build]
template = "custom"
dependencies = [
"curl",
"liborbital",
"mesa",
"mesa-glu",
"nghttp2",
"minizip-ng",
"openssl3",
"sdl2",
"zlib",
]
dev-dependencies = [
"mesa-glu",
]
script = """
DYNAMIC_INIT
cd "${COOKBOOK_SOURCE}/project/linux"
#TODO: USE MAKEFILE
#TODO: USE X64 CPU CORE
${TARGET}-gcc -std=c++17 -O2 \
-Wall \
-Wno-delete-incomplete \
-Wno-unused-result \
-Wno-unknown-pragmas \
-Wno-unused-local-typedefs \
-Wno-unused-variable \
-Wno-unused-function \
-Wno-unused-but-set-variable \
-I "${COOKBOOK_SYSROOT}/include/SDL2" \
-I../../include \
-I../../lib/glew/include \
-I../../lib/imgui \
../../lib/imgui/imgui.cpp \
../../lib/pugixml/src/*.cpp \
../../lib/imgui/imgui_draw.cpp \
../../lib/imgui/imgui_widgets.cpp \
../../lib/imgui/examples/imgui_impl_opengl2.cpp \
../../lib/imgui/examples/imgui_impl_sdl.cpp \
../../lib/imgui/addon/imguitinyfiledialogs.cpp \
../../source/sdl/*.cpp \
../../source/sdl/singleThreaded/*.cpp \
../../lib/glew/src/glew.cpp \
../../source/ui/*.cpp \
../../source/ui/controls/*.cpp \
../../source/ui/data/*.cpp \
../../source/ui/opengl/*.cpp \
../../source/ui/utils/*.cpp \
../../platform/sdl/*.cpp \
../../platform/linux/*.cpp \
../../source/emulation/cpu/*.cpp \
../../source/emulation/cpu/common/*.cpp \
../../source/emulation/cpu/normal/*.cpp \
../../source/emulation/softmmu/*.cpp \
../../source/io/*.cpp \
../../source/kernel/*.cpp \
../../source/kernel/devs/*.cpp \
../../source/kernel/proc/*.cpp \
../../source/kernel/sys/*.cpp \
../../source/kernel/loader/*.cpp \
../../source/util/*.cpp \
../../source/opengl/sdl/*.cpp \
../../source/opengl/*.cpp \
../../lib/tiny-process/process.cpp \
../../lib/tiny-process/process_unix.cpp \
../../lib/zlib/contrib/minizip/ioapi.c \
../../lib/zlib/contrib/minizip/mztools.c \
../../lib/zlib/contrib/minizip/unzip.c \
../../lib/zlib/contrib/minizip/zip.c \
`${PKG_CONFIG} libcurl --cflags --libs` \
`${PKG_CONFIG} sdl2 --cflags --libs` \
-lz \
-lstdc++ \
"-DGLH=<SDL_opengl.h>" \
-DBOXEDWINE_64 \
-DBOXEDWINE_HAS_SETJMP \
-DBOXEDWINE_OPENGL_IMGUI_V2 \
-DBOXEDWINE_OPENGL_SDL \
-DBOXEDWINE_POSIX \
-DBOXEDWINE_ZLIB \
-DGLEW_OSMESA \
-DSDL2=1 \
-DSIMDE_SSE2_NO_NATIVE \
-o "${COOKBOOK_BUILD}/boxedwine"
export CPPFLAGS+=" -DUSE_FILE32API=1 -DBOXEDWINE_64=1 -D_GNU_SOURCE=1 -DGLEW_OSMESA=1 -DBOXEDWINE_ES=1"
rsync -a "${COOKBOOK_SOURCE}/" ./
cd "./project/linux"
make release
mkdir -p "${COOKBOOK_STAGE}/usr/bin"
cp -v "${COOKBOOK_BUILD}/boxedwine" "${COOKBOOK_STAGE}/usr/bin/boxedwine"
cp -v "./Build/Release/boxedwine" "${COOKBOOK_STAGE}/usr/bin/boxedwine"
"""

View File

@ -0,0 +1,187 @@
diff --git a/include/platformBoxedwine.h b/include/platformBoxedwine.h
index b7a798d..6ab00a3 100644
--- a/include/platformBoxedwine.h
+++ b/include/platformBoxedwine.h
@@ -30,7 +30,7 @@
#include "platformtypes.h"
#define FD S32
-#ifdef __APPLE__
+#if defined(USE_FILE32API)
#define lseek64 lseek
#endif
diff --git a/lib/asmjit/asmjit/core/api-build_p.h b/lib/asmjit/asmjit/core/api-build_p.h
index 2de68d2..d0b5688 100644
--- a/lib/asmjit/asmjit/core/api-build_p.h
+++ b/lib/asmjit/asmjit/core/api-build_p.h
@@ -40,7 +40,8 @@
defined(__DragonFly__) || \
defined(__FreeBSD__ ) || \
defined(__NetBSD__ ) || \
- defined(__OpenBSD__ )
+ defined(__OpenBSD__ ) || \
+ defined(__redox__ )
#define ASMJIT_FILE64_API(NAME) NAME
#else
#define ASMJIT_FILE64_API(NAME) NAME##64
diff --git a/lib/glew/src/glew.cpp b/lib/glew/src/glew.cpp
index d19534c..994db49 100644
--- a/lib/glew/src/glew.cpp
+++ b/lib/glew/src/glew.cpp
@@ -38,6 +38,7 @@
#if defined(GLEW_OSMESA)
# define GLAPI extern
+# define APIENTRY
# include <GL/osmesa.h>
#elif defined(GLEW_EGL)
# include <GL/eglew.h>
diff --git a/lib/simde/simde/simde-math.h b/lib/simde/simde/simde-math.h
index d18bf4f..ebecd1c 100644
--- a/lib/simde/simde/simde-math.h
+++ b/lib/simde/simde/simde-math.h
@@ -1285,9 +1285,7 @@ simde_math_fpclass(double v, const int imm8) {
#endif
#if !defined(simde_math_roundevenf)
- #if \
- ((!defined(HEDLEY_EMSCRIPTEN_VERSION) || HEDLEY_EMSCRIPTEN_VERSION_CHECK(3, 1, 43)) && HEDLEY_HAS_BUILTIN(__builtin_roundevenf)) || \
- HEDLEY_GCC_VERSION_CHECK(10,0,0)
+ #if 0
#define simde_math_roundevenf(v) __builtin_roundevenf(v)
#elif defined(simde_math_roundf) && defined(simde_math_fabsf)
static HEDLEY_INLINE
diff --git a/project/linux/makefile b/project/linux/makefile
index c27766c..ad656a9 100644
--- a/project/linux/makefile
+++ b/project/linux/makefile
@@ -4,8 +4,9 @@ ifndef BUILD_DIR
default all: release
-uname_m := $(shell uname -m)
-uname_n := $(shell uname -n)
+TARGET ?=
+uname_m := $(firstword $(TARGET))
+uname_n := $(word 3, $(TARGET))
$(info uname -m is $(uname_m))
ifeq ($(uname_m), armv7l)
export GCC_EXTRA_FLAGS := -fno-tree-vectorize
@@ -34,7 +35,7 @@ export MAKEFLAGS := -j $(cpus)
$(info MAKEFLAGS is $(MAKEFLAGS))
endif
release test:
- @$(MAKE)
+ $(MAKE)
clean:
$(RM) -r Build
@@ -53,7 +54,7 @@ SOURCES += $(wildcard $(PROJDIR)/lib/pugixml/src/*.cpp)
SOURCES += $(PROJDIR)/lib/glew/src/glew.cpp
SOURCES += $(PROJDIR)/lib/imgui/addon/imguitinyfiledialogs.cpp
SOURCES += $(PROJDIR)/lib/imgui/examples/imgui_impl_sdl.cpp
-SOURCES += $(PROJDIR)/lib/imgui/examples/imgui_impl_opengl2.cpp
+SOURCES += $(PROJDIR)/lib/imgui/examples/imgui_impl_opengl3.cpp
SOURCES += $(PROJDIR)/lib/imgui/imgui_widgets.cpp
SOURCES += $(PROJDIR)/lib/imgui/imgui_draw.cpp
SOURCES += $(PROJDIR)/lib/imgui/imgui.cpp
@@ -95,32 +96,34 @@ DEPS := $(ALL:.o=.d)
$(OBJS): INCLUDES := -I../../lib/asmjit -I../../include -I../../lib/glew/include -I../../lib/imgui -I../../lib/simde -I../../lib/pugixml/src
$(SOFT_OBJS): INCLUDES := -I../../lib/softfloat/source/include -I../../lib/softfloat/source -I../../lib/softfloat/source/8086-SSE
-SDL_CFLAGS = $(shell sdl2-config --cflags)
-SDL_LIBS = $(shell sdl2-config --libs)
-CPPFLAGS ?= -std=c++20 -O2 $(EXTRA_CPP_FLAGS) $(GCC_EXTRA_FLAGS) -Werror=switch -Wall -Wno-invalid-offsetof -Wno-delete-incomplete -Wno-unused-result -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable $(INCLUDES) -DBOXEDWINE_RECORDER -DBOXEDWINE_ZLIB -DBOXEDWINE_HAS_SETJMP -DSDL2=1 "-DGLH=<SDL_opengl.h>" -DBOXEDWINE_OPENGL_SDL -DSIMDE_SSE2_NO_NATIVE -DBOXEDWINE_POSIX -DBOXEDWINE_OPENGL_IMGUI_V2 $(SDL_CFLAGS)
-CFLAGS ?= -O2 $(INCLUDES)
-LDFLAGS = -L./linux_build/lib -lcurl -lssl -lcrypto -lpthread -lm -lz -lminizip -lGL -lstdc++ -lstdc++fs $(SDL_LIBS)
+PKG_CONFIG ?= pkg-config
+SDL_CFLAGS = $(shell $(PKG_CONFIG) --cflags sdl2)
+SDL_LIBS = $(shell $(PKG_CONFIG) --libs sdl2)
+CPPFLAGS ?=
+LDFLAGS ?=
+CPPFLAGS := $(CPPFLAGS) -O2 $(EXTRA_CPP_FLAGS) $(GCC_EXTRA_FLAGS) -Werror=switch -Wall -Wno-unused-result -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -DBOXEDWINE_RECORDER -DBOXEDWINE_ZLIB -DBOXEDWINE_HAS_SETJMP -DSDL2=1 "-DGLH=<SDL_opengl.h>" -DSIMDE_SSE2_NO_NATIVE -DBOXEDWINE_POSIX -DIMGUI_IMPL_OPENGL_ES3 $(SDL_CFLAGS)
+LDFLAGS := $(LDFLAGS) -L./linux_build/lib -lcurl -lssl -lcrypto -lpthread -lm -lz -lminizip -lstdc++ -lOSMesa -lGLESv2 $(SDL_LIBS)
#$(TEST_BUILD_DIR)/boxedwineTest: $(TEST_OBJS)
# $(CC) $(TEST_OBJS) -o $@ $(LDFLAGS)
$(BUILD_DIR)/$(TARGET_EXEC): $(ALL)
- @$(CC) $(ALL) -o $@ $(LDFLAGS)
+ $(CC) $(ALL) -o $@ $(LDFLAGS)
# assembly
$(BUILD_DIR)/%.s.o: %.s
- @$(MKDIR_P) $(dir $@)
- @$(AS) $(ASFLAGS) -c $< -o $@
+ $(MKDIR_P) $(dir $@)
+ $(AS) $(ASFLAGS) -c $< -o $@
# c source
$(BUILD_DIR)/%.c.o: %.c
- @$(MKDIR_P) $(dir $@)
- @$(CC) $(CFLAGS) -c $< -o $@
+ $(MKDIR_P) $(dir $@)
+ $(CC) $(CPPFLAGS) $(INCLUDES) -c $< -o $@
# c++ source
$(BUILD_DIR)/%.cpp.o: %.cpp
- @$(MKDIR_P) $(dir $@)
- @$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MP -c $< -o $@
+ $(MKDIR_P) $(dir $@)
+ $(CXX) $(CPPFLAGS) -std=c++20 -Wno-invalid-offsetof -Wno-delete-incomplete $(INCLUDES) -MMD -MP -c $< -o $@
.PHONY: clean
diff --git a/source/io/fs.h b/source/io/fs.h
index eb60eb6..49227ff 100644
--- a/source/io/fs.h
+++ b/source/io/fs.h
@@ -41,8 +41,6 @@
#define K_O_CLOEXEC 0x080000
#define K_O_TMPFILE 0x400000
-#define FD_CLOEXEC 1
-
#define K_F_SEAL_SEAL 0x01
#define K_F_SEAL_SHRINK 0x02
#define K_F_SEAL_GROW 0x04
diff --git a/source/kernel/knativesocket.cpp b/source/kernel/knativesocket.cpp
index 4f6a435..5b9ec44 100644
--- a/source/kernel/knativesocket.cpp
+++ b/source/kernel/knativesocket.cpp
@@ -33,6 +33,7 @@ static int winsock_intialized;
#pragma comment(lib, "Ws2_32.lib")
#undef min
#else
+#include <sys/select.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -524,10 +525,10 @@ struct ifconf {
};
*/
#define K_IFNAMSIZ 16
-
U32 KNativeSocketObject::ioctl(KThread* thread, U32 request) {
CPU* cpu = thread->cpu;
if (request == 0x541b) {
+/*
#ifdef WIN32
u_long value=0;
U32 result = ioctlsocket(this->nativeSocket, FIONREAD, &value);
@@ -718,12 +719,13 @@ U32 KNativeSocketObject::ioctl(KThread* thread, U32 request) {
thread->memory->writew(address + K_IFNAMSIZ, ifr.ifr_mtu);
return 0;
#endif
+*/
+ kwarn_fmt("KNativeSocketObject::ioctl request=%x commented out", request);
} else {
kwarn_fmt("KNativeSocketObject::ioctl request=%x not implemented", request);
}
return -K_ENOTTY;
}
-
S64 KNativeSocketObject::seek(S64 pos) {
return -K_ESPIPE;
}