Sign in Join

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

Mailing lists / fpc-devel / 2019-01

fpc calls crosscompiler from older version

7 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Bart

Hi,

All of this is of course of my own doing but is it expected?

I built and installed fpc trunk, just the 32-bit version. I have 3.0.4 32-bit, and for that release I also have the win32-win64 cross-compiler installed.

Having forgotten that I did not build the win32-win64 cross-compiler from trunk, I issued a
fpc -TWin64 -Px86_64 test.pas.
My path looks like C:\pp\bin\i386-win32;%oldpath%
(Trunk resides in C:\pp\bin\i386-win32)
And, as you can guess, the path to the 3.0.4 binaries is on %oldpath% And, lo and behold, fpc trunk executed the cross-compier from 3.0.4.

I can understand why.
But, is this desired behaviour?
A message that no cross-compiler for the current version of the compiler was installed would make a little more sense to me.

Bart

Reply by email

Florian Klämpfl
to Bart
Bart wrote 21 lines
Hi, All of this is of course of my own doing but is it expected? I built and installed fpc trunk, just the 32-bit version. I have 3.0.4 32-bit, and for that release I also have the win32-win64 cross-compiler installed. Having forgotten that I did not build the win32-win64 cross-compiler from trunk, I issued a fpc -TWin64 -Px86_64 test.pas. My path looks like C:\pp\bin\i386-win32;%oldpath% (Trunk resides in C:\pp\bin\i386-win32) And, as you can guess, the path to the 3.0.4 binaries is on %oldpath% And, lo and behold, fpc trunk executed the cross-compier from 3.0.4. I can understand why. But, is this desired behaviour? A message that no cross-compiler for the current version of the compiler was installed would make a little more sense to me.

Well, yes. fpc executes what it find. This is how it works currently. The fpc executable has not to match with the real compiler executable.

Reply by email

Tomas Hajny
to Bart
Bart wrote 7 lines
On Thu, Jan 3, 2019 at 6:36 PM Florian Klämpfl wrote: > The fpc executable has not to match with the real compiler executable. By design? I find that a bit odd.

By design or not, the fpc executable holds no version information as of now, IIRC. Its functionality is very simple and there are almost no differences among the builds distributed with various FPC releases (the biggest difference probably being the list of supported architectures and the corresponding compiler names).

Obviously, it might be changed if needed. The question is if people really want such a warning. Note that it would work only if you rebuild the fpc executable as well, so I'm not sure if it would make any difference in your scenario.

Tomas

Reply by email

Bart
to Tomas Hajny
PM Tomas Hajny wrote
By design or not, the fpc executable holds no version information as of now, IIRC.

OK.

Obviously, it might be changed if needed. The question is if people really want such a warning.

Probably not, since I'm the first one to raise this ;-)

Note that it would work only if you rebuild the fpc executable as well, so I'm not sure if it would make any difference in your scenario.

Well, I would think that make all, followed by make install would generate a new fpc.exe as well.

Bart

Reply by email

Tomas Hajny
to Bart
Bart wrote
On Thu, Jan 3, 2019 at 7:06 PM Tomas Hajny wrote:

.
.

> Obviously, it might be changed if needed. The question is if people > really want such a warning. Probably not, since I'm the first one to raise this ;-)

That was indeed my thought as well. ;-)

In any case, _if_ doing it, I would do it by adding -Fu and -Fi pointing to the upper (i.e. compiler) directory to the Makefile rule for building the fpc executable, adding a possibility to pass the version information from fpc to the respective compiler by adding something like '-V?' + full_version_string to PPCCommandLine _if_ -V parameter has not been passed to the fpc executable already (it wouldn't make much sense otherwise), adding a new warning message to msg/errore.msg and adding handling of the new parameter to options.pas in the compiler directory. Obviously, it would only work for compiler versions having this functionality included, i.e. you couldn't safeguard against having really old versions invoked that way.

Show quoted text 6 lines
> Note that it would work only if you rebuild the fpc > executable as well, so I'm not sure if it would make any difference in > your scenario. Well, I would think that make all, followed by make install would generate a new fpc.exe as well.

Yes, that should do that.

Tomas

Reply by email

Bart
to Tomas Hajny
AM Tomas Hajny wrote 11 lines
In any case, _if_ doing it, I would do it by adding -Fu and -Fi pointing to the upper (i.e. compiler) directory to the Makefile rule for building the fpc executable, adding a possibility to pass the version information from fpc to the respective compiler by adding something like '-V?' + full_version_string to PPCCommandLine _if_ -V parameter has not been passed to the fpc executable already (it wouldn't make much sense otherwise), adding a new warning message to msg/errore.msg and adding handling of the new parameter to options.pas in the compiler directory. Obviously, it would only work for compiler versions having this functionality included, i.e. you couldn't safeguard against having really old versions invoked that way.

That sounds like too much of a hassle.

Thanks for explaining.

I'll just try to remember to build and install the cross-compiler as well when I build trunk.

Bart

Reply by email