[fpc-pascal] FPC 64bit for windows

Nikolay Nikolov nickysn at gmail.com
Fri May 19 01:38:34 CEST 2017



On 05/15/2017 02:41 PM, Graeme Geldenhuys wrote:
> On 2017-05-15 11:59, James Richters wrote:
>> When I try to install 64 bit windows
>> version, I don't have this anymore
>
> The Free Pascal project, for some weird reason, only ships a 64-bit 
> Windows cross-compiler. So you need both the 32-bit and 64-bit 
> installs. I don't know why they do this.
Is there an _actual_ problem with that, or is it only imaginary? The 
32-to-64 crosscompiler works perfectly fine and has no known 
disadvantages. On the other hand, the 64-bit compiler cannot 
crosscompile 32-bit fpc, because it doesn't support the 80-bit extended 
float type, which is only supported by the x87 FPU, but not by SSE. So, 
basically, if you're a FPC compiler developer and you're using windows 
as your main platform, the 64-bit native fpc is inferior. And I don't 
think anyone has a problem running a 32-bit hosted compiler on a 64-bit 
windows OS - there are simply no known issues with that under any 64-bit 
windows version that I know of.
>
> Simply compile your own _full_ 64-bit FPC, by installing a previous or 
> current stable 32-bit release. Download the latest stable release 
> source code. And then build a new 64-bit target compiler and tools.
Or, alternatively, you can simply install the 32-bit to 64-bit 
crosscompiler on top of your already working install and then 
crosscompile from the commandline with:

  ppcrossx64 program.pas

without any need to compile fpc from sources. It won't work from the 
IDE, though, but compiling your program from the command line, when you 
want to build a 64-bit .exe shouldn't be hard.

Of course, there's no problem in following Graeme's route and compiling 
the compiler yourself (and it might be helpful in the long run to learn 
how to compile the compiler), but installing the already packaged 
32-to-64 crosscompiler package might be easier to start with.
>
> It might sound complicate, but the process is pretty easy. Here is a 
> batch file I normally use to do this for me.
>
>
> ...
>
> But again, I don't know why the FPC team doesn't make an official full 
> 64-bit Windows release??
Because it is inferior, since it cannot build a 32-bit FPC. Imagine your 
advice for compiling the 64-bit native compiler, using the 32-bit 
starting compiler. What would happen if you had to go the other way 
around? Your advice only works, because the 32-bit compiler can compile 
both the 32-bit and 64-bit version of FPC. If you were to start with the 
64-bit version, it won't be able to compile the 32-bit version (under 
windows, that is; under linux, it works, because 64-bit linux has abi 
support for the 80-bit extended x87 fpu type and there we usually ship a 
native 64-bit compiler). It may not matter for you, but is a huge 
showstopper for any FPC compiler developer that uses Windows.

Nikolay



More information about the fpc-pascal mailing list