Tiny Core Linux

General TC => General TC Talk => Topic started by: ryios on October 19, 2015, 11:31:07 PM

Title: TC 6+ and Mono
Post by: ryios on October 19, 2015, 11:31:07 PM
Has anyone managed to get Mono To build on 6+ CorePlus?  Looking at the repo doesn't look like Mono has been uploaded since TC 3.x.

I'm prospecting server environments for the processing os for a custom camera system (Remote Controlled Machine) but whatever OS I pick has to be able to support Mono for .Net 4+, including libgdiplus.

I tried building it myself, but I'm pretty new to linux so it was daunting... I got as far as running autogen.sh on libgdiplus then getting a bunch of errors about LIBTOOL not being defined.

Title: Re: TC 6+ and Mono
Post by: Rich on October 20, 2015, 12:45:26 AM
Hi ryios
Maybe you need to install  libtool,tcz  and possibly  libtool-dev.tcz.
Title: Re: TC 6+ and Mono
Post by: Juanito on October 20, 2015, 01:22:59 AM
It changes from app to app, but most probably automake, libtool-dev, intltool and gettext-dev.
Title: Re: TC 6+ and Mono
Post by: Juanito on October 20, 2015, 05:01:20 AM
..but the libgdiplus-3.12 source has a configure script, so you don't need autogen.sh anyway?
Title: Re: TC 6+ and Mono
Post by: ryios on October 20, 2015, 06:57:26 PM
..but the libgdiplus-3.12 source has a configure script, so you don't need autogen.sh anyway?

I read in the mono documentation that the tarbell should have a configure script, but it didn't.  So maybe I am not grabbing libgdiplus from the right place.  I am having trouble locating an official set of release libgdiplus tarbells.  I found the git source just fine, just can't locate tarbells on mono's sites for it.
Title: Re: TC 6+ and Mono
Post by: Rich on October 20, 2015, 11:23:26 PM
Hi ryios
Maybe here:
http://download.mono-project.com/sources/
Title: Re: TC 6+ and Mono
Post by: ryios on October 21, 2015, 11:14:33 AM
Hi ryios
Maybe here:
http://download.mono-project.com/sources/

That would be them, thanks Rich.
Title: Re: TC 6+ and Mono
Post by: nim108 on October 20, 2017, 02:51:42 PM
Sorry to bump a super old thread but I can't get this to work either ...

First off, I know there is an extension in the TC 8.x repo but we cannot use TC8 because it breaks intel graphics on older platforms (same goes for TC7). TC6 runs Xorg correctly on our hardware, albeit in software rendering mode. @bmarkus, if you can share your source for this tcz, I'd appreciate it so I know if you are patching anything or using different compilation options than me.

Anyway so I am using TC 6.4.1 to compile Mono. The only dependencies it requires seem to be gcc > 4.8 (needs to support C++11) and cmake > 2.8.10. I am loading compiletc autoconf libtool-dev automake gettext-dev cmake. Using ./configure --prefix=/usr/local/ and make. The build will always fail on a file in mono utils here:

Code: [Select]
mono-context.c: In function 'mono_sigctx_to_monoctx':
mono-context.c:51:2: error: implicit declaration of function 'UCONTEXT_REG_EAX' [-Werror=implicit-function-declaration]
  mctx->eax = UCONTEXT_REG_EAX (ctx);
  ^
mono-context.c:51:2: warning: nested extern declaration of 'UCONTEXT_REG_EAX' [-Wnested-externs]
mono-context.c:52:2: error: implicit declaration of function 'UCONTEXT_REG_EBX' [-Werror=implicit-function-declaration]
  mctx->ebx = UCONTEXT_REG_EBX (ctx);
  ^
mono-context.c:52:2: warning: nested extern declaration of 'UCONTEXT_REG_EBX' [-Wnested-externs]
mono-context.c:53:2: error: implicit declaration of function 'UCONTEXT_REG_ECX' [-Werror=implicit-function-declaration]
  mctx->ecx = UCONTEXT_REG_ECX (ctx);
  ^
mono-context.c:53:2: warning: nested extern declaration of 'UCONTEXT_REG_ECX' [-Wnested-externs]
mono-context.c:54:2: error: implicit declaration of function 'UCONTEXT_REG_EDX' [-Werror=implicit-function-declaration]
  mctx->edx = UCONTEXT_REG_EDX (ctx);
  ^
mono-context.c:54:2: warning: nested extern declaration of 'UCONTEXT_REG_EDX' [-Wnested-externs]
mono-context.c:55:2: error: implicit declaration of function 'UCONTEXT_REG_EBP' [-Werror=implicit-function-declaration]
  mctx->ebp = UCONTEXT_REG_EBP (ctx);
  ^
mono-context.c:55:2: warning: nested extern declaration of 'UCONTEXT_REG_EBP' [-Wnested-externs]
mono-context.c:56:2: error: implicit declaration of function 'UCONTEXT_REG_ESP' [-Werror=implicit-function-declaration]
  mctx->esp = UCONTEXT_REG_ESP (ctx);
  ^
mono-context.c:56:2: warning: nested extern declaration of 'UCONTEXT_REG_ESP' [-Wnested-externs]
mono-context.c:57:2: error: implicit declaration of function 'UCONTEXT_REG_ESI' [-Werror=implicit-function-declaration]
  mctx->esi = UCONTEXT_REG_ESI (ctx);
  ^
mono-context.c:57:2: warning: nested extern declaration of 'UCONTEXT_REG_ESI' [-Wnested-externs]
mono-context.c:58:2: error: implicit declaration of function 'UCONTEXT_REG_EDI' [-Werror=implicit-function-declaration]
  mctx->edi = UCONTEXT_REG_EDI (ctx);
  ^
mono-context.c:58:2: warning: nested extern declaration of 'UCONTEXT_REG_EDI' [-Wnested-externs]
mono-context.c:59:2: error: implicit declaration of function 'UCONTEXT_REG_EIP' [-Werror=implicit-function-declaration]
  mctx->eip = UCONTEXT_REG_EIP (ctx);
  ^
mono-context.c:59:2: warning: nested extern declaration of 'UCONTEXT_REG_EIP' [-Wnested-externs]
mono-context.c: In function 'mono_monoctx_to_sigctx':
mono-context.c:95:25: error: lvalue required as left operand of assignment
  UCONTEXT_REG_EAX (ctx) = mctx->eax;
                         ^
mono-context.c:96:25: error: lvalue required as left operand of assignment
  UCONTEXT_REG_EBX (ctx) = mctx->ebx;
                         ^
mono-context.c:97:25: error: lvalue required as left operand of assignment
  UCONTEXT_REG_ECX (ctx) = mctx->ecx;
                         ^
mono-context.c:98:25: error: lvalue required as left operand of assignment
  UCONTEXT_REG_EDX (ctx) = mctx->edx;
                         ^
mono-context.c:99:25: error: lvalue required as left operand of assignment
  UCONTEXT_REG_EBP (ctx) = mctx->ebp;
                         ^
mono-context.c:100:25: error: lvalue required as left operand of assignment
  UCONTEXT_REG_ESP (ctx) = mctx->esp;
                         ^
mono-context.c:101:25: error: lvalue required as left operand of assignment
  UCONTEXT_REG_ESI (ctx) = mctx->esi;
                         ^
mono-context.c:102:25: error: lvalue required as left operand of assignment
  UCONTEXT_REG_EDI (ctx) = mctx->edi;
                         ^
mono-context.c:103:25: error: lvalue required as left operand of assignment
  UCONTEXT_REG_EIP (ctx) = mctx->eip;

cc1: some warnings being treated as errors
Makefile:760: recipe for target 'mono-context.lo' failed
make[4]: Leaving directory '/home/tc/build/mono-3.12.1/mono/utils'
make[4]: *** [mono-context.lo] Error 1
Makefile:625: recipe for target 'all' failed
make[3]: Leaving directory '/home/tc/build/mono-3.12.1/mono/utils'
Makefile:434: recipe for target 'all-recursive' failed
make[2]: Leaving directory '/home/tc/build/mono-3.12.1/mono'
make[3]: *** [all] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
Makefile:518: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/home/tc/build/mono-3.12.1'
make: *** [all] Error 2
Makefile:445: recipe for target 'all' failed

Any ideas? This is a run of mono 3.12.1, but I've also tried mono-4.4.2.11 (the one that is in the TC8 repo), mono-4.8.1.0, and mono-5.4.0.201 and they produce the same error. I build other packages just fine in this same environment.
Title: Re: TC 6+ and Mono
Post by: Rich on October 20, 2017, 04:11:21 PM
Hi nim108
There is a build script here:
http://tinycorelinux.net/7.x/x86/tcz/src/mono/
Maybe it will be of some help?
Title: Re: TC 6+ and Mono
Post by: nim108 on October 20, 2017, 05:44:17 PM
Hmm good find Rich, thanks, I didn't see the build script for 8.x. Let me try to build using these flags.

Unfortunately, I think the error may be due to the older GCC version + older kernel headers in general.
Title: Re: TC 6+ and Mono
Post by: nim108 on October 20, 2017, 07:09:27 PM
Nop no luck, tried to suppress the errors and still nothing. I'm not sure TC6 can compile this.
Title: Re: TC 6+ and Mono
Post by: Rich on October 21, 2017, 01:56:48 AM
Hi nim108
I went to:
http://tinycorelinux.net/7.x/x86/tcz/src/mono/
and downloaded the tarball and the build file into a directory. I made the build script executable and added an  exit  statement
after the  make -j1  line since I didn't want to install anything. I'm still running TC4 and mono compiled with no errors.
Title: Re: TC 6+ and Mono
Post by: curaga on October 21, 2017, 03:35:08 AM
You could use TC8 and force software rendering? If the issue is with xf86-video-intel, use xf86-video-vesa or modesetting, if with the KMS in graphics-, don't load graphics- (or blacklist the i915 module) and use xf86-video-vesa.
Title: Re: TC 6+ and Mono
Post by: nim108 on October 21, 2017, 09:40:09 AM
Hi nim108
I went to:
http://tinycorelinux.net/7.x/x86/tcz/src/mono/
and downloaded the tarball and the build file into a directory. I made the build script executable and added an  exit  statement
after the  make -j1  line since I didn't want to install anything. I'm still running TC4 and mono compiled with no errors.
Hmm, let me try with this tarball then ... I downloaded the same version from their website. My build environment is a little different as I am building in a Docker environment (https://hub.docker.com/r/tatsushid/tinycore/) but everything else compiles just fine for me.
Title: Re: TC 6+ and Mono
Post by: nim108 on October 21, 2017, 09:41:22 AM
You could use TC8 and force software rendering? If the issue is with xf86-video-intel, use xf86-video-vesa or modesetting, if with the KMS in graphics-, don't load graphics- (or blacklist the i915 module) and use xf86-video-vesa.
I don't believe vesa supports OpenGL does it? We are running a Qt app within TC6 currently and although it runs very slow on the target in software rendered mode, at least it works. We cannot get any graphics environment to work in TC7 or TC8 but I guess we can try forcing software render mode.
Title: Re: TC 6+ and Mono
Post by: Rich on October 21, 2017, 11:25:33 AM
Hi nim108
The error you ran into appears in a file riddled with conditional compilation statements to accommodate various processor
types, operating systems, whether you're cross compiling, etc. My guess is that it didn't like something in the compiler
flags you exported or how you ran the  ,./configure  command. My recommendation is you try it using the build script as
is to make sure it compiles for you prior to applying any customizations you may need.
Title: Re: TC 6+ and Mono
Post by: curaga on October 21, 2017, 12:05:12 PM
Vesa should support software OpenGL rendering.
Title: Re: TC 6+ and Mono
Post by: nim108 on October 21, 2017, 04:48:45 PM
Hi nim108
The error you ran into appears in a file riddled with conditional compilation statements to accommodate various processor
types, operating systems, whether you're cross compiling, etc. My guess is that it didn't like something in the compiler
flags you exported or how you ran the  ,./configure  command. My recommendation is you try it using the build script as
is to make sure it compiles for you prior to applying any customizations you may need.
I see ... I guess this can be considered a cross compile as I am doing it inside a Docker environment. My host is 64 bit Mint. I'm guessing you are testing natively in a TC dev environment? Anyway I will try again first thing tomorrow morning as I am away from my PC today. I appreciate you trying to compile it yourself to check.

curaga, thanks, if that's truly the case, then we can pursue that path. We are targetting a EG20T platform (Atom E680 series) which uses the IntelĀ® Embedded Media and Graphics Driver and which has not been updated in any recent kernel in ages. I can give you a list of the exact Xorg related extensions we are loading on Monday when I get back to work. When these same extensions are loaded in TC7 or TC8, it fails to load any graphics environment.
Title: Re: TC 6+ and Mono
Post by: Rich on October 21, 2017, 04:57:53 PM
Hi nim108
Quote
I see ... I guess this can be considered a cross compile as I am doing it inside a Docker environment. My host is 64 bit Mint.
I'm not so sure the  Docker environment  would affect it. Is the target you are compiling for 32 or 64 bit?
Title: Re: TC 6+ and Mono
Post by: nim108 on October 21, 2017, 10:44:58 PM
Hi nim108
Quote
I see ... I guess this can be considered a cross compile as I am doing it inside a Docker environment. My host is 64 bit Mint.
I'm not so sure the  Docker environment  would affect it. Is the target you are compiling for 32 or 64 bit?
It's a 32 bit platform we are targeting. I'm not sure why it's failing either, even the latest Qt compiles in it just fine. Will test it tomorrow.
Title: Re: TC 6+ and Mono
Post by: Juanito on October 22, 2017, 02:30:46 AM
First off, I know there is an extension in the TC 8.x repo but we cannot use TC8 because it breaks intel graphics on older platforms (same goes for TC7). TC6 runs Xorg correctly on our hardware, albeit in software rendering mode.

Can you use xf86-video-intel-i810 in tc-7.x?
Title: Re: TC 6+ and Mono
Post by: nim108 on October 23, 2017, 11:56:49 AM
Rich, success, it compiles natively in a TC6 VM of mine. Thanks, I don't think Docker works because Mono relies on CMake internally, and when it polls for architecture and hardware, it's probably returning my host architecture (x86_64 running a new 4.x kernel) which screws up the whole build.

Would be nice to get TC8 working on this ancient hardware. To keep it short, the Xorg extension crashes on the target architecture and does not boot up (will post an error log of this tomorrow). The default TC8 Xvesa works fine but don't think that supports OpenGL. curaga, I think you are referring to using the xf86-video-vesa extension ... that works fine in TC6 but since TC8 can't even load Xorg, it doesn't work there. I believe only older kernels will work w/ graphics on this E680 Atom architecture. I will do more testing tomorrow, stay tuned.
Title: Re: TC 6+ and Mono
Post by: Rich on October 23, 2017, 03:18:17 PM
Hi nim108
I think compiling for x86 on an x86_64 platform still counts as cross compiling and probably requires additional flags on the
command line. Moving the task to a VM sounds like it saved you some aggravation.
Title: Re: TC 6+ and Mono
Post by: curaga on October 24, 2017, 01:35:41 PM
@Juanito: It's one of the PowerVR chips, not an Intel one. So no open drivers.

I was referring to xf86-video-vesa yeah.