Hard float lazarus / 1-Linux ---------------------------------------------------------------------- djdjdjole · 2013-02-05 17:31 My intetnion is to build Lazarus to be able to generate ARM hard float ABI. My consideration is that I should only change "make crossinstall" step in order to generate hard float variants of ppu's. Lazarus can be build as usuall - no special options. My first question is am I right having such concept ? And second question (if the first one is OK), does it mean that this way I can only compile for hard float, and cannot generate soft float binaries ? Regards ---------------------------------------------------------------------- marcov · 2013-02-06 13:11 Hardfloat is only in FPC 2.7.1, the development version. Some support is backported to 2.6.x by debian maintainers, but this is not supported by the FPC team. You will indeed need to build a new FPC installation (and lazarus/lcl) with the correct HF flags and target selected. The result will be something that will only generate HF, but you can have multiple such crosscompilation systems installed on one computer. ---------------------------------------------------------------------- avra · 2013-02-06 14:14 If you face problems you can't solve, take a look at CT solution Raspberry Pi example: http://www.pilotlogic.com/sitejoom/index.php/forum/other-cross-build- targets/2238-my-first-raspbian-app ---------------------------------------------------------------------- djdjdjole · 2013-02-06 16:00 Regarding marcov's response, I am little bit confused, with success story: http://www.lazarus.freepascal.org/index.php?topic=18749.0 and partially with http://web.archiveorange.com/archive/v/Q8InytiiWjAdd60yEaVc. In second case it was all about changing assembler's options. AFAIK it is not related to 2.7.1, although I didn't succeed either way. And regarding avra, I must say, I only heard of CT, didn't try anything, because I prefer Pascal (CT is C or C++ ?) and I am pretty familiar with Lazarus class structure. However I'm going to inform myself in that matter. Regards ---------------------------------------------------------------------- avra · 2013-02-07 09:34 Quote from: djdjdjole on February 06, 2013, 05:00:54 pmAnd regarding avra, I must say, I only heard of CT, didn't try anything, because I prefer Pascal (CT is C or C++ ?) and I am pretty familiar with Lazarus class structure.CT stands for Lazarus CodeTyphon edition (so it is Pascal), which is actually cross platform Lazarus on steroids with zillion components (some not available elsewhere). You can also set cross platform on Lazarus yourself, but it is not easy so someone has already done the hard work for you. Only you can say after trial if CT suits your needs better then official Lazarus. http://www.pilotlogic.com/sitejoom ---------------------------------------------------------------------- djdjdjole · 2013-02-07 09:55 Regarding marcov's quotation of fpc 2.7.1, I used ftp://ftp.freepascal.org/fpc/snapshot/v27/source/ and didn't succeed to compile neither lazarus1.0 nor 1.1 (without HF). So, no much use of 2.7.1 in this context. And as response to avra- I think, I am familiar with adjusting crosscompile toolchain with Lazarus as front and - I did few usefull (not so big) ARM board applications. Problem is here, much about HF compiling (and also big problem is described in first sentence of this text). There are inconsistenties somewhere. Either prebuild fpc (.rpm/.deb) will not compile fpc sources, or that new fpc cannot build lazarus, or lazarus incorrectly build final target code. I don't know if it is the case with CT, but getting usefull environment seems to me like gambling. Regards ---------------------------------------------------------------------- avra · 2013-02-07 10:27 Quote from: djdjdjole on February 07, 2013, 10:55:25 amI don't know if it is the case with CT, but getting usefull environment seems to me like gambling. Experts would not agree with you, but cross platform beginners would. One of the main intentions of Lazarus CT edition is to solve cross platform problems for beginners. Using CT and downloading Pi dependencies from the link I provided should be one of the few possible solutions for your problem. I am just saying that if you run out of options you can also follow the path that I have suggested. ---------------------------------------------------------------------- djdjdjole · 2013-02-07 10:59 I don't know about CT, but my quotation, regarding crosscompiling for Lazarus only, is based on many attempts (and what to tell about 2.7.1 not compiling lazarus sources that I mentioned in previous post).  BTW as Pi was mentioned, I noticed many useffull atempts of installing Lazarus on Pi, so no need for crosscompiling - only patience is needed (related to speed). I begin to think, because of CPU power and memory growth, the same will be also available on future ARM boards. ---------------------------------------------------------------------- djdjdjole · 2013-02-07 14:10 And forgot to ask one more question, althought it may be for separate thread. Has anyone succedded to build fpc compiler from trunk (revision is now 23583) ? If so, which fpc was used for building it? I tried with fpc from fpc-2.6.0-0.laz.i686.rpm (on Ubuntu 11.04), but errors appear. Thanks ---------------------------------------------------------------------- djdjdjole · 2013-02-11 14:16 Somehow succeded to build trunk fpc and Lazarus also. However I am not sure about flags that I should give in order to crosscompile fpc for hard float ARM. Does someone have any suggestion regarding that matter? Thanks ---------------------------------------------------------------------- djdjdjole · 2013-02-14 21:07 OK - built compiler that support hard float. When I put float multiplying in code, I see in assembler listing hard float instructions (eg. fmuld). But even for simple console program: (write(14.2323* 3.232); readln;), I faced problems. I've got correct result on screen, but when I hit any key (to exit program - due to "readln" command), I got Access violation exception on exit. The same states for GTK program- at the beginning of it. What should I suspect to ? ---------------------------------------------------------------------- djdjdjole · 2013-02-14 21:24 A small correction. In previous post- code "write(14.2323* 3.232"; ..., hard float instruction - "fmuld" shall not be generated, but in: "a:= 14.2323; a:= a* 3.232", it is clealy seen in assembler listing. No matter- access violation still stands. ---------------------------------------------------------------------- djdjdjole · 2013-02-20 10:10 Now it's OK - was matter of correct flags. My simple GTK application works on RPi, crosscompiled on Lazarus/Ubuntu. And now -vacation! By. Thanks all ---------------------------------------------------------------------- halmariane · 2013-03-11 14:07 Quote from: djdjdjole on February 20, 2013, 11:10:14 amNow it's OK - was matter of correct flags. My simple GTK application works on RPi, crosscompiled on Lazarus/Ubuntu. And now -vacation! By. Thanks all Hi djdjdjole I am the same problem with the GTK. Console application works nice. TForm Applications crash at start. What are the flags you are talking about? Best regards ---------------------------------------------------------------------- djdjdjole · 2013-03-11 14:45 Hi halmariane I first compiled Thrunk FPC with 2.6.0 rpm FPC package (see http://wiki.freepascal.org/Setup_Cross_Compile_For_ARM). Then you shoud crosscompile your FPC (Thrunk version), this way (also Lazarus should be compiled with this Thrunk): sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/djdjdjole/lazarus/fpc/binutils/ OPT=-dFPC_ARMHF CROSSOPT="-Caeabihf -Cparmv6 -Cfvfpv3_d16" INSTALL_PREFIX=/usr Please - change the folder of binutils, according to your arangement. The same three flags you should quote inside the Lazarus IDE (in Project Options - "Others" section). Of course, you should also add the path of shared libraries, you pulled from target RPi. Generated binary - transfer to RPi (ssh or so). I tried few more GTK examples - works as expected. Regards ---------------------------------------------------------------------- halmariane · 2013-03-11 17:01 Quote from: djdjdjole on March 11, 2013, 03:45:38 pmHi halmariane I first compiled Thrunk FPC with 2.6.0 rpm FPC package (see http://wiki.freepascal.org/Setup_Cross_Compile_For_ARM). Then you shoud crosscompile your FPC (Thrunk version), this way (also Lazarus should be compiled with this Thrunk): sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/djdjdjole/lazarus/fpc/binutils/ OPT=-dFPC_ARMHF CROSSOPT="-Caeabihf -Cparmv6 -Cfvfpv3_d16" INSTALL_PREFIX=/usr Please - change the folder of binutils, according to your arangement. The same three flags you should quote inside the Lazarus IDE (in Project Options - "Others" section). Of course, you should also add the path of shared libraries, you pulled from target RPi. Generated binary - transfer to RPi (ssh or so). I tried few more GTK examples - works as expected. Regards Thanks djdjdjole but for the moment it's impossible. Two months ago I have been croscompiling and working without Hard Float to PI Hard Float OS and all worked right except ScrollBars. For that reason, for ScrollBar i decided to create a ppcrossarm with Linux ARMHF support. From this moment (one week ago) it's impossible execute a Form Application. I do not know why Console Applications runs. If I crosscompile Form Application it does not start (crash, exceptions and more). I'm using CodeTyphon 4.10 instead a Lazarus. I have modified the scripts and ppcrossarm and libraries seems they are created right. Ppcrossarm displays the support for ARMHF. I have checked all your flags also (some days ago) and nothing. The application is linked right and crashes in the PI. I have checked compiling binutils by hand, with EABIHF and withot EABIHF and nothing.... impossible.... application crashes. I am already very tired Regards ---------------------------------------------------------------------- halmariane · 2013-03-11 17:42 Solved. Thank you very much  I'm using CodeTyphon and the script must be modified on other parts more of the script. Regards ---------------------------------------------------------------------- djdjdjole · 2013-03-11 18:28 Good news halmariane. CodeTyphoon seems to be IDE that is worth  learning (avra's proposal), however lack of time prevents me for the moment. I am also interested in crosscompiling for Qt, using Lazarus. However RPi doesn't have qmake (I must also crosscompile it), and also Qt bindings should be also compiled. Once when I compiled Qt4Pas, I noticed it's dependience of QtWebKit, QtSSL and QtNetwork, which means I also need to compile them (maybe those packages are available precompiled - I didn't search). Or is it better to build whole RFS (via BuildRoot for example) with all those stuffs? So it would be nice to here if someone succeeded in that matter and how. Regards