View Issue Details

IDProjectCategoryView StatusLast Update
0000216Cinelerra-GG[All Projects] Featurepublic2019-05-14 13:19
ReporterAndrew-R Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000216: Support for PowerPC (BE and LE variants)
DescriptionBack in February Daniel Reurich started thread about compiling Cinelerra-GG on ppc64le (power8/power9 platform).
https://lists.cinelerra-gg.org/pipermail/cin/2019-February/000351.html

I only have emulated machines of this type, via qemu (3.1+, 4.0+). I did few hacks back in time, but none of my builds resulted in working Cin - on ppc64le it was lack of ALL icons and crashes, on ppc32 BE (without altivec) Cin just failed to start GUI at all - crashes again ....

BCSignals _compilation_ issue was fixed in https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=commit;h=3932d2c16e903573db3cacdb3102dea9639c6ca4, but other issues probably not ....
Steps To ReproduceSee https://lists.cinelerra-gg.org/pipermail/cin/2019-February/000361.html for qemu command lines for ppc64le machine.

See https://lists.cinelerra-gg.org/pipermail/cin/2019-March/000408.html for emulated X5000 machine (ppc64 BE but run in 32-bit mode, no altivec ... so, I force-disabled altivec in ffmpeg/x264/x265 as they were represented in thirdparty dir)

May be ppc emulation was not completely correct ..some ppc fixes still not landed in qemu git, so I wait ...

https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg01253.html and down this thread ....
TagsNo tags attached.

Activities

Andrew-R

Andrew-R

2019-05-14 13:19

reporter   ~0001523

Two little patches I did right now (not even compile tested)
One should hackfix configure so it will not add x86-specific .a archive from thirdparty/mjpegtools for non-x86 arches
Second should limit futex usage in libzmpeg3 to x86 or x86_64

libmmxsse_isolation_configure_ac.diff (1,408 bytes)
diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac
index 90048a2..5948fba 100644
--- a/cinelerra-5.1/configure.ac
+++ b/cinelerra-5.1/configure.ac
@@ -321,10 +321,17 @@ PKG_3RD([libvorbis],[auto],
     lib/.libs/libvorbisfile.a ],
   [ include . ])
 
+## arch dep tests
+ARCH=[`uname -m`]
+I86=[`expr "x$ARCH" : 'xi[346]86.*'`]
+X86=[`expr "x$ARCH" : 'x..._64*'`]
+
+if test "x$I86$X86" != "x00" ; then
+
 PKG_3RD([mjpegtools],[yes],
   [mjpegtools-2.1.0],
-  [ utils/mmxsse/.libs/libmmxsse.a \
-    utils/.libs/libmjpegutils.a \
+   [ utils/.libs/libmjpegutils.a \
+    utils/mmxsse/.libs/libmmxsse.a \
     lavtools/.libs/liblavfile.a \
     lavtools/.libs/liblavjpeg.a \
     mplex/.libs/libmplex2.a \
@@ -332,6 +339,21 @@ PKG_3RD([mjpegtools],[yes],
     mpeg2enc/.libs/libmpeg2encpp.a ],
   [ .  lavtools utils ])
 
+else
+
+
+PKG_3RD([mjpegtools],[yes],
+  [mjpegtools-2.1.0],
+    [ utils/.libs/libmjpegutils.a \
+    lavtools/.libs/liblavfile.a \
+    lavtools/.libs/liblavjpeg.a \
+    mplex/.libs/libmplex2.a \
+    yuvfilters/.libs/libyuvfilters.a \
+    mpeg2enc/.libs/libmpeg2encpp.a ],
+  [ .  lavtools utils ])
+
+fi
+
 PKG_3RD([openexr],[auto],
   [openexr-2.2.1],
   [ IlmImf/.libs/libIlmImf.a \
@@ -369,7 +391,7 @@ PKG_3RD([x265],[auto],
   [ libx265.a ],
   [ . source ])
 
-PKG_3RD([libvpx],[auto],
+PKG_3RD([libvpx],[yes],
   [libvpx-1.8.0],
   [ libvpx.a ],
   [ . ])
no_futex_in_libzmpeg3_on_nonx86.diff (404 bytes)
diff --git a/cinelerra-5.1/libzmpeg3/libzmpeg3.h b/cinelerra-5.1/libzmpeg3/libzmpeg3.h
index 430ebb4..9bd02e6 100644
--- a/cinelerra-5.1/libzmpeg3/libzmpeg3.h
+++ b/cinelerra-5.1/libzmpeg3/libzmpeg3.h
@@ -5,7 +5,9 @@
 /* for quicktime build */
 #define MAXFRAMESAMPLES 65536
 #define ZDVB
+#if __x86_64__ || __i386__
 #define USE_FUTEX
+#endif
 
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS
Andrew-R

Andrew-R

2019-05-14 08:18

reporter  

.ash_history (10,727 bytes)
ppc64le_incomplete_2.diff (5,119 bytes)
diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile
index c1f97f1..a0424de 100644
--- a/cinelerra-5.1/cinelerra/Makefile
+++ b/cinelerra-5.1/cinelerra/Makefile
@@ -389,7 +389,7 @@ ifneq ($(WANT_CIN_3RDPARTY),no)
 LIBS += $(libraries)
 else
 
-LIBS += -lpthread -lm -lbz2 -llzma -lz -lpng -luuid
+LIBS += -lpthread -lm -lbz2 -llzma -lz -lpng -luuid -lbexecinfo -lintl
 LIBS += -lX11 -lXau -lXdmcp -lXext -lXfixes -lXv -lXinerama
 LIBS += -lfontconfig -lfreetype
 LIBS += -lavcodec -lavdevice -lavfilter -lavformat -lavresample -lavutil
@@ -447,7 +447,7 @@ ifneq ($(WANT_NUMA),no)
 LIBS += -lnuma
 endif
 ifneq ($(WANT_LV2),no)
-LIBS += -llilv-0 -lsratom-0 -lserd-0 -lsord-0 -lsuil-0
+LIBS += -llilv-0 -lsratom-0 -lserd-0 -lsord-0 -lsuil-0 -lexecinfo
 endif
 endif
 
diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile
index 15442cf..e35495b 100644
--- a/cinelerra-5.1/guicast/Makefile
+++ b/cinelerra-5.1/guicast/Makefile
@@ -12,6 +12,12 @@ ifeq ($(OBJDIR), amd64)
 BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B i386 -I binary -O elf64-x86-64\""
 endif
 
+ifeq ($(OBJDIR), ppc64le)
+BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B powerpc -I binary -O elf64-powerpcle\""
+endif
+
+
+
 $(shell mkdir -p $(OBJDIR) )
 
 OBJS = \
diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C
index ed50cfb..8442847 100644
--- a/cinelerra-5.1/guicast/bcsignals.C
+++ b/cinelerra-5.1/guicast/bcsignals.C
@@ -389,6 +389,9 @@ const char* BC_Signals::sig_to_str(int number)
 #if __x86_64__
 #define IP rip
 #endif
+#if __powerpc64__
+#define IP nip
+#endif
 #ifndef IP
 #error gotta have IP
 #endif
@@ -404,13 +407,14 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
 // it is not necessary to be root if ptrace is allowed via:
 // echo 0 > /proc/sys/kernel/yama/ptrace_scope (usually set to 1)
 //	if( uid != 0 ) return;
+
 	ucontext_t *uc = (ucontext_t *)sc;
 	int pid = getpid(), tid = gettid();
 	struct sigcontext *c = (struct sigcontext *)&uc->uc_mcontext;
-	uint8_t *ip = (uint8_t *)c->IP;
-	fprintf(stderr,"** %s at %p in pid %d, tid %d\n",
-		n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap",
-		(void*)ip, pid, tid);
+//	uint8_t *ip = (uint8_t *)c->IP;
+//	fprintf(stderr,"** %s at %p in pid %d, tid %d\n",
+//		n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap",
+//		(void*)ip, pid, tid);
 	FILE *fp = 0;
 	char fn[PATH_MAX];
 	if( BC_Signals::trap_path ) {
@@ -419,9 +423,9 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
 	}
 	if( fp ) {
 		fprintf(stderr,"writing debug data to %s\n", fn);
-		fprintf(fp,"** %s at %p in pid %d, tid %d\n",
-			n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap",
-			(void*)c->IP, pid, tid);
+//		fprintf(fp,"** %s at %p in pid %d, tid %d\n",
+//			n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap",
+//			(void*)c->IP, pid, tid);
 	}
 	else {
 		strcpy(fn, "stdout");
@@ -458,13 +462,13 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
 	int pfd = open(proc_mem,O_RDONLY);
 	if( pfd >= 0 ) {
 		fprintf(fp,"\nCODE:\n");
-		for( int i=-32; i<32; ) {
-			uint8_t v;  void *vp = (void *)(ip + i);
-			if( !(i & 7) ) fprintf(fp,"%p:  ", vp);
-			if( pread(pfd,&v,sizeof(v),(off_t)vp) != sizeof(v) ) break;
-			fprintf(fp,"%c%02x", !i ? '>' : ' ', v);
-			if( !(++i & 7) ) fprintf(fp,"\n");
-		}
+//		for( int i=-32; i<32; ) {
+//			uint8_t v;  void *vp = (void *)(ip + i);
+//			if( !(i & 7) ) fprintf(fp,"%p:  ", vp);
+//			if( pread(pfd,&v,sizeof(v),(off_t)vp) != sizeof(v) ) break;
+//			fprintf(fp,"%c%02x", !i ? '>' : ' ', v);
+//			if( !(++i & 7) ) fprintf(fp,"\n");
+//		}
 		fprintf(fp,"\n");
 		close(pfd);
 	}
@@ -494,5 +498,6 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
 	}
         char *const argv[4] = { (char*) "/bin/sh", (char*) "-c", cmd, 0 };
         execvp(argv[0], &argv[0]);
+
 }
 
diff --git a/cinelerra-5.1/libzmpeg3/Makefile b/cinelerra-5.1/libzmpeg3/Makefile
index b256c73..712fd29 100644
--- a/cinelerra-5.1/libzmpeg3/Makefile
+++ b/cinelerra-5.1/libzmpeg3/Makefile
@@ -4,8 +4,10 @@ include $(TOPDIR)/global_config
 ifneq ($(WANT_LIBZMPEG),no)
 
 CC = gcc
-NASM = nasm
-USE_MMX ?= 0
+#NASM = nasm
+#USE_MMX ?= 0
+USE_MMX = 0
+
 DYNAMIC_FONTS ?= 1
 
 ifeq ($(OBJDIR), alpha)
@@ -120,10 +122,10 @@ clean:
 
 $(OBJS): 
 	$(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.C) -o $*.o
-$(ASMOBJS): 
-	$(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.S) -o $*.o
-$(NASMOBJS): 
-	$(NASM) -f elf $(subst $(OBJDIR)/,, $*.s) -o $*.o
+#$(ASMOBJS): 
+#	$(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.S) -o $*.o
+#$(NASMOBJS): 
+#	$(NASM) -f elf $(subst $(OBJDIR)/,, $*.s) -o $*.o
 
 $(OBJDIR)/%.o:		%.C
 $(OBJDIR)/audio/%.o:	audio/%.C
diff --git a/cinelerra-5.1/libzmpeg3/libzmpeg3.h b/cinelerra-5.1/libzmpeg3/libzmpeg3.h
index 430ebb4..9e93753 100644
--- a/cinelerra-5.1/libzmpeg3/libzmpeg3.h
+++ b/cinelerra-5.1/libzmpeg3/libzmpeg3.h
@@ -5,7 +5,7 @@
 /* for quicktime build */
 #define MAXFRAMESAMPLES 65536
 #define ZDVB
-#define USE_FUTEX
+/* #define USE_FUTEX */
 
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS
ppc_X5000_prelim.diff (6,481 bytes)
diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile
index dfdfd23..e497aec 100644
--- a/cinelerra-5.1/cinelerra/Makefile
+++ b/cinelerra-5.1/cinelerra/Makefile
@@ -389,7 +389,7 @@ ifneq ($(WANT_CIN_3RDPARTY),no)
 LIBS += $(libraries)
 else
 
-LIBS += -lpthread -lm -lbz2 -llzma -lz -lpng -luuid
+LIBS += -lpthread -lm -lbz2 -llzma -lz -lpng -luuid -lbexecinfo -lintl
 LIBS += -lX11 -lXau -lXdmcp -lXext -lXfixes -lXv -lXinerama
 LIBS += -lfontconfig -lfreetype
 LIBS += -lavcodec -lavdevice -lavfilter -lavformat -lavresample -lavutil
@@ -447,7 +447,7 @@ ifneq ($(WANT_NUMA),no)
 LIBS += -lnuma
 endif
 ifneq ($(WANT_LV2),no)
-LIBS += -llilv-0 -lsratom-0 -lserd-0 -lsord-0 -lsuil-0
+LIBS += -llilv-0 -lsratom-0 -lserd-0 -lsord-0 -lsuil-0 -lexecinfo
 endif
 endif
 
diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile
index 201c5a4..53148a5 100644
--- a/cinelerra-5.1/guicast/Makefile
+++ b/cinelerra-5.1/guicast/Makefile
@@ -12,6 +12,21 @@ ifeq ($(OBJDIR), amd64)
 BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B i386 -I binary -O elf64-x86-64\""
 endif
 
+ifeq ($(OBJDIR), ppc64le)
+BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B powerpc -I binary -O elf64-powerpcle\""
+endif
+
+ifeq ($(OBJDIR), ppc)
+BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B powerpc -I binary -O elf32-powerpc\""
+endif
+
+ifeq ($(OBJDIR), ppc64)
+BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B powerpc -I binary -O elf64-powerpc\""
+endif
+
+
+
+
 $(shell mkdir -p $(OBJDIR) )
 
 OBJS = \
diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C
index ed50cfb..f8da11d 100644
--- a/cinelerra-5.1/guicast/bcsignals.C
+++ b/cinelerra-5.1/guicast/bcsignals.C
@@ -389,6 +389,9 @@ const char* BC_Signals::sig_to_str(int number)
 #if __x86_64__
 #define IP rip
 #endif
+#if __powerpc64__ || __powerpc__
+#define IP nip
+#endif
 #ifndef IP
 #error gotta have IP
 #endif
@@ -404,13 +407,14 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
 // it is not necessary to be root if ptrace is allowed via:
 // echo 0 > /proc/sys/kernel/yama/ptrace_scope (usually set to 1)
 //	if( uid != 0 ) return;
+
 	ucontext_t *uc = (ucontext_t *)sc;
 	int pid = getpid(), tid = gettid();
 	struct sigcontext *c = (struct sigcontext *)&uc->uc_mcontext;
-	uint8_t *ip = (uint8_t *)c->IP;
-	fprintf(stderr,"** %s at %p in pid %d, tid %d\n",
-		n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap",
-		(void*)ip, pid, tid);
+//	uint8_t *ip = (uint8_t *)c->IP;
+//	fprintf(stderr,"** %s at %p in pid %d, tid %d\n",
+//		n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap",
+//		(void*)ip, pid, tid);
 	FILE *fp = 0;
 	char fn[PATH_MAX];
 	if( BC_Signals::trap_path ) {
@@ -419,9 +423,9 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
 	}
 	if( fp ) {
 		fprintf(stderr,"writing debug data to %s\n", fn);
-		fprintf(fp,"** %s at %p in pid %d, tid %d\n",
-			n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap",
-			(void*)c->IP, pid, tid);
+//		fprintf(fp,"** %s at %p in pid %d, tid %d\n",
+//			n==SIGSEGV? "segv" : n==SIGINT? "intr" : "trap",
+//			(void*)c->IP, pid, tid);
 	}
 	else {
 		strcpy(fn, "stdout");
@@ -458,13 +462,13 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
 	int pfd = open(proc_mem,O_RDONLY);
 	if( pfd >= 0 ) {
 		fprintf(fp,"\nCODE:\n");
-		for( int i=-32; i<32; ) {
-			uint8_t v;  void *vp = (void *)(ip + i);
-			if( !(i & 7) ) fprintf(fp,"%p:  ", vp);
-			if( pread(pfd,&v,sizeof(v),(off_t)vp) != sizeof(v) ) break;
-			fprintf(fp,"%c%02x", !i ? '>' : ' ', v);
-			if( !(++i & 7) ) fprintf(fp,"\n");
-		}
+//		for( int i=-32; i<32; ) {
+//			uint8_t v;  void *vp = (void *)(ip + i);
+//			if( !(i & 7) ) fprintf(fp,"%p:  ", vp);
+//			if( pread(pfd,&v,sizeof(v),(off_t)vp) != sizeof(v) ) break;
+//			fprintf(fp,"%c%02x", !i ? '>' : ' ', v);
+//			if( !(++i & 7) ) fprintf(fp,"\n");
+//		}
 		fprintf(fp,"\n");
 		close(pfd);
 	}
@@ -494,5 +498,6 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
 	}
         char *const argv[4] = { (char*) "/bin/sh", (char*) "-c", cmd, 0 };
         execvp(argv[0], &argv[0]);
+
 }
 
diff --git a/cinelerra-5.1/libzmpeg3/Makefile b/cinelerra-5.1/libzmpeg3/Makefile
index b256c73..712fd29 100644
--- a/cinelerra-5.1/libzmpeg3/Makefile
+++ b/cinelerra-5.1/libzmpeg3/Makefile
@@ -4,8 +4,10 @@ include $(TOPDIR)/global_config
 ifneq ($(WANT_LIBZMPEG),no)
 
 CC = gcc
-NASM = nasm
-USE_MMX ?= 0
+#NASM = nasm
+#USE_MMX ?= 0
+USE_MMX = 0
+
 DYNAMIC_FONTS ?= 1
 
 ifeq ($(OBJDIR), alpha)
@@ -120,10 +122,10 @@ clean:
 
 $(OBJS): 
 	$(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.C) -o $*.o
-$(ASMOBJS): 
-	$(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.S) -o $*.o
-$(NASMOBJS): 
-	$(NASM) -f elf $(subst $(OBJDIR)/,, $*.s) -o $*.o
+#$(ASMOBJS): 
+#	$(CC) -c `cat $(OBJDIR)/c_flags` $(subst $(OBJDIR)/,, $*.S) -o $*.o
+#$(NASMOBJS): 
+#	$(NASM) -f elf $(subst $(OBJDIR)/,, $*.s) -o $*.o
 
 $(OBJDIR)/%.o:		%.C
 $(OBJDIR)/audio/%.o:	audio/%.C
diff --git a/cinelerra-5.1/libzmpeg3/libzmpeg3.h b/cinelerra-5.1/libzmpeg3/libzmpeg3.h
index 430ebb4..9e93753 100644
--- a/cinelerra-5.1/libzmpeg3/libzmpeg3.h
+++ b/cinelerra-5.1/libzmpeg3/libzmpeg3.h
@@ -5,7 +5,7 @@
 /* for quicktime build */
 #define MAXFRAMESAMPLES 65536
 #define ZDVB
-#define USE_FUTEX
+/* #define USE_FUTEX */
 
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS
diff --git a/cinelerra-5.1/thirdparty/Makefile b/cinelerra-5.1/thirdparty/Makefile
index 4fae862..84593fd 100644
--- a/cinelerra-5.1/thirdparty/Makefile
+++ b/cinelerra-5.1/thirdparty/Makefile
@@ -109,7 +109,7 @@ esound.mak_vars+= CFLAGS=""
 esound.ldflags=" -lm -lstdc++"
 fftw.cfg_params= --disable-fortran --enable-shared=no
 ffmpeg.cfg_params= \
-	--enable-pthreads --enable-gpl \
+	--enable-pthreads --disable-altivec --enable-gpl \
 	--disable-ffplay --disable-vaapi \
 	$(call if_pkg,twolame,--enable-libtwolame) \
 	$(call if_pkg,openjpeg,--enable-libopenjpeg) \
@@ -215,9 +215,9 @@ openexr.cfg_params?=--enable-shared=no --with-ilmbase-prefix=$(call bld_path,ilm
 speech_tools.mak_params?=-j1
 tiff.cfg_params+= --enable-shared=no --disable-zstd
 twolame.cfg_params?=--enable-shared=no
-x264.cfg_params?= --enable-static --enable-pic
+x264.cfg_params?= --enable-static --enable-pic --disable-asm
 x265.cfg_vars?=$(call cmake_config,source)
-x265.cfg_params?= -DENABLE_SHARED=no
+x265.cfg_params?= -DENABLE_SHARED=no -DENABLE_ALTIVEC=off -DCPU_POWER8=off
 libvpx.cfg_params?= --enable-pic
 
 DS:=$$$$$$$$
ppc_X5000_prelim.diff (6,481 bytes)

Issue History

Date Modified Username Field Change
2019-05-14 08:18 Andrew-R New Issue
2019-05-14 08:18 Andrew-R File Added: .ash_history
2019-05-14 08:18 Andrew-R File Added: ppc64le_incomplete_2.diff
2019-05-14 08:18 Andrew-R File Added: ppc_X5000_prelim.diff
2019-05-14 13:19 Andrew-R File Added: libmmxsse_isolation_configure_ac.diff
2019-05-14 13:19 Andrew-R File Added: no_futex_in_libzmpeg3_on_nonx86.diff
2019-05-14 13:19 Andrew-R Note Added: 0001523