[Cin] Actually compiled CinGG for e2k machine

Andrew Randrianasulu randrianasulu at gmail.com
Tue Apr 14 17:55:42 CEST 2020


Well, this was interesting experience .....

I got remote shell on Elbrus machine, and of course tried to compile CinGG there

./configure --with-single-user --with-booby --disable-openExr \
--disable-libavc1394 --disable-libiec61883 --disable-libtheora --without-ladspa \
--disable-tiff --without-openexr --disable-x264 --disable-dav1d --without-ladspa \
--without-dv --without-firewire --without-nv --without-commercial

with this command line it started to compile .. and run  into few problems :}

Even if I disabled commercials detection via configure some files leaked in 
and confused compiler.

So, I just #ifdef __i386__  whole thing out of my way:

it diff cinelerra/
diff --git a/cinelerra-5.1/cinelerra/commercials.h b/cinelerra-5.1/cinelerra/commercials.h
index b7b815c..01f4c27 100644
--- a/cinelerra-5.1/cinelerra/commercials.h
+++ b/cinelerra-5.1/cinelerra/commercials.h
@@ -1,3 +1,4 @@
+#ifdef __i386__
 #ifndef _COMMERCIALS_H_
 #define _COMMERCIALS_H_

@@ -202,3 +203,4 @@ public:


 #endif
+#endif /* i386 */
\ No newline at end of file
diff --git a/cinelerra-5.1/cinelerra/dbwindow.h b/cinelerra-5.1/cinelerra/dbwindow.h
index 24a40df..983c65b 100644
--- a/cinelerra-5.1/cinelerra/dbwindow.h
+++ b/cinelerra-5.1/cinelerra/dbwindow.h
@@ -1,3 +1,4 @@
+#ifdef __i386__
 #ifndef _DBWINDOW_H_
 #define _DBWINDOW_H_

@@ -296,3 +297,4 @@ public:


 #endif
+#endif /* i386 */
\ No newline at end of file
diff --git a/cinelerra-5.1/cinelerra/mediadb.h b/cinelerra-5.1/cinelerra/mediadb.h
index 9bb970e..eb39340 100644
--- a/cinelerra-5.1/cinelerra/mediadb.h
+++ b/cinelerra-5.1/cinelerra/mediadb.h
@@ -1,3 +1,4 @@
+#ifdef __i386__
 #ifndef _MEDIA_DB_H_
 #define _MEDIA_DB_H_

@@ -239,3 +240,4 @@ public:
 };

 #endif
+#endif /* i386 */
\ No newline at end of file
diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C
index 8c0dd6c..cdc0325 100644
--- a/cinelerra-5.1/cinelerra/mwindow.C
+++ b/cinelerra-5.1/cinelerra/mwindow.C
@@ -282,7 +282,9 @@ MWindow::~MWindow()
        delete render;          render = 0;
        delete mixers_align;    mixers_align = 0;
        commit_commercial();
+#ifdef HAVE_COMMERCIALS
        if( commercials && !commercials->remove_user() ) commercials = 0;
+#endif
        close_mixers();
        if( speed_edl ) { speed_edl->remove_user();  speed_edl = 0; }
 // Save defaults for open plugins


git diff db/
diff --git a/cinelerra-5.1/db/tdb.h b/cinelerra-5.1/db/tdb.h
index 8ee8800..b337b90 100644
--- a/cinelerra-5.1/db/tdb.h
+++ b/cinelerra-5.1/db/tdb.h
@@ -1,3 +1,5 @@
+#ifdef __i386__
+
 #ifndef __DB_H__
 #define __DB_H__
 #include <cstring>
@@ -1514,3 +1516,5 @@ public:
 };

 #endif
+
+#endif /* i386 */
\ No newline at end of file

Probably not best idea (shouldn't those headers use same #ifdef HAVE_COMMERCIALS
as I did in mwindow.C ?) but so far it worked...

git diff guicast/
diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile
index 04bc87a..be47e0b 100644
--- a/cinelerra-5.1/guicast/Makefile
+++ b/cinelerra-5.1/guicast/Makefile
@@ -12,6 +12,11 @@ ifeq ($(OBJDIR), amd64)
 BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B i386 -I binary -O elf64-x86-64\""
 endif

+ifeq ($(OBJDIR), e2k)
+BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B e2k -I binary -O elf64-e2k\""
+endif
+
+

this basically added objcopy line for theme pngs, if I understand correctly.

Should I also add my old ppc lines here?

--
this is most hacky part ... I just disabled all this nice  signal/crash reporting, but no crashes so far :}


diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C
index ffc8a1c..71b69b9 100644
--- a/cinelerra-5.1/guicast/bcsignals.C
+++ b/cinelerra-5.1/guicast/bcsignals.C
@@ -471,15 +471,16 @@ static void reg_dump(FILE *fp,sigregs_t *rp)
 static void reg_dump(FILE *fp,sigregs_t *rp) {}
 #endif

-#ifndef IP
-#error gotta have IP
-#endif
+//#ifndef IP
+//#error gotta have IP
+//#endif

 // HAVE_CTX
 #endif

 static void handle_dump(int n, siginfo_t * info, void *sc)
 {
+#if 0
        uncatch_segv();  uncatch_intr();
        signal(SIGSEGV, SIG_DFL);
        signal(SIGINT, SIG_DFL);
@@ -586,5 +587,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]);
 #endif
+#endif
 }

---

git diff libzmpeg3/
diff --git a/cinelerra-5.1/libzmpeg3/libzmpeg3.h b/cinelerra-5.1/libzmpeg3/libzmpeg3.h
index 430ebb4..9ebee66 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

and finally I disabled USE_FUTEX in libzmpeg (probably should be true
for all non-x86 arches)

Now, I have two patches, but they touch different unrelated files, sadly ... and in-between
there was some build environment confusion, so I added and removed few things

Both attached, but ... there was also more work in x264/mjpegtools/lame, basically if-0 ing SSE parts
I have no idea how to easily diff those ..... probably move to someplace, clean, and compare
to unpacked fresh directories ...

Some libs from thirdparty again failed to autoconf themselves
due to unknown architecture, but this was fixed by copying
machine's automake dir (/usr/share/automake-1.14/*) to each 
library subfolder and autoreconf'ing them with --force --install.

No idea how to automate this step.

E2k_incomplete-2.diff contains unrelated html changes, and 
E2k_incomplete.diff has some  -lcrystalhd stuff before I killed it
from ffmpeg:

diff --git a/cinelerra-5.1/thirdparty/Makefile b/cinelerra-5.1/thirdparty/Makefile
index 0be2898..0017fc4 100644
--- a/cinelerra-5.1/thirdparty/Makefile
+++ b/cinelerra-5.1/thirdparty/Makefile
@@ -130,19 +130,19 @@ esound.mak_vars+= CFLAGS=""
 esound.ldflags=" -lm -lstdc++"
 fftw.cfg_params= --disable-fortran --enable-shared=no
 ffmpeg.cfg_params= \
-       --enable-pthreads --enable-gpl --disable-ffplay \
+       --enable-pthreads --disable-crystalhd --enable-gpl --disable-ffplay \
        $(call if_want,VAAPI,--enable-vaapi,--disable-vaapi) \
        $(call if_want,VDPAU,--enable-vdpau,--disable-vdpau) \
        $(call if_want,NV, --enable-nvenc --enable-nvdec --enable-ffnvcodec) \
        $(call if_ena,twolame,--enable-libtwolame) \
        $(call if_ena,openjpeg,--enable-libopenjpeg) \
-       $(call if_ena,lame,--enable-libmp3lame) \
+       $(call if_ena,lame,--disable-libmp3lame) \
        $(call if_ena,libaom,--enable-libaom) \
        $(call if_ena,dav1d,--enable-libdav1d) \
        $(call if_ena,libwebp,--enable-libwebp) \
        $(call if_ena,opus,--enable-libopus) \
        $(call if_ena,libvorbis,--enable-libvorbis) \
-       $(call if_ena,libtheora,--enable-libtheora) \
+       $(call if_ena,libtheora,--disable-libtheora) \
        $(call if_ena,libvpx,--enable-libvpx) \
        $(call if_ena,x264,--enable-libx264) \
        $(call if_ena,x265,--enable-libx265) \
@@ -208,7 +208,7 @@ libwebp.cfg_vars?= mkdir build && cd build && $(call cmake_config,..)
 libwebp.mak_params?= -C build all install DESTDIR=$(call bld_path,libwebp)
 mjpegtools.cflags?="$(call inc_path,libjpeg) $(call ld_path,libjpeg,build)"
 mjpegtools.cfg_vars?= ./autogen.sh; 
-mjpegtools.cfg_params?= --enable-shared=no --without-libquicktime --without-libdv \
+mjpegtools.cfg_params?= --enable-shared=no --disable-simd-accel --without-libquicktime --without-libdv \
  --without-libpng --without-dga --without-gtk --without-libsdl --without-sdlgfx
 mjpegtools.mak_params?= all
 ladspa.cfg_vars?= CFLAGS+=' -Dinline="" '
@@ -249,7 +249,7 @@ tiff.cfg_params+= --enable-shared=no --disable-zstd $(call if_pkg,libwebp,\
  --with-webp-lib-dir=$(call pkg_libs,libwebp))\
  $(call if_npkg,libwebp,--disable-webp)
 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
 libvpx.cfg_params?= --enable-pic

---

Resulted binary works remotely, even if slowly.

There was problem with livevideo plugin , it wanted libdv anyway, 
just deleted it for now

Machine is LE (little-endian), so BE problems not really visible on it
I asked my host to try this locally, hopefully some video will be shown there, too.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: E2k_incomplete-2.diff
Type: text/x-diff
Size: 11404 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20200414/fcdffe13/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: E2k_incomplete.diff
Type: text/x-diff
Size: 7144 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20200414/fcdffe13/attachment-0003.bin>


More information about the Cin mailing list