git: purgatorio

Download patch

ref: 4a1fc5ccb596a0f88f465b81a638f0068e82f0b9
parent: a8083462e62459b2ae8a243dc4ba88416eba03b1
author: grobe0ba <grobe0ba@tcp80.org>
date: Sat Jan 25 19:07:26 EST 2025

minor changes for debian 12 (by dboddie)

--- a/emu/Linux/os.c
+++ b/emu/Linux/os.c
@@ -18,6 +18,9 @@
 
 #include	<raise.h>
 
+/* For dynamic linking init/fini code that needs malloc */
+void (*coherence)(void) = nofence;
+
 /* glibc 2.3.3-NTPL messes up getpid() by trying to cache the result, so we'll do it ourselves */
 #include	<sys/syscall.h>
 #define	getpid()	syscall(SYS_getpid)
--- a/emu/port/kproc-pthreads.c
+++ b/emu/port/kproc-pthreads.c
@@ -17,6 +17,7 @@
 #define pthread_yield() (sched_yield())
 #define PTHREAD_STACK_MIN ((size_t)sysconf(_SC_THREAD_STACK_MIN))
 #endif
+#define pthread_yield() (sched_yield())
 
 
 typedef struct Osdep Osdep;
--- a/mkfiles/mkfile-Linux-386
+++ b/mkfiles/mkfile-Linux-386
@@ -13,13 +13,15 @@
 
 CC=		cc -c -m32
 CFLAGS=		-g\
-		-O\
+		-O0\
 		-fno-strict-aliasing\
 		-fno-aggressive-loop-optimizations\
 		-Wuninitialized -Wunused-variable -Wreturn-type -Wimplicit\
 		-I$ROOT/Linux/386/include\
 		-I$ROOT/include\
-		-DLINUX_386
+		-DLINUX_386\
+		-fcommon\
+		-D_GNU_SOURCE
 
 ANSICPP=
 LD=		cc -m32
--- a/utils/libmach/vcodas.c
+++ b/utils/libmach/vcodas.c
@@ -274,7 +274,7 @@
 	"c.ngt.%f",	mipscofpc,
 };
 
-static char fsub[16] = {
+static char _fsub[16] = {
 	's', 'd', 'e', 'q', 'w', '?', '?', '?',
 	'?', '?', '?', '?', '?', '?', '?', '?'
 };
@@ -387,7 +387,7 @@
 			break;
 
 		case 'f':
-			*i->curr++ = fsub[i->rs & 0x0F];
+			*i->curr++ = _fsub[i->rs & 0x0F];
 			break;
 
 		case '\0':
--- a/utils/libmach/vdb.c
+++ b/utils/libmach/vdb.c
@@ -754,7 +754,7 @@
 	"TagLo", "TagHi", "ErrorEPC", "31"
 };
 
-static char fsub[16] = {
+static char _fsub[16] = {
 	'F', 'D', 'e', 'q', 'W', '?', '?', '?',
 	'?', '?', '?', '?', '?', '?', '?', '?'
 };
@@ -837,7 +837,7 @@
 			break;
 
 		case 'f':
-			*i->curr++ = fsub[i->rs & 0x0F];
+			*i->curr++ = _fsub[i->rs & 0x0F];
 			break;
 
 		case 'C':
--