Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-08

ARM/Linux development

13 messages · 9 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Robert Reimiller

I am researching a new platform for our data logger. The current data logger is a PC104 board with a ZF86 (obsolete) chip running DR-DOS, our own multi-tasking kernel, with code compiled using BP7.

Since low power is important for this application we are interested in ARM based products. We are currently looking at this development system: http://www.arcom.com/devkit-linux-vulcan.htm

which is a IXP425 XScale based board running "Embedded Linux", apparently obtained from http://www.linuxdevices.com/

Anyone know if FPC is compatable with the IXP425?

As I understand it the ARM version of FPC is not self hosting, it must run on a 386 based Linux system and run as a cross compiler, correct? If so, what is the recommended version of 386 Linux, at least this week?

Thanks for any help you can provide.

Robert Reimiller
Certified Software Corp.

Reply by email

Florian Klaempfl
to Robert Reimiller
Robert Reimiller wrote 12 lines
I am researching a new platform for our data logger. The current data logger is a PC104 board with a ZF86 (obsolete) chip running DR-DOS, our own multi-tasking kernel, with code compiled using BP7. Since low power is important for this application we are interested in ARM based products. We are currently looking at this development system: http://www.arcom.com/devkit-linux-vulcan.htm which is a IXP425 XScale based board running "Embedded Linux", apparently obtained from http://www.linuxdevices.com/ Anyone know if FPC is compatable with the IXP425?

I'am quite sure it is.

As I understand it the ARM version of FPC is not self hosting, it must run on a 386 based Linux system and run as a cross compiler, correct?

The precompiled package, yes. However, you could create a self hosting package (having an arm with at least 64 MB RAM and 1 GB disk) or a cross compiler hosted on any platform supported by FPC.

If so, what is the recommended version of 386 Linux, at least this week?

It should work with any not too old linux. The installer package was built on SuSE 9.0.

Show quoted text 10 lines
Thanks for any help you can provide. Robert Reimiller Certified Software Corp. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

peter green
to Florian Klaempfl
Show quoted text 7 lines
> As I understand it the ARM version of FPC is not self hosting, it must run > on a 386 based Linux system and run as a cross compiler, correct? The precompiled package, yes. However, you could create a self hosting package (having an arm with at least 64 MB RAM and 1 GB disk) or a cross compiler hosted on any platform supported by FPC.

has this actually been tried recently and is the arm compiler yet stable enough to complete a make cycle?

Reply by email

Michael Van Canneyt
to Ростислав Окулов
[koi8-r] ????????? ?????? wrote
I have FPC source code, Win32 binary release, and linux binary release. How can I build linux program from win32 platform?

You need a cross-linker and cross-assembler binaries.
- Then you must compile the linux RTL on windows:
cd rtl; make TARGET_OS=linux OPT=-FDc:\path\to\crossutils
- when compiling your source code, specify the target -Tlinux and add again -FDc:\path\to\crossutils
- If you need to link to external libraries, you'll need copies of those libraries on your Windows machine.

I think there is somewhere a cross-compile FAQ, but I don't have an URL.

Michael.

Reply by email

Ростислав Окулов
to Michael Van Canneyt
Show quoted text 14 lines
> I have FPC source code, Win32 binary release, and linux binary release. > How can I build linux program from win32 platform? You need a cross-linker and cross-assembler binaries. - Then you must compile the linux RTL on windows: cd rtl; make TARGET_OS=linux OPT=-FDc:\path\to\crossutils - when compiling your source code, specify the target -Tlinux and add again -FDc:\path\to\crossutils - If you need to link to external libraries, you'll need copies of those libraries on your Windows machine. I think there is somewhere a cross-compile FAQ, but I don't have an URL. Michael.

Thank you. I will try your advice =)

Reply by email

L505
to Ростислав Окулов: Thank you. I will try your advice =)

Another option is to use CoLinux if you find "true" cross compiling too much tedious work. CoLinux acts like a real operating system at your finger tips, which means command line programs can be tested immediately.. There are advantages to both methods. The bottom line is you are going to have to test your app on a real linux at some point (ultimately, there's no sense denying this), so I have figured the best way to compile is to remotely compile programs through the network over to a real linux hardware box or to a fake colinux box (not true cross compiling, just that you hit compile on the windows machine, and -boom-, it compiles on the linux machine or fake colinux machine).. I will release some tools for this at some point.

Reply by email

Vincent Snijders
to Michael Van Canneyt
Michael Van Canneyt wrote 11 lines
On Tue, 2 Aug 2005, [koi8-r] ????????? ?????? wrote: >> You need a cross-linker and cross-assembler binaries. > > Sorry, Where I can found them? I don't know; normally you must compile them yourself, but I suppose they can be downloaded from various sites.

Including the fpc ftp server:
ftp://ftp.freepascal.org/pub/fpc/contrib/cross/mingw/

win32crossbinutils2005.zip contains cross binutils from win32 to many different targets.

Read the BuildFAQ (google buildfaq.pdf) for an HOWTO setup a correct build environment (fpc.cfg).

Vincent.

Reply by email

Marco van de Voort
to Michael Van Canneyt: I don't know; normally you must compile them yourself, but I suppose they can be…
Show quoted text 7 lines
On Tue, 2 Aug 2005, [koi8-r] ????????? ?????? wrote: >> You need a cross-linker and cross-assembler binaries. > Sorry, Where I can found them? I don't know; normally you must compile them yourself, but I suppose they can be downloaded from various sites.

Like the FPC ftp site:

ftp://freepascal.stack.nl/pub/fpc/contrib/cross/mingw/

Most notably the win32crossbinutils2005 file.

Reply by email

Marco van de Voort
to Vincent Snijders: Including the fpc ftp server: ftp://ftp.freepascal.org/pub/fpc/contrib/cross/mingw/…
Show quoted text 14 lines
>> Sorry, Where I can found them? > > > I don't know; normally you must compile them yourself, but I suppose > they can be downloaded from various sites. Including the fpc ftp server: ftp://ftp.freepascal.org/pub/fpc/contrib/cross/mingw/ win32crossbinutils2005.zip contains cross binutils from win32 to many different targets. Read the BuildFAQ (google buildfaq.pdf) for an HOWTO setup a correct build environment (fpc.cfg).

Here are some old notes I still have to add to the buildfaq: note that the cross binutils have been update since (see above link)

----
To compile linux lazarus on windows: (the procedure from freebsd will not differ much, the cprt0 copying is not needed for FreeBSD)

Requirements:
- FPC 1.9.6 or higher. 1.9.4 migh work, but untested.
- ftp://freepascal.stack.nl/pub/fpc/contrib/cross/mingw/binutils-2.15-win32-i386-linux.zip
- A FPC CVS repository. (anything 1.9.6+ that is buildable will do)
- a lazarus tree. (anything buildable from the same period will do)
- Lots of libraries from the target linux system. One of the FPC servers is some SUSE, that's where I got the list below.

1) Download ftp://freepascal.stack.nl/pub/fpc/contrib/cross/mingw/binutils-2.15-win32-i386-linux.zip
2) extract it and move the i386* files to <fpcbindir>\bin\i386-win32 (e.g. c:\pp\bin\i386\win32)
3) enter FPC source dir
4) make clean
5) make OS_TARGET=linux all
6) make OS_TARGET=linux install INSTALL_PREFIX=<fpcbindir>
7) prepare the lib directory as in below instructions, I used d:\fpc\linuxlib to store them.
8) go to <fpcbindir>\units\i386-linux\rtl and copy cprt21.o over cprt0.o
9) enter lazarus dir
10) edit lazarus.pp and add {$linklib dl} and {$linklib gmodule} somewhere in the source.
11) make OS_TARGET=linux all OPT="-gl -Fld:\fpc\linuxlib -Xr/usr/lib -FL/usr/lib/ld-linux.so.2 "

If some linker error (most specifically linker can't find -l<something>) then

12) manually edit link.res if needed (see below for gtk remarks) and adapt the -l<x> names at the bottom of the files. I had to add -1.2 to all gtk libs, to keep them apart from gtk2
13) run ppas.bat to restart the linker

----------- Libraries

These are the libraries I collected for both lazarus and the textmode IDE (lazarus doesn't need pthread).

I gathered these from the target system, and renamed all from lib<name>.so.x.y to lib<name>.so.

libgcc.a and a few others are easiest found by doing gcc -v and look for a line like

"Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs"

then some of the libs are in /usr/lib/gcc-lib/i486-linux/3.3.5/ Some other good locations are /lib /usr/lib /usr/local/lib /usr/x11R6/lib and /opt/gnome/lib

libpthread.so.0
libdl.so
libc.so
ld-linux.so.2
crtbegin.o
crtbeginS.o
crtbeginT.o
crtend.o
crtendS.o
crtn.o
crti.o
libgcc.a
libX11.so
libXi.so
libglib-1.2.so
libgmodule-1.2.so.0
libgdk_pixbuf.so
libgdk-1.2.so
libgtk-1.2.so
libXext.so
libm.so
libdl.so.2
libgmodule-1.2.so

Note that some directories are duplicate, with a suffix and not. These are required because some other lib has a dependancy on that exact name (so the form lib<name>.so.x) we can't symlink on windows, so I simply copy it.

Making mistakes with renaming is not that bad, there will be chances to fix it. Make sure all crt* and a file "libc.so" are available, otherwise generating link.res will go wrong. (Yes, Peter, that was my fault :-)

In my case compilation for step 11 will go ok, but the linker will complain it can't find libgtk.so and the other libraries marked with -1.2 This is because on the target system, libgtk is gtk 2.0, while we want gtk1.2 for lazarus.

To fix this I manually added -1.2 to the corresponding -l lines in the bottom of the link.res file that was generated by step 11

Reply by email

Unknown author
to Marco van de Voort
Marco van de Voort wrote 14 lines
> >> Sorry, Where I can found them? > > > > > > I don't know; normally you must compile them yourself, but I suppose > > they can be downloaded from various sites. > > Including the fpc ftp server: > ftp://ftp.freepascal.org/pub/fpc/contrib/cross/mingw/ > > win32crossbinutils2005.zip contains cross binutils from win32 to many > different targets. > > Read the BuildFAQ (google buildfaq.pdf) for an HOWTO setup a correct > build environment (fpc.cfg).

And what about linuxcrossbinutils2005.tar.gz :)
Exists similar collection of cross bin utils on linux?

Petr

Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email