Sign in Join

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

Mailing lists / fpc-devel / 2009-10

Compiling fpc subversion on a AMD64 box with Win 7 64 bit OS

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Dimitrios Chr. Ioannidis

Hi all,

i have to ask what is the official process to compile the fpc svn on a AMD64 machine and 64-bit OS.

I have a machine with AMD Athlon 64 X2 Dual Core and Windows 7 Professional 64-bit OS and i've made a directory structure like this :

RootPath = C:\Users\dimitris\Documents\Programming\FreePascal

<RootPath>\binutils\arm-wince (from
http://svn.freepascal.org/svn/fpcbuild/trunk/install/crossbinwce) <RootPath>\binutils\i386-win32 (from
http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw32) <RootPath>\binutils\x86_64-win64 (from
http://svn.freepascal.org/svn/fpcbuild/trunk/install/binw64) <RootPath>\fpc
<RootPath>\fpc\source (from
http://svn.freepascal.org/svn/fpc/tags/release_2_4_0_rc1 )

Also, in the binutils dir i have a ppc386.exe 2.2.4 compiler for i386-win32.

I open a cmd prompt with administrators rights and i add : <RootPath>\fpc\source>set
path=C:\Users\dimitris\Documents\Programming\FreePascal\binutils\i386-win32;

C:\Users\dimitris\Documents\Programming\FreePascal\fpc\source\utils\fpcm;%path% <RootPath>\fpc\source>

Now can someone fill the blanks so i can have a native x86_64 compiler a i386 cross compiler and a arm-wince cross compiler ?

regards,

Dimitrios Chr. Ioannidis

Reply by email

Jonas Maebe
to Dimitrios Chr. Ioannidis
Dimitrios Chr. Ioannidis wrote 12 lines
Also, in the binutils dir i have a ppc386.exe 2.2.4 compiler for i386-win32. I open a cmd prompt with administrators rights and i add : <RootPath>\fpc\source>set path=C:\Users\dimitris\Documents \Programming\FreePascal\binutils\i386-win32; C:\Users\dimitris\Documents\Programming\FreePascal \fpc\source\utils\fpcm;%path% <RootPath>\fpc\source> Now can someone fill the blanks so i can have a native x86_64 compiler a i386 cross compiler and a arm-wince cross compiler ?

You cannot build an i386 cross-compiler on Win64, because the "extended" floating point type is not supported by FPC on Win64 (because the x87, which is required for it, has been deprecated by Microsoft on x86_64), and because the compiler does not yet internally emulate required floating point types not supported by the host platform. For an i386/Win32 compiler, you have to build/use a 32 bit compiler.

So:

* native x86_64 compiler (assuming your fpc.exe in the path is an x86_64 version)
make clean all -j 2
make FPC=\fpc\source\directory\compiler\ppcx64 install INSTALL_PREFIX= \path\where\you\want\to\install

* 'native' i386 compiler
make FPC=\path\to\win32\version\of\ppc386.exe clean all -j 2 make FPC=\fpc\source\compiler\ppc386 install INSTALL_PREFIX=\path\where \you\want\to\install

* ARM/wince cross-compiler
make CPU_TARGET=arm OS_TARGET=wince CROSSOPT="-FD\binutils\arm-wince" clean all -j 2
make FPC=\fpc\source\compiler/ppcrossarm CROSSOPT="-FD\binutils\arm- wince" INSTALL_PREFIX=\path\where\you\want\to\install CROSSINSTALL=1 install

(well, the above should work anyway; I've never built FPC under Windows)

For further information and in case things don't work immediately, please consult the build faq first: http://www.stack.nl/~marcov/buildfaq.pdf

Jonas

Reply by email

Dimitrios Chr. Ioannidis
to Jonas Maebe

Jonas Hi,

Show quoted text 23 lines
On 30 Oct 2009, at 14:36, Dimitrios Chr. Ioannidis wrote: > Also, in the binutils dir i have a ppc386.exe 2.2.4 compiler for > i386-win32. > I > open a cmd prompt with administrators rights and i add : > <RootPath>\fpc\source>set > path=C:\Users\dimitris\Documents\Programming\FreePascal\binutils\i386-win32; > > > C:\Users\dimitris\Documents\Programming\FreePascal\fpc\source\utils\fpcm;%path% > > <RootPath>\fpc\source> > > Now can someone fill the blanks so i can have a native x86_64 compiler > a i386 cross compiler and a arm-wince cross compiler ? You cannot build an i386 cross-compiler on Win64, because the "extended" floating point type is not supported by FPC on Win64 (because the x87, which is required for it, has been deprecated by Microsoft on x86_64), and because the compiler does not yet internally emulate required floating point types not supported by the host platform. For an i386/Win32 compiler, you have to build/use a 32 bit compiler.

Ok, understood.

* native x86_64 compiler (assuming your fpc.exe in the path is an x86_64 version) * 'native' i386 compiler * ARM/wince cross-compiler

In the above case i will end up with two dir's in fpc\bin. One i386-win32 and one x86_64-win64. How can i use that schema with Lazarus and fpc.exe ? It's more user friendly to change the project compiler options for different os/cpu compination than to have to do it in lazarus options. At least i didn't read somewhere how to solve this.

At the moment i build a 'native' i386-win32 compiler and with it i cross compile for x86_64 and arm-wince.

For further information and in case things don't work immediately, please consult the build faq first: http://www.stack.nl/~marcov/buildfaq.pdf

I already did. I even printed it.

PS: In case you missed it i had to add the path of the fpcm util cause the build process required it but couldn't find it.

regards,

Dimitrios Chr. Ioannidis

Reply by email

Jonas Maebe
to Dimitrios Chr. Ioannidis
Dimitrios Chr. Ioannidis wrote 8 lines
> * native x86_64 compiler (assuming your fpc.exe in the path is an > x86_64 version) > * 'native' i386 compiler > * ARM/wince cross-compiler In the above case i will end up with two dir's in fpc\bin. One i386- win32 and one x86_64-win64. How can i use that schema with Lazarus and fpc.exe ?

You can use fpc's -P option to select the target cpu, e.g. "fpc -P arm" will make fpc execute "ppcarm.exe" if fpc's native architecture is ARM, and ppcrossarm.exe if it's native architecture is something different (except on Mac OS X, because there this scheme is not required due to the concept of fat binaries -- although we don't make active use of that yet). I have no idea which directories fpc.exe searches by default under Windows for these compiler binaries. It should at least look in the same directory as where fpc.exe is located. On Unix, we put symlinks to the other compiler binaries in that same directory. You can try looking at the source of compiler/ utils/fpc.pp, it shouldn't be very complex.

It's more user friendly to change the project compiler options for different os/cpu compination than to have to do it in lazarus options.

I think working around the IDE's internal configuration can lead to hidden problems (since the IDE assumes that you are still compiling for a different architecture). I would strongly recommend against doing that, and if you still do it I would always test with a "proper" configuration before reporting any bugs.

PS: In case you missed it i had to add the path of the fpcm util cause the build process required it but couldn't find it.

The build process always assumes that you have a full FPC install of the previous release available.

Jonas

Reply by email

Dimitrios Chr. Ioannidis
to Jonas Maebe

Jonas Hi,

O/H Jonas Maebe έγραψε:

Show quoted text 21 lines
On 30 Oct 2009, at 15:28, Dimitrios Chr. Ioannidis wrote: >> * native x86_64 compiler (assuming your fpc.exe in the path is an >> x86_64 version) >> * 'native' i386 compiler >> * ARM/wince cross-compiler > > In the above case i will end up with two dir's in fpc\bin. One > i386-win32 and one x86_64-win64. How can i use that schema with > Lazarus and fpc.exe ? You can use fpc's -P option to select the target cpu, e.g. "fpc -P arm" will make fpc execute "ppcarm.exe" if fpc's native architecture is ARM, and ppcrossarm.exe if it's native architecture is something different (except on Mac OS X, because there this scheme is not required due to the concept of fat binaries -- although we don't make active use of that yet). I have no idea which directories fpc.exe searches by default under Windows for these compiler binaries. It should at least look in the same directory as where fpc.exe is located. On Unix, we put symlinks to the other compiler binaries in that same directory. You can try looking at the source of compiler/utils/fpc.pp, it shouldn't be very complex.

I'll do that, thanks.

Show quoted text 8 lines
> It's more user friendly to change the project compiler options for > different os/cpu compination than to have to do it in lazarus options. I think working around the IDE's internal configuration can lead to hidden problems (since the IDE assumes that you are still compiling for a different architecture). I would strongly recommend against doing that, and if you still do it I would always test with a "proper" configuration before reporting any bugs.

I've done it a lot with a i386-win32 compiler and a cross arm compiler builded with it. The Lazarus IDE supports fine that configuration. You just change the project compiler options (widget and target platform in code page) and the project is compiled for that conf. The new configuration with a i386-win32 compiler, a x86_64 cross compiler and a arm-wince cross compiler with the Lazarus IDE works. But, off course advise noted it. You should know better than me.

Show quoted text 5 lines
> PS: In case you missed it i had to add the path of the fpcm util cause > the build process required it but couldn't find it. The build process always assumes that you have a full FPC install of the previous release available.

If it's not difficult maybe this can change ? Or there is no need ? Personally i prefer a "naked" system with only the sources plus the ppcXXXX.exe executable to build my dev system.

regards,

Dimitrios Chr. Ioannidis

Reply by email

Marco van de Voort
to Dimitrios Chr. Ioannidis

In our previous episode, Dimitrios Chr. Ioannidis said:

Show quoted text 6 lines
> The build process always assumes that you have a full FPC install of the > previous release available. If it's not difficult maybe this can change ? Or there is no need ? Personally i prefer a "naked" system with only the sources plus the ppcXXXX.exe executable to build my dev system.

It can be done with some minimal manual tricks. It is hard to support such a system though.

Reply by email

Florian Klaempfl
to Dimitrios Chr. Ioannidis: Ok, understood. In the above case i will end up with two dir's in fpc\bin. One i386-win32…
Show quoted text 7 lines
> * native x86_64 compiler (assuming your fpc.exe in the path is an > x86_64 version) > * 'native' i386 compiler > * ARM/wince cross-compiler In the above case i will end up with two dir's in fpc\bin. One i386-win32 and one x86_64-win64.

Just use a cross x86-64 compiler. There is no reason to use a native 64 bit compiler as long as your compilation process needs no more than 2 GB (3 GB) of ram.

Reply by email