[Cin]Fwd: Sparc32 "support" for cinelerra-gg

Andrew Randrianasulu via Cin <[email protected]> Mon, 22 Dec 2025 02:04:07 +0300
Newsgroups gmane.comp.video.cinelerra-cv.general,gmane.os.netbsd.ports.sparc,gmane.os.netbsd.ports.macppc
Message-ID <CA+rFky6CooyruDhjNtN=R2rbw6zNbahzWBGfkV=T=mrRJ9TUDA@mail.gmail.com>
---------- Forwarded message ---------
От: Andrew Randrianasulu <[email protected]>
Date: пт, 19 дек. 2025 г., 19:36
Subject: Sparc32 "support"
To: Cinelerra.GG <[email protected]>, Phyllis Smith <
[email protected]>


Not really, but it compiled to completion, and shwed startup messages
and died in GL library call (inside GL library, mesa) :)

So, trying to rebuild on netBSD/sparc with opengl disabled

Not even diffs, just bootstrap.c and Makefile from guicast folder.


===

Attached are git diffs against our git at

https://git.cinelerra-gg.org/goodguy/cinelerra.git

git commit 17fa80d7d099013c4ae4c8fb4ba5e5f359bfad31

please test them on "normal" targets like x86/arm.
I only tested that cinelerra-gg builds in dynamic configuration on
aarch64/termux and starts normally there, displaying  small ogg/theora file.

For NetBSD there is script in blds that should build cingg if you manually
install needed packages (see Linux build files for names of deps, or
pkgsrc-wip/cingg-netbsd . Need to update it and in particular  PLIST there
for newer files added recently ...)

====


Need more ram on compile machine, 256 M too small with 32 Mb of swap
for affine.c :)

_______________________________________________
Cin mailing list -- [email protected]
To unsubscribe send an email to [email protected]
0002-Add-sparc32-tested-and-sparc32-on-64-cases-to-guicas.patch (application/x-patch, 894 B)
From 238018dff142eabc35e2e7d03f8ee2875a07c03b Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Mon, 22 Dec 2025 01:45:10 +0300
Subject: [PATCH 2/2] Add sparc32 (tested) and sparc32-on-64 cases to
 guicast/Makefile

---
 cinelerra-5.1/guicast/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile
index 67116252..e3ba8c31 100644
--- a/cinelerra-5.1/guicast/Makefile
+++ b/cinelerra-5.1/guicast/Makefile
@@ -36,6 +36,13 @@ ifeq ($(OBJDIR), ppc)
 BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B powerpc -I binary -O elf32-powerpc\""
 endif
 
+ifeq ($(OBJDIR), sparc)
+BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B sparc -I binary -O elf32-sparc\""
+endif
+
+ifeq ($(OBJDIR), sparc64)
+BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B sparc -I binary -O elf32-sparc64\""
+endif
 
 
 
-- 
2.52.0
0001-Unaligned-access-in-bootstrap.c.patch (application/x-patch, 996 B)
From 61977cb4690915dda6a9e4dd6a9f22f065d74e8f Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Fri, 19 Dec 2025 08:41:29 +0300
Subject: [PATCH 1/2] Unaligned access in bootstrap.c ?

---
 cinelerra-5.1/guicast/bootstrap.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/cinelerra-5.1/guicast/bootstrap.c b/cinelerra-5.1/guicast/bootstrap.c
index 0ba35514..6a8b4894 100644
--- a/cinelerra-5.1/guicast/bootstrap.c
+++ b/cinelerra-5.1/guicast/bootstrap.c
@@ -53,8 +53,17 @@ void append_contents(char *path,
 	strcpy(buffer + *buffer_size, string);
 
 	*buffer_size += strlen(string) + 1;
-
-	*(int*)(buffer + *buffer_size) = data_offset;
+	
+	
+	int tmp = 0;
+	char *ptr = buffer+*buffer_size;
+	memcpy(&tmp, &ptr, sizeof(int));
+	tmp = data_offset;
+	ptr[3] = tmp >> 24;
+	ptr[2] = tmp >> 16;
+	ptr[1] = tmp >> 8;
+	ptr[0] = tmp;
+	//*(int*)(buffer + *buffer_size) = data_offset;
 	*buffer_size += sizeof(int);
 }
 
-- 
2.52.0