git: purgatorio

Download patch

ref: 4e1b511d026220c7f5dbe4f62d114bef418cdcf9
parent: 15dd600cbd3c242fc1fe283dacc390a823055bc4
parent: 11cf56ca795f3db5191ad457732c77f918618dd3
author: henesy <henesy.dev@gmail.com>
date: Wed Sep 3 20:37:19 EDT 2025

Merge https://git.sr.ht/~grobe0ba/purgatorio into front

--- /dev/null
+++ b/Jenkinsfile
@@ -1,0 +1,30 @@
+pipeline {
+	agent {
+		kubernetes {
+				cloud 'sm0'
+				inheritFrom 'Debian'
+				namespace 'jenkins'
+			}
+		}
+
+
+	stages {
+		stage('Build') {
+			steps {
+				sh 'dpkg --add-architecture i386'
+				sh 'apt update'
+				sh 'apt upgrade -y'
+				sh 'apt install -y gcc-multilib libx11-6:i386 libxext6:i386 libx11-dev:i386 libxext-dev:i386'
+				sh 'sed -i -e "s@^ROOT=.*@ROOT=$(readlink -f .)@" mkconfig'
+				sh './makemk.sh'
+				sh 'env PATH="$(readlink -f Linux/386/bin):${PATH}" mk mkdirs'
+				sh 'env PATH="$(readlink -f Linux/386/bin):${PATH}" mk nuke'
+				sh 'env PATH="$(readlink -f Linux/386/bin):${PATH}" mk install'
+				sh 'git log -n1 --pretty=%H > BUILD-COMMIT'
+				sh 'mkdir -p /tmp && tar zcf /tmp/purgatorio.tar.gz --exclude .git .'
+				sh 'mv /tmp/purgatorio.tar.gz .'
+				archiveArtifacts artifacts: 'purgatorio.tar.gz', fingerprint: true
+			}
+		}
+	}
+}
--- 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':
--