Sign in Join

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

Mailing lists / lazarus / 2014-08

How to crosscompile from linux to wince?

16 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

FreeMan

Hello,
I need crosscompile to this mobile system:

Windows CE.NET 5.0 (Core Version) operation systems Marvell CPU PXA270 312 Mhz proccessor

My IDE on kubuntu 14.04 x64, last svn fpc & lazarus. I need crosscompile to wince.

make clean all install INSTALL_PREFIX=/opt/freepascal/2.7.1 OS_TARGET=wince CPU_TARGET=i386
sudo make crossinstall OS_TARGET=wince CPU_TARGET=i386

is this right CPU_TARGET=i386 ? or what I have to do ?

I compiled fpc to
OS_TARGET=win32 CPU_TARGET=i386
and
OS_TARGET=win64 CPU_TARGET=x86_64

Thank you

Sven Barth
to FreeMan
"FreeMan" wrote 8 lines
Hello, I need crosscompile to this mobile system: Windows CE.NET 5.0 (Core Version) operation systems Marvell CPU PXA270 312 Mhz proccessor My IDE on kubuntu 14.04 x64, last svn fpc & lazarus. I need crosscompile

to wince.

make clean all install INSTALL_PREFIX=/opt/freepascal/2.7.1

OS_TARGET=wince CPU_TARGET=i386

sudo make crossinstall OS_TARGET=wince CPU_TARGET=i386 is this right CPU_TARGET=i386 ? or what I have to do ?

The PXA is an ARM processor, so you need to use "arm" as CPU target. Additionally you need the correct binutils. I don't know them for Ubuntu, but look for a package like cegcc-binutils or something like that. In the end you should have a cegcc-arm-as or similary named binary available of which you need to pass the prefix to the "make all" as well as parameter (in my example) "BINUTILSPREFIX=cegcc-arm-".
Perhaps you'll also need to adjust the CPU type as I don't know remember whether we changed that from the old default...

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140827/faf0207c/attachment.html>

FreeMan
to Sven Barth

Thank you for your answer, I think you said this

http://cegcc.sourceforge.net/about.html
http://cegcc.sourceforge.net/

I download binutils-2.24.tar.gz, make & install.

this is my command line for fpc:
make clean all install INSTALL_PREFIX=/opt/freepascal/2.7.1 OS_TARGET=wince CPU_TARGET=arm BINUTILSPREFIX=arm-cegcc

I get this eror:
system.pp(1778) Error: Assembler arm-cegccas not found, switching to external assembling
system.pp(1778) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted

Sven Barth wrote 13 lines
The PXA is an ARM processor, so you need to use "arm" as CPU target. Additionally you need the correct binutils. I don't know them for Ubuntu, but look for a package like cegcc-binutils or something like that. In the end you should have a cegcc-arm-as or similary named binary available of which you need to pass the prefix to the "make all" as well as parameter (in my example) "BINUTILSPREFIX=cegcc-arm-". Perhaps you'll also need to adjust the CPU type as I don't know remember whether we changed that from the old default... Regards, Sven
Sven Barth
to FreeMan
"FreeMan" wrote 7 lines
Thank you for your answer, I think you said this http://cegcc.sourceforge.net/about.html http://cegcc.sourceforge.net/ I download binutils-2.24.tar.gz, make & install.

Isn't there a precompiled package available for Ubuntu?

this is my command line for fpc: make clean all install INSTALL_PREFIX=/opt/freepascal/2.7.1

OS_TARGET=wince CPU_TARGET=arm BINUTILSPREFIX=arm-cegcc

I get this eror: system.pp(1778) Error: Assembler arm-cegccas not found, switching to

external assembling

system.pp(1778) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted

You must not forget the "-" at the end of "arm-cegcc-". It's a prefix afterall and the compiler does not automatically add a "-" for you.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140828/e556230c/attachment.html>

FreeMan
to Sven Barth

Thank you for important hint add last char "-"

Isn't there a precompiled package available for Ubuntu?

I'm using Kubuntu(kde)
I found in repository "gcc-arm-none-eabi" GCC cross compiler for ARM Cortex-A/R/M processors
"binutils-arm-none-eabi"
I installed this packets, under /user folder created "arm-linux-gnueabi" and "arm-linux-gnueabihf". "as" & "ld" application under "/user/arm-xxxxxx/bin/" folder. each one.

execute this command
make clean all install INSTALL_PREFIX=/opt/freepascal/2.7.1 OS_TARGET=wince CPU_TARGET=arm BINUTILSPREFIX=arm-linux-gnueabihf-

error is:

/bin/mkdir -p arm/units/arm-wince
/opt/freepascal/2.7.1/compiler/ppcrossarm -Twince -Parm -XParm-linux-gnueabihf- -Xr -Ur -Xs -O2 -n -Fuarm -Fusystems -Fu/opt/freepascal/2.7.1/rtl/units/arm-wince -Fiarm -FE. -FUarm/units/arm-wince -dRELEASE -darm -dGDB -dBROWSERLOG -Sew -darm -dGDB -dBROWSERLOG -Sew pp.pas
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/pp.o
pp.pas(238,36) Error: Illegal COFF Magic while reading /opt/freepascal/2.7.1/rtl/units/arm-wince/system.o pp.pas(238,36) Error: Illegal COFF Magic while reading /opt/freepascal/2.7.1/rtl/units/arm-wince/fpintres.o pp.pas(238,36) Error: Illegal COFF Magic while reading /opt/freepascal/2.7.1/rtl/units/arm-wince/objpas.o pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/globals.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/compiler.o
pp.pas(238,36) Error: Illegal COFF Magic while reading /opt/freepascal/2.7.1/rtl/units/arm-wince/windows.o pp.pas(238,36) Error: Illegal COFF Magic while reading /opt/freepascal/2.7.1/rtl/units/arm-wince/sysutils.o pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/cutils.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/cclasses.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/cfileutl.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/cpuinfo.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/globtype.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/version.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/systems.o
pp.pas(238,36) Error: Illegal COFF Magic while reading /opt/freepascal/2.7.1/rtl/units/arm-wince/dos.o
pp.pas(238,36) Error: Illegal COFF Magic while reading /opt/freepascal/2.7.1/rtl/units/arm-wince/sysconst.o pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/constexp.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/cstreams.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/comphook.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/finput.o
pp.pas(238,36) Error: Illegal COFF Magic while reading /opt/freepascal/2.7.1/rtl/units/arm-wince/math.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/verbose.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/options.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/fmodule.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/parser.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/symtable.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/assemble.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/link.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/dbgbase.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/import.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/export.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/tokens.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/pass_1.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/wpobase.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/wpo.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/cpupara.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/cpupi.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/cgcpu.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/cmsgs.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/switches.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/ogbase.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/symbase.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/symconst.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/symsym.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/symcpu.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/aasmbase.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/aasmtai.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/aasmdata.o
pp.pas(238,36) Error: Illegal COFF Magic while reading arm/units/arm-wince/owbase.o
pp.pas(238,36) Fatal: There were 50 errors compiling module, stopping Fatal: Compilation aborted

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140828/b9c0d18b/attachment.html>

Sven Barth
to FreeMan
"FreeMan" wrote 7 lines
Thank you for important hint add last char "-" > > Isn't there a precompiled package available for Ubuntu? I'm using Kubuntu(kde) I found in repository "gcc-arm-none-eabi" GCC cross compiler for ARM

Cortex-A/R/M processors

"binutils-arm-none-eabi"

No, that are not those I ment. So better stay with the self compiled binaries :)

I installed this packets, under /user folder created "arm-linux-gnueabi"

and "arm-linux-gnueabihf". "as" & "ld" application under "/user/arm-xxxxxx/bin/" folder. each one.

The "-linux-" part should already tell you that it isn't intended to use them for assembling code for WinCE.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140828/b30736c7/attachment.html>

FreeMan
to Sven Barth
Sven Barth wrote
No, that are not those I ment. So better stay with the self compiled binaries :)

Thank you Sven, I can compiled now,
command line is:
make clean all install INSTALL_PREFIX=/opt/freepascal/2.7.1 OS_TARGET=wince CPU_TARGET=arm BINUTILSPREFIX=arm-cegcc- sudo make crossinstall OS_TARGET=wince CPU_TARGET=arm BINUTILSPREFIX=arm-cegcc-

without problem, I open new project in lazarus IDE, In project options: Target OS -T "WinCE"
CPU Family -P "arm"
Processor -Cp (Default) {and other all same ARMV3...CORTEXM3} on test button click and Reult is:
ERROR: compiled FPC unit not found: system.ppu
ERROR: compiled FPC unit not found: sysutils.ppu
ERROR: compiled FPC unit not found: classes.ppu
ERROR: compiled FPC unit not found: avl_tree.ppu
ERROR: compiled FPC unit not found: zstream.ppu

Close project options via Ok Button, then this error is showing:

Compiler "/opt/freepascal/2.7.1/bin/fpc" does not support target arm-wince

and this errors click build project button, in Messages window: Compiling package FCL 1.0.1: Exit code 256, Errors: 1 Error: ppcarm can't be executed, error message: Failed to execute "ppcarm", error code: 127

I'm stuck again :S

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140828/f770cdca/attachment-0001.html>

Sven Barth
to FreeMan
"FreeMan" wrote
On 28-08-2014 15:54, Sven Barth wrote: > > No, that are not those I ment. So better stay with the self compiled

binaries :)

Show quoted text 5 lines
Thank you Sven, I can compiled now, command line is: make clean all install INSTALL_PREFIX=/opt/freepascal/2.7.1

OS_TARGET=wince CPU_TARGET=arm BINUTILSPREFIX=arm-cegcc-

sudo make crossinstall OS_TARGET=wince CPU_TARGET=arm

BINUTILSPREFIX=arm-cegcc-

You need to specify INSTALL_PREFIX for the crossinstall as well. The make file will not guess where you might want it to install its files ;)

Note: Because you didn't specify it you'll most likely need to clean up the files which were now copied to /share/fpc, etc. as the default prefix is "/" (compare with the folders in /opt/freepascal/2.7.1 to find out what you should remove)

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140828/cbfb9be9/attachment.html>

FreeMan
to Sven Barth

Thank you for your help,
I remove all fpc & lazarus and check my install scripts too. And now I can compile,

Test project is just open new project, change Target OS -T and Target CPU family -P
my Default setting are kubuntu x64
linux x64 -> compiled.
win32, i386 ->compiled.
win64 x86_64 ->compiled.
WinCE arm ->!!! NOT compiled.

I get this error in lazarus:

lazfileutils.pas(112,10) Error: Forward declaration not solved
"GetPhysicalFilename(const AnsiString;TPhysicalFilenameOnError):AnsiString;"
Sven Barth wrote 9 lines
You need to specify INSTALL_PREFIX for the crossinstall as well. The make file will not guess where you might want it to install its files ;) Note: Because you didn't specify it you'll most likely need to clean up the files which were now copied to /share/fpc, etc. as the default prefix is "/" (compare with the folders in /opt/freepascal/2.7.1 to find out what you should remove)
Sven Barth
to FreeMan
"FreeMan" wrote
Thank you for your help, I remove all fpc & lazarus and check my install scripts too. And now I

can compile,

Test project is just open new project, change Target OS -T and Target CPU

family -P

Show quoted text 9 lines
my Default setting are kubuntu x64 linux x64 -> compiled. win32, i386 ->compiled. win64 x86_64 ->compiled. WinCE arm ->!!! NOT compiled. I get this error in lazarus: lazfileutils.pas(112,10) Error: Forward declaration not solved

"GetPhysicalFilename(const AnsiString;TPhysicalFilenameOnError):AnsiString;"

From the error I'd say that it wasn't implemented for WinCE. You'll need to

file a bug report for Lazarus then...

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140830/71b8e259/attachment.html>

FreeMan
to Sven Barth

Thank you so much Sven,
I created issue #0026651.

Sven Barth wrote
From the error I'd say that it wasn't implemented for WinCE. You'll need to file a bug report for Lazarus then...
FreeMan
to FreeMan

When I try run my Application in Win CE, I get this error:

"Cannot find project1 (or one of its components); make sure the path and filename are correct and filename are correct and that all required libraries are available."
What I have todo or intall on wince?
And has anyone wince demo(s) for lazarus?

Thank you.

Paul Breneman
to FreeMan
FreeMan wrote 9 lines
When I try run my Application in Win CE, I get this error: "Cannot find project1 (or one of its components); make sure the path and filename are correct and filename are correct and that all required libraries are available." What I have todo or intall on wince? And has anyone wince demo(s) for lazarus? Thank you.

It isn't for Lazarus but there is a 3 MB zip with a mini-distribution of Free Pascal for WinCE near the bottom of this page: http://turbocontrol.com/easyfpgui.htm

Might be a useful troubleshooting tool if nothing else...

FreeMan
to Paul Breneman
Paul Breneman wrote 6 lines
It isn't for Lazarus but there is a 3 MB zip with a mini-distribution of Free Pascal for WinCE near the bottom of this page: http://turbocontrol.com/easyfpgui.htm Might be a useful troubleshooting tool if nothing else...

Thank you very much, I my test project work on wince now. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140902/21897b17/attachment.html>

Sven Barth
to FreeMan: When I try run my Application in Win CE, I get this error: "Cannot find project1 (or one…
"FreeMan" wrote
When I try run my Application in Win CE, I get this error: "Cannot find project1 (or one of its components); make sure the path and

filename are correct and filename are correct and that all required libraries are available."

What I have todo or intall on wince? And has anyone wince demo(s) for lazarus?

Are you trying on Windows Mobile or pure Windows CE? For the latter you AFAIK need an additional library. Take a look at the WinCE related entries on the Lazarus wiki as I currently can't remember which one...

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140902/3aecb646/attachment.html>

FreeMan
to Sven Barth
Sven Barth wrote 8 lines
Are you trying on Windows Mobile or pure Windows CE? For the latter you AFAIK need an additional library. Take a look at the WinCE related entries on the Lazarus wiki as I currently can't remember which one... Regards, Sven

Sorry, Your message received late to me :)
I tried on window mobile, yes you right, I added one dll and its work. But same exe and dlls not work on wince emulater, not importend for me this, just info.
lazarus wiki's old, many links died. My idea is, wiki web no good idea, 'cos people write detail info, example howto make wince application, but 2 years later all version changed and/or links died, versions changed, codes changed, screenshots changed etc.
and wiki pages has many pages but a few line can work. not just about this subject.
my solution for this , can use forum's page, because who looking for and info is old, can sent message and topic reupdated, wikis not like this.

Google look in maillist archive, so I'm writing here, In linux and lazarus 1.3 svn not compile to wince, Reported issue 0026651 maybe some on fix, if who use crosscompile wince.
I used codetyphon for xp, I made winxp x32 virtualbox image, and trying in, CodeTyphon 4.90 or 4.92 (some where write 4.90, some where 4.92) crossbuild, and so easy. Simple project, mean tbutton, tlabel, Tedit has work normally on wince. But if I'm not wrong CodeTyphon's code is lazarus code, so CodeTyphon's next version can have bug.

I need use sqlite db, codetyphon (probably lazarus codes) has some bugs too. for wince, still trying.

Thank you.