Sign in Join

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

Mailing lists / lazarus / 2012-02

Cross compiling LCL win32=>win64; update wiki?

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Reinier Olislagers

Hi list,

I'm trying to cross compile LCL to win64 so users of fpcup can generate both x86 and x64 binaries.

The wiki [1] says to check your compiler, e.g. with fpc -Twin64 -Px86_64 test.pas. This works.
Then: using the IDE:
Open Tools / Configure Build Lazarus / Advanced Build Options. Set Target OS and Target CPU.
Set LCL and Package registration to Build (the middle radio button) and all other to None (left radio buttons).
Click the Build button.

The Build FAQ says that make clean/distclean only works for the architecture you indicate. So a make clean or distclean for win64/x86_64 seems advisable in order to clean up anything left over from previous attempts.

1) Does the above translate in a makefile like this: make distclean LCL_PLATFORM=win64 CPU_TARGET=x86_64 OS_TARGET=win64 (this wouldn't interfere with my existing 32 bit LCL and IDE, would it?)

make packager/registration lazutils lcl LCL_PLATFORM=win64 CPU_TARGET=x86_64 OS_TARGET=win64

If so, I'll update the wiki with a note on building the LCL using the command line.

2) If I wanted to have an IDE as well, could I just build make distclean bigide with those options?

3) Unrelated... I can take this to the FPC list as well.. The FPC manual, chapter 5 on -Txxx, says you can find out supported compilers using -i; for me (FPC 2.7.1):
cd \development\fpc
fpc -i
it shows e.g. Win32 for i386, but not win64.
However, calling ppcrossx64 -i does show Win64 for x64. 2 questions:
3.1) Am I interpreting the docs incorrectly? I thought fpc would spit out the info for all compilers it has in its directory. 3.2) How do I go from the description, e.g. "OS/2 via EMX" to the required -T setting, e.g. -Tos2?

Note: I'm currently misusing a command like
lazbuild --cpu=x86_64 --operating-system==win64 --widgetset=win32 --build-all --build-ide-options=
to get a 64 bit IDE/LCL, then doing the same but for i386/win32 to return to a 32 bit IDE.
Seems to work but also like a bit of overkill ;)

Thanks,
Reinier

[1]
http://wiki.lazarus.freepascal.org/Cross_compiling#Cross_compiling_the_LCL

Reply by email

Sven Barth
to Reinier Olislagers

Am 19.02.2012 07:23 schrieb "Reinier Olislagers" <

Show quoted text 15 lines
: Hi list, I'm trying to cross compile LCL to win64 so users of fpcup can generate both x86 and x64 binaries. The wiki [1] says to check your compiler, e.g. with fpc -Twin64 -Px86_64 test.pas. This works. Then: using the IDE: Open Tools / Configure Build Lazarus / Advanced Build Options. Set Target OS and Target CPU. Set LCL and Package registration to Build (the middle radio button) and all other to None (left radio buttons). Click the Build button.

Note: this doesn't describe the situation in trunk anymore.

Show quoted text 12 lines
The Build FAQ says that make clean/distclean only works for the architecture you indicate. So a make clean or distclean for win64/x86_64 seems advisable in order to clean up anything left over from previous attempts. 1) Does the above translate in a makefile like this: make distclean LCL_PLATFORM=win64 CPU_TARGET=x86_64 OS_TARGET=win64 (this wouldn't interfere with my existing 32 bit LCL and IDE, would it?) make packager/registration lazutils lcl LCL_PLATFORM=win64 CPU_TARGET=x86_64 OS_TARGET=win64

AFAIK this should be LCL_PLATFORM=win32 as the code is shared with the win32 platform (and no, they won't interfere with eachother)

Show quoted text 10 lines
3) Unrelated... I can take this to the FPC list as well.. The FPC manual, chapter 5 on -Txxx, says you can find out supported compilers using -i; for me (FPC 2.7.1): cd \development\fpc fpc -i it shows e.g. Win32 for i386, but not win64. However, calling ppcrossx64 -i does show Win64 for x64. 2 questions: 3.1) Am I interpreting the docs incorrectly? I thought fpc would spit out the info for all compilers it has in its directory.

You are interpreting this correctly. Using -P you tell the fpc binary which compiler to call which will inturn print it's info (it's the same output you'd achieve if you'd call the ppc* binary with -i yourself). This is by design (note: calling fpc without -P will simply call the default compiler binary for the platform fpc was compiled for)

3.2) How do I go from the description, e.g. "OS/2 via EMX" to the required -T setting, e.g. -Tos2?

It might be better to call FPC with -h then and fetch all lines starting with -T (this has the same platform restrictions as the -i variant)

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

Reply by email

Reinier Olislagers
to Sven Barth
Sven Barth wrote
Am 19.02.2012 07:23 schrieb "Reinier Olislagers" < <mailto:>>:

<snip description of Wiki LCL crosscompile instructions>

Note: this doesn't describe the situation in trunk anymore.

<snip>>

Show quoted text 10 lines
> 1) Does the above translate in a makefile like this: > make distclean LCL_PLATFORM=win64 CPU_TARGET=x86_64 OS_TARGET=win64 > (this wouldn't interfere with my existing 32 bit LCL and IDE, would it?) > > make packager/registration lazutils lcl LCL_PLATFORM=win64 > CPU_TARGET=x86_64 OS_TARGET=win64 > AFAIK this should be LCL_PLATFORM=win32 as the code is shared with the win32 platform (and no, they won't interfere with eachother)

Ok, thanks, will give that a go.

Show quoted text 16 lines
> 3) Unrelated... I can take this to the FPC list as well.. > The FPC manual, chapter 5 on -Txxx, says you can find out supported > compilers using -i; for me (FPC 2.7.1): > cd \development\fpc > fpc -i > it shows e.g. Win32 for i386, but not win64. > However, calling ppcrossx64 -i does show Win64 for x64. > 2 questions: > 3.1) Am I interpreting the docs incorrectly? I thought fpc would spit > out the info for all compilers it has in its directory. You are interpreting this correctly. Using -P you tell the fpc binary which compiler to call which will inturn print it's info (it's the same output you'd achieve if you'd call the ppc* binary with -i yourself). This is by design (note: calling fpc without -P will simply call the default compiler binary for the platform fpc was compiled for)

Ok, that's clear.

Show quoted text 5 lines
> 3.2) How do I go from the description, e.g. "OS/2 via EMX" to the > required -T setting, e.g. -Tos2? It might be better to call FPC with -h then and fetch all lines starting with -T (this has the same platform restrictions as the -i variant)

My regex skills are not that good, but
fpcdev -h | grep "^ \-T"
already gives good results, thanks.

Thanks again, Sven!

Reinier

Reply by email

Sven Barth
to Reinier Olislagers
Reinier Olislagers wrote 27 lines
>> 3) Unrelated... I can take this to the FPC list as well.. >> The FPC manual, chapter 5 on -Txxx, says you can find out supported >> compilers using -i; for me (FPC 2.7.1): >> cd \development\fpc >> fpc -i >> it shows e.g. Win32 for i386, but not win64. >> However, calling ppcrossx64 -i does show Win64 for x64. >> 2 questions: >> 3.1) Am I interpreting the docs incorrectly? I thought fpc would spit >> out the info for all compilers it has in its directory. > > You are interpreting this correctly. Using -P you tell the fpc binary > which compiler to call which will inturn print it's info (it's the same > output you'd achieve if you'd call the ppc* binary with -i yourself). > This is by design (note: calling fpc without -P will simply call the > default compiler binary for the platform fpc was compiled for) Ok, that's clear. >> 3.2) How do I go from the description, e.g. "OS/2 via EMX" to the >> required -T setting, e.g. -Tos2? > > It might be better to call FPC with -h then and fetch all lines starting > with -T (this has the same platform restrictions as the -i variant) My regex skills are not that good, but fpcdev -h | grep "^ \-T" already gives good results, thanks.

Your tools is written in Pascal? Then you could just read the output of "fpc -h", Trim() every line and check whether Pos('-T',line) is 1. If that is the case then you can process that line (no need for regular expressions here ^^). [though using regular expressions in FPC isn't that complicated ;) ]

Regards,
Sven

Reply by email

Reinier Olislagers
to Sven Barth
Sven Barth wrote 11 lines
On 19.02.2012 13:22, Reinier Olislagers wrote: > My regex skills are not that good, but > fpcdev -h | grep "^ \-T" > already gives good results, thanks. Your tools is written in Pascal? Then you could just read the output of "fpc -h", Trim() every line and check whether Pos('-T',line) is 1. If that is the case then you can process that line (no need for regular expressions here ^^). [though using regular expressions in FPC isn't that complicated ;) ]

Thanks Sven, yes, I wasn't really going to use regexes for this ;)

Having to struggle with a Dutch postcode detector regex was awful enough... but I really like the fact that we now have the "big" Sorokin regex unit available in FPC...

Thanks,
Reinier

Reply by email

Reinier Olislagers
to Sven Barth: Am 19.02.2012 07:23 schrieb "Reinier Olislagers" < Note: this doesn't describe the…
Sven Barth wrote 12 lines
Am 19.02.2012 07:23 schrieb "Reinier Olislagers" < <mailto:>>: > The wiki [1] says to check your compiler, e.g. with fpc -Twin64 -Px86_64 > test.pas. This works. > Then: using the IDE: > Open Tools / Configure Build Lazarus / Advanced Build Options. > Set Target OS and Target CPU. > Set LCL and Package registration to Build (the middle radio button) > and all other to None (left radio buttons). > Click the Build button. Note: this doesn't describe the situation in trunk anymore.

Updated wiki:
http://wiki.lazarus.freepascal.org/Cross_compiling#Cross_compiling_the_LCL Needs to be tested (bombed somewhere in my Lazarus trunk, so may need to be refined)

Show quoted text 10 lines
> 1) Does the above translate in a makefile like this: > make distclean LCL_PLATFORM=win64 CPU_TARGET=x86_64 OS_TARGET=win64 > (this wouldn't interfere with my existing 32 bit LCL and IDE, would it?) > > make packager/registration lazutils lcl LCL_PLATFORM=win64 > CPU_TARGET=x86_64 OS_TARGET=win64 > AFAIK this should be LCL_PLATFORM=win32 as the code is shared with the win32 platform (and no, they won't interfere with eachother)

Added to wiki

Reply by email