Recent

Author Topic: [Tutorial] Cross Compile for arm-linux (Finally it works!)  (Read 179222 times)

Marcovaldo

  • New member
  • *
  • Posts: 7
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #75 on: January 27, 2011, 11:03:17 pm »
Add -XParm-linux-

That worked!

Thank you very much for your fast help!!!

Kind greetings from Vienna,

  Marcovaldo

fourfive

  • Newbie
  • Posts: 2
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #76 on: April 14, 2011, 08:19:00 am »
Hello fpc-Arm-Linux-guys,

is there anyone out there, who tried do run the crosscompiler-script in the recent days? It seems that some links in Kjooows script are broken, especially the file

ftp.freepascal.org/pub/fpc/dist/2.5.1/i386-linux/rpm/fpc-2.5.1-1.i686.rpm

is not available. I will try to do the job manually with the related fpc.zip.

fourfive


fourfive

  • Newbie
  • Posts: 2
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #77 on: April 14, 2011, 11:23:12 am »
Some other issues concerning this theme:

Now i did the job manually along the wiki. Even here i detected some error:

Compiling the fpc2.5.1 from sources needs Version > FPC2.4.0, indicated 2.2.0 gives the message: use fpc version > 2.4.0.

Furthermore crosscompiling fpc2.5.1 for arm stopps with an error.

BTW: Trying CodeTyphons solution results in some errors, too and does not produce a usable cross-compiler for arm-linux.

In respect to some other problems, i.e the unreliable compatibility to the libraries of the linux-targets i wonder, wether it would be better to port our (30.000 line) project to such an unbeloved target as wince.

fourfive

DirkS

  • Sr. Member
  • ****
  • Posts: 251
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #78 on: April 14, 2011, 11:52:25 am »
Quote
Compiling the fpc2.5.1 from sources needs Version > FPC2.4.0, indicated 2.2.0 gives the message: use fpc version > 2.4.0.
It's mentioned in the docs that you should always use the previous stable version to compile the compiler from sources. So for (cross-) compiling 2.5.1 svn you should use fpc 2.4.2.

Quote
Furthermore crosscompiling fpc2.5.1 for arm stopps with an error.
Yes, I had the same problem about a week ago cross-compiling for arm-wince. It does happen occasionnally that it gets broken but is generally fixed fairly quickly.

Gr.
Dirk.

sfischer

  • New Member
  • *
  • Posts: 37
Need help for crosscompiling
« Reply #79 on: September 02, 2011, 04:39:06 pm »
Hello,

I've set up my crosscompiling environment on ubuntu. I've used the script lazarus_first_time.
I can successfully compile a helloworld.pas program. I've copied the binary file to the following ARM platform: http://opengear.com/product-acm5000.html
But i can't run it. the error message is segmentation fault.

After that, I've installed the CDK from Opengear
pls. see: http://community.pachube.com/node/690

I'm able to compile and link a c program. I can run the c program on the Target Device.
The Dev Kit from Opengear installs a different version of binutils
(Linker Assembler ...) but these tools are incompatible with FPC. (FPC can not use them, if I compile helloworld.pas)

The Dev Kit from Opengear can not work with the FPC Binutils.

So I'm in a trap. How to solve that problem ?

Thanks,
SF


 

tintinux

  • Sr. Member
  • ****
  • Posts: 325
    • Gestinux
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #80 on: December 20, 2011, 06:02:21 pm »
Hi

I try to use the script lazarus_first_time on a new (virtual) machine.

The directory  /home/$NAME/fpc_tools/binutils/binutils-2.20.1/  is renamed to /home/$NAME/fpc_tools/ and later there is a cd and commands into the old directory name. This can't work...

I do not know what is right...

Code: [Select]
[b]mv /home/$NAME/fpc_tools/binutils/binutils-2.20.1/ /home/$NAME/fpc_tools/[/b]

cd /home/$NAME/
#swap --> Please, use one of these combinations: "FPC 2.4.2 + Lazarus 0.9.30 -> fixes" OR "FPC 2.5.1 + Lazarus 0.9.31 -> trunk"
svn co http://svn.freepascal.org/svn/lazarus/trunk lazarus
#svn co http://svn.freepascal.org/svn/lazarus/branches/fixes_0_9_30/ lazarus
cd /home/$NAME/lazarus/
svn up

cd /home/$NAME/lazarus/components/
svn co https://glscene.svn.sourceforge.net/svnroot/glscene/trunk glscene

echo "Install & Configure Binutils"
[b]cd /home/$NAME/fpc_tools/binutils-2.20.1[/b]
./configure --target=arm-linux --disable-werror
make
sudo make install

By the way, it would be useful to update 0.9.30 to 0.9.30.2 since the last one is the last stable release.

I have made small improvements in the script :

1) to avoid changes in 3 different places
2) to include a debug mode to be able to see error messages

If you are interested it is attached.

HTH
« Last Edit: December 23, 2011, 10:16:06 am by tintinux »
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

sngha2

  • Newbie
  • Posts: 1
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #81 on: December 23, 2011, 10:07:42 am »
Quote
I made two scripts that download svn sources and zip needed to build and configure your Ubuntu (x86) box with Lazarus AND FPC (both are enabled to compile for i386-linux and cross compile for arm-linux).
Do not run these scripts, they complete messed-up my Lazarus and FPC configuration and it took me half a day to clean up and re-install everything.

tintinux

  • Sr. Member
  • ****
  • Posts: 325
    • Gestinux
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #82 on: December 23, 2011, 10:14:38 am »
Quote from: sngha2
Do not run these scripts
True, I had the same issue and I had to reinstall Lazarus from scratch.

When trying such things, it is advisable to use a VirtualBox as I did the second time (and found reported errors).

Regards
Tintinux


Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

kc87654321

  • New Member
  • *
  • Posts: 17
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #83 on: July 03, 2012, 07:52:51 am »
I got it finnaly i was able to compile a simple form for ARM Youpi and thanks for the help.
After pass 30 min to rename a buch of so.0.2 -> .so everything is ok now

My main application is a shop barcode scanner using overo air (wireless & bluetooth)
This application need to connect to a mysql5 database on my locale network so i'm using a TMySQL50Connection , ect  this application only have a few button and this compoment. when i try to compile it i got this

registersqldb.pas(45,3) Fatal: Can't find unit propedits used by registersqldb

Can someone give me a tpis on how using mysql database and arm ?

Many Thanks again for the help
Christian F


I'm glad to know that it works now.

The component that you use for mysql, works well con i386-linux compiling?
If yes, try to recompile LCL and Package registration:
http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM#Configure_Lazarus_for_cross_Compile
(paragraph "Configure Lazarus for cross Compile" only)

hi !I got it finnaly and  thanks for the Setup_Cross_Compile_For_ARM.
 ;)My main application need The component ¨Lnet ¨,i try to recompile LCL and Package registration:Configure Lazarus for cross Compile,but ¨/home/user/lazarus/fpc/inet0.6.6/lib/lcommon.pp(537) Error: Assembler /home/user/lazarus/fpc/binutils/as not found, switching to external assembling¨, %) %) %)
plc tall me how can i use the  component ¨Lnet ¨ :'(


Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #84 on: July 03, 2012, 08:50:43 am »
Quote
Error: Assembler /home/user/lazarus/fpc/binutils/as
Do you have cross arm binutils installed? If yes, how are they named? If it's something like i386-linux-<name>, probably you need to adjust the fpc.cfg to have -XP$FPCTARGET- so the compiler would look for, for example the assembler, as i386-linux-as instead of just plain as.

kc87654321

  • New Member
  • *
  • Posts: 17
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #85 on: July 04, 2012, 09:28:47 am »
 ;D thinks ,i try. 8-)

Diego

  • New member
  • *
  • Posts: 8
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #86 on: August 24, 2014, 05:46:54 pm »
Hello, I'm having the same problem, follow the step by step of http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM.

I'm trying to build lazarus and I get the error: /home/mint/lazarus/packager/registration/lazaruspackageintf.pas(104) Error: Assembler arm-linuxas not found, switching to external assembling

Could anyone help me?

Diego

  • New member
  • *
  • Posts: 8
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #87 on: August 24, 2014, 10:26:52 pm »
Fix it, adding -XParm-linux- in lazarus, following Tools -> Configure Build Lazarus -> Options. The last dash (-) is very important, without it I believe the fpc concatenates the assembly (arm-linuxas), which should be arm-linux-as.

Now I am getting the below error, someone could explain why? I'm using 64bit linux.

Free Pascal Compiler version 2.6.4 [2014/08/24] for x86_64
Copyright (c) 1993-2014 by Florian Klaempfl and others
Note: Switching assembler to default source writing assembler
Target OS: Linux for x86-64
Compiling lazarus.pp
Compiling redirect_stderr.pas
Assembling redirect_stderr
/usr/local/bin/arm-linux-as_org: unrecognized option '--64'
redirect_stderr.pas(143) Error: Error while assembling exitcode 1
redirect_stderr.pas(143) Fatal: There were 2 errors compiling module, stopping

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #88 on: August 25, 2014, 10:09:38 am »
Fix it, adding -XParm-linux- in lazarus, following Tools -> Configure Build Lazarus -> Options. The last dash (-) is very important, without it I believe the fpc concatenates the assembly (arm-linuxas), which should be arm-linux-as.
If you see my reply to kc87654321, you won't experience this.
Now I am getting the below error, someone could explain why? I'm using 64bit linux.

Free Pascal Compiler version 2.6.4 [2014/08/24] for x86_64
Copyright (c) 1993-2014 by Florian Klaempfl and others
Note: Switching assembler to default source writing assembler
Target OS: Linux for x86-64
Compiling lazarus.pp
Compiling redirect_stderr.pas
Assembling redirect_stderr
/usr/local/bin/arm-linux-as_org: unrecognized option '--64'
redirect_stderr.pas(143) Error: Error while assembling exitcode 1
redirect_stderr.pas(143) Fatal: There were 2 errors compiling module, stopping
Check your binutils. If it's already 64-bit, I don't think it accepts --64 parameter. Not sure though, better consult binutils documentation.

Diego

  • New member
  • *
  • Posts: 8
Re: [Tutorial] Cross Compile for arm-linux (Finally it works!)
« Reply #89 on: August 25, 2014, 01:18:14 pm »
Hello Leledumbo, thanks for replying.

I have found no way to correct this error, so I installed a new linux 32bit in a VM, but after arriving in step "Configure Lazarus for cross Compile" tutorial http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM still get the error, but now with '--32'

Erro:
Free Pascal Compiler version 2.6.4 [2014/08/25] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
Note: Switching assembler to default source writing assembler
Target OS: Linux for i386
Compiling lazarus.pp
Compiling redirect_stderr.pas
Assembling redirect_stderr
/usr/local/bin/arm-linux-as_org: unrecognized option '--32'

I believe that the problem is not on the platform. : /

The strange thing is that at no time do not add the option '--32' and do not know where and at what time this command is inserted.

Would you assist me?

 

TinyPortal © 2005-2018