Recent

Author Topic: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)  (Read 22420 times)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1146
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #15 on: March 24, 2016, 11:31:28 pm »
That is a good find !!! Could be the same cause for range errors in SynEditHighlighterFoldBase.pas

And if so, this could/would also mean a problem with the inc function on aarch64 in FPC !

Nighttime for me now ... I will sleep on it ...  :D


criageek

  • Jr. Member
  • **
  • Posts: 79
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #16 on: March 25, 2016, 12:54:08 am »
Good call!  I removed all instances of Inc and Dec in procedure BalanceNode in SynEditHighlighterFoldBase.pas and now it appears I can open any file in the Source Editor without getting the Range Check Errors!

I'm not an expert on the internal working of Lazarus or FPC, but I'm guessing the problem has to do with how Integers and/or TCardinal are declared for aarch64.

Rich

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3645
  • I like bugs.
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #17 on: March 25, 2016, 10:29:47 am »
I'm not an expert on the internal working of Lazarus or FPC, but I'm guessing the problem has to do with how Integers and/or TCardinal are declared for aarch64.

Yes, it looks like a compiler bug. The variables in GetWheelScrollAmount are Integers.
If you can reproduce it with a small demo program (no LCL or other dependencies) it should be reported.

The range check errors come only when Lazarus is built with -Cr, right?
Another issue is that many things work wrong even without -Cr.
Does it mean that FPC not only gives wrong range check errors but also generates wrong code for Inc() and Dec()?
Could you please test it with a small test program, or by placing DebugLn() calls in SynEdit code showing values before and after Inc(), or by debugging Lazarus as GDB now works.
« Last Edit: March 25, 2016, 10:34:09 am by JuhaManninen »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1146
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #18 on: March 25, 2016, 11:13:31 am »
I have been running inc / dec test programmes all morning now ... all work 100% on aarch64.

I have also looked into the alignment patches that went into synedit.
Old but perhaps not 100% correct for aarch64.
http://bugs.freepascal.org/view.php?id=19109

@juha
I will test further, with your suggestions !

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1146
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #19 on: March 25, 2016, 12:01:39 pm »
@juha.

I am now running the (normal) fpc tests (from fpc/tests ; make full).
Should all tests pass normally ?

I ask, because there are failures, and I do not know if this is normal for some of these tests !

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3645
  • I like bugs.
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #20 on: March 25, 2016, 12:22:08 pm »
I am now running the (normal) fpc tests (from fpc/tests ; make full).
Should all tests pass normally ?

I have no idea. You must ask FPC developers. "fpc-dev" list may be the best place to ask.


DonAlfredo

  • Hero Member
  • *****
  • Posts: 1146
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #22 on: March 26, 2016, 09:16:01 am »
Kernel maintainers of Arch Linux Arm have updated the kernel. GDB is working on Arch !  :D

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1146
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #23 on: March 29, 2016, 06:03:33 pm »
The FPC developers have resolved two "bugs" !

http://bugs.freepascal.org/view.php?id=29912
http://bugs.freepascal.org/view.php?id=29923

Lazarus is now working without range errors !

Still some bugs to go ....  :)

criageek

  • Jr. Member
  • **
  • Posts: 79
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #24 on: April 01, 2016, 03:53:19 am »
Hey DonAlfredo - Can you talk me through how to update my FPC installation, which was done using your Lazarus/FPC install scripts?  While I'm quite comfortable using FPC and Lazarus, I'm quite a novice at building FPC and Lazarus, and all I know about git is that I can follow directions for using it.  I have FPC installed in /home/rich/development/fpc.

Thanks,
Rich

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1146
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #25 on: April 01, 2016, 06:36:36 am »
To update both FPC and Lazarus, run:
fpclazup --fpcURL="trunk" --lazURL="trunk" --getfullrepo

So, in this case, you need the above !
It will update the sources from SVN, and do a clean and build.

But you can also limit the functionality of fpc(laz)up.

To update FPC only, run:
fpclazup --fpcURL="trunk" --lazURL="trunk" --getfullrepo --only="fpc"

To update Lazarus only, run:
fpclazup --fpcURL="trunk" --lazURL="trunk" --getfullrepo --only="lazarus"

To clean and build FPC only, run:
fpclazup --fpcURL="trunk" --lazURL="trunk" --getfullrepo --only="FPCCleanOnly,FPCBuildOnly"

To clean and build Lazarus only, run:
fpclazup --fpcURL="trunk" --lazURL="trunk" --getfullrepo --only="LazCleanAndBuildOnly"


JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3645
  • I like bugs.
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #26 on: April 01, 2016, 11:23:11 am »
The FPC developers have resolved two "bugs" !

http://bugs.freepascal.org/view.php?id=29912
http://bugs.freepascal.org/view.php?id=29923

Lazarus is now working without range errors !
Still some bugs to go ....  :)

I guess it did not affect the Toolbar icon issue or the other GUI anomalies?

criageek

  • Jr. Member
  • **
  • Posts: 79
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #27 on: April 02, 2016, 01:48:22 am »
To update both FPC and Lazarus, run:
fpclazup --fpcURL="trunk" --lazURL="trunk" --getfullrepo

So, in this case, you need the above !
It will update the sources from SVN, and do a clean and build.

But you can also limit the functionality of fpc(laz)up.

To update FPC only, run:
fpclazup --fpcURL="trunk" --lazURL="trunk" --getfullrepo --only="fpc"

To update Lazarus only, run:
fpclazup --fpcURL="trunk" --lazURL="trunk" --getfullrepo --only="lazarus"

To clean and build FPC only, run:
fpclazup --fpcURL="trunk" --lazURL="trunk" --getfullrepo --only="FPCCleanOnly,FPCBuildOnly"

To clean and build Lazarus only, run:
fpclazup --fpcURL="trunk" --lazURL="trunk" --getfullrepo --only="LazCleanAndBuildOnly"

Thanks DonAlfredo!  Worked perfectly!

Rich

criageek

  • Jr. Member
  • **
  • Posts: 79
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #28 on: April 02, 2016, 01:49:00 am »
The FPC developers have resolved two "bugs" !

http://bugs.freepascal.org/view.php?id=29912
http://bugs.freepascal.org/view.php?id=29923

Lazarus is now working without range errors !
Still some bugs to go ....  :)

I guess it did not affect the Toolbar icon issue or the other GUI anomalies?

No, it looks like the other problems are still there  :(

Rich

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1146
Re: Lazarus on aarch64 systems like Odroid-C2 (and RPi3)
« Reply #29 on: April 02, 2016, 09:59:10 am »
@rich  ;D

@juha
No, that problem still exists. Among others.

I have filed another bug report few days ago.
http://bugs.freepascal.org/view.php?id=29933
Error: if you press enter in the Lazarus source form, the cursor jumps away to the first line in the form.
This took a whole day debugging to get to the error.
But I failed in isolating it into a simple FPC test program.

In general.

As you can see from the previous bugs, these were compiler errors.
And if you look at their resolution, you see that they were way deep into the compiler. Which is also far beyond my capabilities to understand.

So, unfortunately, I cannot help in solving the bugs, other than detecting them.
And that is why they have to be solved one by one, in order to see their impact on other Lazarus issues. Its all in the hands of the FPC compiler guys !