Recent

Author Topic: Problem compiling Lazarus on MIPS Creator.  (Read 4819 times)

Minou666

  • Newbie
  • Posts: 4
Problem compiling Lazarus on MIPS Creator.
« on: November 25, 2015, 03:25:21 am »
I have created a gentoo linux for the MIPS creator, compiled everyting natively.
I have created a Maté desktop for it which works nicely, it will be better when Imagination releases the drivers for the GPU, to come later ...

My gentoo linux resides on an SD Card 32GB from Sundisk. (48MB/s)

Here is the problem :

I have created a version of Free Pascal which works nicely but I cannot create a working lazarus.

suzie temp # fpc
Free Pascal Compiler version 3.0.0rc2 [2015/11/22] for mipsel
Copyright (c) 1993-2015 by Florian Klaempfl and others

Binutils  is :

suzie temp # as --version
Assembleur GNU (Gentoo 2.25.1 p1.1) 2.25.1
Copyright (C) 2014 Free Software Foundation, Inc.
Ce logiciel est libre; vous pouvez le redistribuer selon les termes de la
version 3 de la licence GNU General Public License ou suivante.
Ce programme n'est couvert par AUCUNE garantie.
Cet assembleur a été configuré pour la cible « mipsel-unknown-linux-gnu ».

GCC :

suzie temp # gcc --version
gcc (Gentoo 5.2.0 p1.2, pie-0.6.4) 5.2.0
Copyright © 2015 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie.  Il n'y a PAS
GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.


I tested a few pascal programs, all compiled and worked perfectly except for lazarus, it seems that many apps created by lazarus project bomb out.
The version I compiled was 1.4.4. This MIPS processor is little Endian and has hardware floating point support.

Examples :
../tools/svn2revisioninc .. revision.inc
An unhandled exception occurred at $004F2B31:
EAccessViolation: Access violation
  $004F2B31  RESOLVEDOTS,  of lazfileutils.inc

suzie tools # ./lazres
Usage: lazres resourcefilename filename1[=resname1] [filename2[=resname2] ... filenameN=resname[N]]
       lazres resourcefilename @filelist
An unhandled exception occurred at $005426B1:
EAccessViolation: Access violation
  $005426B1  TFREENOTIFYINGOBJECT__DESTROY,  of lazclasses.pas
  $005426B1  TFREENOTIFYINGOBJECT__DESTROY,  of lazclasses.pas

suzie lazarus # ./lazbuild
An unhandled exception occurred at $00A7A961:
EAccessViolation: Access violation
  $00A7A961  TPROPERTIESTOSKIP__GETITEM,  of lresources.pp

An unhandled exception occurred at $00ADD004:
EAccessViolation: Access violation
  $00ADD004  DOFINALIZATION,  line 545 of ./widgetset/wslclclasses.pp







JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Problem compiling Lazarus on MIPS Creator.
« Reply #1 on: November 25, 2015, 05:36:06 pm »
I have created a gentoo linux for the MIPS creator, compiled everyting natively.
I have created a Maté desktop for it which works nicely, it will be better when Imagination releases the drivers for the GPU, to come later ...

My gentoo linux resides on an SD Card 32GB from Sundisk. (48MB/s)
Here is the problem :
I have created a version of Free Pascal which works nicely but I cannot create a working lazarus.

I don't have solutions for your problems but I may be interested to get a similar system for testing if the main problems really are in Lazarus code instead of FPC.
I was going to ask what king of MIPS gadget you have, but now I learned that "MIPS creator" is the actual name. Never heard before.

Is this the best place to buy it?
 http://store.imgtec.com/uk/product/new-mips-creator-ci20/

The FAQ says it is ready "out of the box" if you have a HDMI monitor + USB keyboard and mouse.
It comes with a USB power cable. Where did you actually connect the cable?

You installed Gentoo. Why? Is the builtin Debian not good enough?

I understood the performance is much better than Raspberry Pi has. How much better? Can it function as a personal computer? How about watching streaming videos?

You wrote FPC works well. How did you install it?
Which version of Lazarus? Trunk I guess.

There are some already solved issues related to CPU endianness :
 http://bugs.freepascal.org/view.php?id=27719
 http://bugs.freepascal.org/view.php?id=27761
« Last Edit: November 25, 2015, 05:51:48 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Minou666

  • Newbie
  • Posts: 4
Re: Problem compiling Lazarus on MIPS Creator.
« Reply #2 on: November 26, 2015, 03:32:47 am »
Quote

I don't have solutions for your problems but I may be interested to get a similar system for testing if the main problems really are in Lazarus code instead of FPC.
I was going to ask what king of MIPS gadget you have, but now I learned that "MIPS creator" is the actual name. Never heard before.

Is this the best place to buy it?
 http://store.imgtec.com/uk/product/new-mips-creator-ci20/

Correct if you are in Europe, they do have a USA store. I live in Michigan so I bought from there.

http://store.imgtec.com/us/product/new-mips-creator-ci20/

Quote
The FAQ says it is ready "out of the box" if you have a HDMI monitor + USB keyboard and mouse.
It comes with a USB power cable. Where did you actually connect the cable?

I connect the USB power cable to a small power supply that I bought in a store, a 4A supply. You do not need that much current, it just happened that I need a lot of current for some other board.

Quote
You installed Gentoo. Why? Is the builtin Debian not good enough?

I do have debian on the internal flash. For cross compiling it is much easier with gentoo. By using gentoo I have more control on the system, less unwanted updates. Sometimes I prefer arch but I didn't see any work on this board yet and was not willing to create it, being very familiar with gentoo I saw this as an easier task. It did turn out to be a huge challenge. gh stuff was a real pain, I had to disable all assembler creation because it was creating crap for assembler this, as refused to assemble since it found it to be invalid assembler for the processor used. Is is possible that lazarus makes a mistake on the assembly to create? I did create some small test programs in pascall with and without float with no issues. I will create some that has floats as argument, maybe that is an issue. I do remember that they screwed up royally with the ARM processors that have hard float, it took a while to figure out the solution on that. It would create soft float instead of hard float which would crash the application.

I am planning to publish my gentoo image once I get lazarus, GPU video stuff and firefox.

Quote
I understood the performance is much better than Raspberry Pi has. How much better? Can it function as a personal computer? How about watching streaming videos?

They have not released the GPU stuff yet for the latest kernel, so you have to use an old kernel for that. Since I am using a new kernel I cannot give you information on that yet. 

For the arm boards the best performances are on the odroid boards.

Quote
You wrote FPC works well. How did you install it?
Which version of Lazarus? Trunk I guess.

I first created a minimal cross compiler for mipsel. With that cross compiler I created a pascal for the bootstrap.
On the creator I made an ebuild that would install the binary on /usr/local and then created an other ebuild to compile fpc 3.0.0 rc2 which was the latest official pre-release version. I compiled the package, before doing the merge I removed the binary package previously installed.

http://wiki.freepascal.org/Native_MIPS_Systems



Quote
There are some already solved issues related to CPU endianness :
 http://bugs.freepascal.org/view.php?id=27719
 http://bugs.freepascal.org/view.php?id=27761


I will check those out.


JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Problem compiling Lazarus on MIPS Creator.
« Reply #3 on: November 26, 2015, 12:34:55 pm »
I do have debian on the internal flash. For cross compiling it is much easier with gentoo.

I thought you can do everything natively in the MIPS gadget. The initial cross compiling can be done in a normal PC.
I may be wrong. I must confess I am a newbie with cross compilation. I have used FPC only in Intel CPUs so far.

Quote
They have not released the GPU stuff yet for the latest kernel, so you have to use an old kernel for that. Since I am using a new kernel I cannot give you information on that yet. 

Does it mean you must use VGA resolution or something?

I checked the price of this gadget. Now that euro rate is low + transportation to north, it would be 90€ which is more than I expected.
I will see again early next year, after couple of months.

For the future I consider it important to support MIPS. There will be a flood of "TV-box" class computers, some of them having MIPS. They replace traditional PCs in many use cases.
I have a "TV-box", ASRock Beebox, as my main PC now. Quite an amazing gadget.
 http://forum.lazarus.freepascal.org/index.php/topic,29178.msg187386.html#msg187386
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018