From: Jeremie Courreges-Anglas Subject: Fix emulators/dosbox-x build on riscv64 To: uaa@openbsd.org Cc: ports@openbsd.org Date: Fri, 19 Apr 2024 17:52:16 +0200 Hi, Upstream wants to use glibc features but doesn't actually try to detect it in a way that doesn't affect other platforms. This may fix other architectures, not just riscv64. amd64, i386, armv7 and arm64 are not affected because there dosbox.h doesn't define HAS_LONG_DOUBLE. ok? Index: Makefile =================================================================== RCS file: /cvs/ports/emulators/dosbox-x/Makefile,v diff -u -p -r1.3 Makefile --- Makefile 28 Mar 2024 10:26:04 -0000 1.3 +++ Makefile 19 Apr 2024 15:41:09 -0000 @@ -4,6 +4,7 @@ VERSION= 2024.03.01 DISTNAME= dosbox-x-v${VERSION} PKGNAME= dosbox-x-${VERSION} CATEGORIES= games x11 emulators +REVISION= 0 GH_ACCOUNT= joncampbell123 GH_PROJECT= dosbox-x Index: patches/patch-src_fpu_fpu_instructions_longdouble_h =================================================================== RCS file: patches/patch-src_fpu_fpu_instructions_longdouble_h diff -N patches/patch-src_fpu_fpu_instructions_longdouble_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_fpu_fpu_instructions_longdouble_h 4 Mar 2024 08:53:15 -0000 @@ -0,0 +1,29 @@ +Index: src/fpu/fpu_instructions_longdouble.h +--- src/fpu/fpu_instructions_longdouble.h.orig ++++ src/fpu/fpu_instructions_longdouble.h +@@ -16,17 +16,21 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +-#include /* for isinf, etc */ ++/* for isinf, etc. glibc math.h includes features.h which in turn ++ * defines __GLIBC__ (needed below). ++ */ ++#include ++ + #include "cpu/lazyflags.h" + + #ifdef __GNUC__ + # if defined(__MINGW32__) || (defined(MACOSX) && !defined(__arm64__)) + # include "fpu_control_x86.h" +-# elif defined(ANDROID) || defined(__ANDROID__) || (defined(MACOSX) && defined(__arm64__)) || defined(EMSCRIPTEN) || defined(__powerpc__) ++# elif defined(__GLIBC__) ++# include ++# else + /* ? */ + # define _FPU_SETCW(x) /* dummy */ +-# else +-# include + # endif + static inline void FPU_SyncCW(void) { + uint16_t tmp = fpu.cw | 0x80 | 0x3F; // HACK: Disable all FPU exceptions until DOSBox-X can catch and reflect FPU exceptions to the guest -- jca