Recent

Author Topic: Issue of building fpc_trunk and lazarus_trunk x64 for Windows  (Read 5752 times)

zoltanleo

  • Sr. Member
  • ****
  • Posts: 486
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #15 on: May 04, 2020, 06:39:37 pm »
Make info in the FPC source tree please, but this
...
Try to remove the git directory temporarily from the PATH, and retry again.

Code: DOS  [Select][+][-]
  1. C:\Users\leyba>set path=d:\Archive\development\fpc_trunk_x64\bin\x86_64-win64;%path%
  2.  
  3. C:\Users\leyba>echo %path%
  4. d:\Archive\development\fpc_trunk_x64\bin\x86_64-win64;c:\;d:\;C:\Program Files\Pandoc;c:\Program Files\TortoiseSVN\bin;c:\Windows\System32
  5.  
  6. C:\Users\leyba>cd /d d:\Archive\development\fpc_trunk_x64
  7.  
  8. d:\Archive\development\fpc_trunk_x64>make info
  9.  
  10. == Package info ==
  11. Package Name..... fpc
  12. Package Version.. 3.3.1
  13.  
  14. == Configuration info ==
  15.  
  16. FPC.......... d:/Archive/development/fpc_trunk_x64/bin/x86_64-win64/ppcx64.exe
  17. FPC Version.. 3.3.1
  18. Source CPU... x86_64
  19. Target CPU... x86_64
  20. Source OS.... win64
  21. Target OS.... win64
  22. Full Source.. x86_64-win64
  23. Full Target.. x86_64-win64
  24. SourceSuffix. x86_64-win64
  25. TargetSuffix. x86_64-win64
  26. FPC fpmake... d:/Archive/development/fpc_trunk_x64/bin/x86_64-win64/ppcx64.exe
  27.  
  28. == Directory info ==
  29.  
  30. Required pkgs...
  31.  
  32. Basedir......... d:/Archive/development/fpc_trunk_x64
  33. FPCDir.......... d:/Archive/development/fpc_trunk_x64
  34. CrossBinDir.....
  35. UnitsDir........ ./units/x86_64-win64
  36. PackagesDir..... . ./packages
  37.  
  38. GCC library.....
  39. Other library...
  40.  
  41. == Tools info ==
  42.  
  43. As........ as
  44. Ld........ ld
  45. Ar........ ar
  46. Rc........ rc
  47.  
  48. Mv........ d:/Archive/development/fpc_trunk_x64/bin/x86_64-win64/mv.exe
  49. Cp........ d:/Archive/development/fpc_trunk_x64/bin/x86_64-win64/cp.exe
  50. Rm........ d:/Archive/development/fpc_trunk_x64/bin/x86_64-win64/rm.exe
  51. GInstall.. d:/Archive/development/fpc_trunk_x64/bin/x86_64-win64/ginstall.exe
  52. Echo...... d:/Archive/development/fpc_trunk_x64/bin/x86_64-win64/gecho.exe
  53. Shell..... sh.exe
  54. Date...... d:/Archive/development/fpc_trunk_x64/bin/x86_64-win64/gdate.exe
  55. FPCMake... d:/Archive/development/fpc_trunk_x64/bin/x86_64-win64/fpcmake.exe
  56. PPUMove... d:/Archive/development/fpc_trunk_x64/bin/x86_64-win64/ppumove.exe
  57. Zip....... __missing_command_ZIPPROG
  58.  
  59. == Object info ==
  60.  
  61. Target Loaders........
  62. Target Units..........
  63. Target Implicit Units.
  64. Target Programs.......
  65. Target Dirs........... compiler rtl utils packages installer
  66. Target Examples.......
  67. Target ExampleDirs....
  68.  
  69. Clean Units.........
  70. Clean Files.........

Now I'm trying to build Lazarus again (I tried different switch options):
Code: DOS  [Select][+][-]
  1. d:\Archive\development\lazarus_trunk_x64>make clean all OPT="-glw2" OS_TARGET=win64 CPU_TARGET=x86_64 CPU_SOURCE=x86_64 OS_SOURCE=win64

Now *.gdb files are no longer there, but when I try to start startlazarus, I get the same error %)
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

JiaXing

  • Jr. Member
  • **
  • Posts: 75
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #16 on: May 04, 2020, 07:15:16 pm »
Might be stupid but try this: copy lazarus.exe into lazarus in the same dir (remove the .exe extension) and try startlazarus again. If still fail please check if run lazarus.exe directly could open the ide.
I'm subscribed to the church of 440bx. Say no to OOP  :P

zoltanleo

  • Sr. Member
  • ****
  • Posts: 486
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #17 on: May 04, 2020, 07:35:53 pm »
Might be stupid but try this: copy lazarus.exe into lazarus in the same dir (remove the .exe extension) and try startlazarus again.
This may seem strange, but renaming lazarus.exe to lazarus (without the extension) solved the problem. Why? I got the feeling that startlazarus is trying to run an executable lazarus without expansion.

please check if run lazarus.exe directly could open the ide.
The launch of Lazarus.exe is also successful. But after each rebuild, the IDE launches startlazarus.exe and the situation repeats itself again.
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

JiaXing

  • Jr. Member
  • **
  • Posts: 75
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #18 on: May 04, 2020, 07:39:15 pm »
Might be stupid but try this: copy lazarus.exe into lazarus in the same dir (remove the .exe extension) and try startlazarus again.
This may seem strange, but renaming lazarus.exe to lazarus (without the extension) solved the problem. Why? I got the feeling that startlazarus is trying to run an executable lazarus without expansion.

I think it's a mistake of startlazarus. On Linux, executable has no extension. It's expecting the same thing on Windows. Might you file a bug report?
I'm subscribed to the church of 440bx. Say no to OOP  :P

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #19 on: May 04, 2020, 07:49:04 pm »
I think it's a mistake of startlazarus. On Linux, executable has no extension. It's expecting the same thing on Windows. Might you file a bug report?

Startlazarus (really the TLazarusManager object it uses) always uses GetExeExt to build the filename so it shouldn't be looking for a Unix filename in Windows. Something else must be wrong.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

zoltanleo

  • Sr. Member
  • ****
  • Posts: 486
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #20 on: May 04, 2020, 07:52:35 pm »
Something else must be wrong.
Maybe I should post this question on the Lazarus mailing list?
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #21 on: May 05, 2020, 12:53:42 pm »
I can confirm this very interesting issue.
GetExeExt does not work when used as used by startlazarus and compile with FPC trunk.

Does not work:
Code: Pascal  [Select][+][-]
  1. DefaultExe:=DefaultDir+'lazarus'+GetExeExt;

Does work:
Code: Pascal  [Select][+][-]
  1. DefaultExe:=DefaultDir+'lazarus';
  2. DefaultExe:=DefaultExe+GetExeExt;

Compilation with FPC trunk.
All other FPC versions work well.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #22 on: May 05, 2020, 01:18:30 pm »
I can confirm this very interesting issue.
GetExeExt does not work when used as used by startlazarus and compile with FPC trunk.

Does not work:
Code: Pascal  [Select][+][-]
  1. DefaultExe:=DefaultDir+'lazarus'+GetExeExt;

Does work:
Code: Pascal  [Select][+][-]
  1. DefaultExe:=DefaultDir+'lazarus';
  2. DefaultExe:=DefaultExe+GetExeExt;

Compilation with FPC trunk.
All other FPC versions work well.

Can you provide a reproducible, small example and report a bug, please?

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1739
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #23 on: May 05, 2020, 04:42:24 pm »
@PascalDragon

Could you please explain ?
The code-sample shows a very simple way of testing this.
This issue has now been reproduced by some people.
Just build FPC trunk and Lazarus trunk. And build+look at startlazarus.

Reason for asking.

I am using GetExeExt on many places in my own code without problem. As does Lazarus. So, this issue is unique in its occurrence at startlazarus. And will be very hard to reproduce. But in startlazarus, it is very visible.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #24 on: May 05, 2020, 06:20:52 pm »
Frankly, I don't see how it can be faiing; after all GetExeExt is just:

Code: Pascal  [Select][+][-]
  1. function GetExeExt: string;
  2. 349     begin
  3. 350       {$IFDEF WINDOWS}
  4. 351       Result:='.exe';
  5. 352       {$ELSE}
  6. 353       Result:='';
  7. 354       {$ENDIF}
  8. 355     end;

Maybe someone can test adding this to lazarusmanager.pas:
Code: Pascal  [Select][+][-]
  1. const
  2.   GetExeExt =
  3.       {$IFDEF WINDOWS}'.exe';{$ELSE}'';{$ENDIF}

Only way any of these would fail would be if either:
  • somehow WINDOWS is becoming undefined; or
  • Windows now has case-sensitive filenames ;)
« Last Edit: May 05, 2020, 06:24:11 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

JiaXing

  • Jr. Member
  • **
  • Posts: 75
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #25 on: May 05, 2020, 06:22:33 pm »
I can confirm this very interesting issue.
GetExeExt does not work when used as used by startlazarus and compile with FPC trunk.

Does not work:
Code: Pascal  [Select][+][-]
  1. DefaultExe:=DefaultDir+'lazarus'+GetExeExt;

Does work:
Code: Pascal  [Select][+][-]
  1. DefaultExe:=DefaultDir+'lazarus';
  2. DefaultExe:=DefaultExe+GetExeExt;

Compilation with FPC trunk.
All other FPC versions work well.

Perhaps it's the compiler's fault.

Code: Pascal  [Select][+][-]
  1. DefaultExe:=DefaultDir+'lazarus'+GetExeExt;

The compiler interpreted it as:

Code: Pascal  [Select][+][-]
  1. tmp:=DefaultDir+'lazarus';
  2. DefaultExe:=tmp;

And forgot +GetExeExt.

It's just my stupid guess. Anyway, put the assembly produced by fpc trunk here and professionals will jump in to invest it immediately  :P
« Last Edit: May 05, 2020, 06:24:06 pm by JiaXing »
I'm subscribed to the church of 440bx. Say no to OOP  :P

JiaXing

  • Jr. Member
  • **
  • Posts: 75
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #26 on: May 05, 2020, 06:26:06 pm »
Frankly, I don't see how it can be faiing; after all GetExeExt is just:

Code: Pascal  [Select][+][-]
  1. function GetExeExt: string;
  2. 349     begin
  3. 350       {$IFDEF WINDOWS}
  4. 351       Result:='.exe';
  5. 352       {$ELSE}
  6. 353       Result:='';
  7. 354       {$ENDIF}
  8. 355     end;

Maybe someone can test adding this to lazarusmanager.pas:
Code: Pascal  [Select][+][-]
  1. const
  2.   GetExeExt =
  3.       {$IFDEF WINDOWS}'.exe';{$ELSE}'';{$ENDIF}

Only way any of these would fail would be if either:
  • somehow WINDOWS is becoming undefined; or
  • Windows now has case-sensitive filenames ;)

What about my stupid guess?  :P
I'm subscribed to the church of 440bx. Say no to OOP  :P

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #27 on: May 05, 2020, 07:09:28 pm »
What about my stupid guess?  :P

You said it yourself: stupid :D

I'm joking: it's actually possible (and would be a very serious bug) but if that were the case it would be failing everywhere and breaking quite a lot of code (if not all) since that's a very common construct --
Code: Pascal  [Select][+][-]
  1. SomeString := AString + 'constant' + AStringFunction;

But what we are seeing here is that failing just in startlazarus and not in any other program. Which is kind of really strange.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

zoltanleo

  • Sr. Member
  • ****
  • Posts: 486
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #28 on: May 05, 2020, 07:37:44 pm »
Can you provide a reproducible, small example and report a bug, please?
Hi Sven.

I built lazarus trunk x64 using fpcupdeluxe v.1.6.8m and got a similar error and the same "solution"

Important update:
I had doubts and began to experiment. I found the following: such errors DO NOT occur if you build lazarus (any revision) BEFORE the 44724 compiler revision. The error is probably due to changes in the compiler source code in any revision after rev.44724. This is true for any build x32 and x64.

Please someone check my assumptions...
« Last Edit: May 05, 2020, 10:18:06 pm by zoltanleo »
Win10 LTSC x64/Deb 11 amd64(gtk2/qt5)/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.10; IBX by TonyW

Sorry for my bad English, I'm using translator ;)

JiaXing

  • Jr. Member
  • **
  • Posts: 75
Re: Issue of building fpc_trunk and lazarus_trunk x64 for Windows
« Reply #29 on: May 06, 2020, 05:30:27 am »
Can you provide a reproducible, small example and report a bug, please?
Hi Sven.

I built lazarus trunk x64 using fpcupdeluxe v.1.6.8m and got a similar error and the same "solution"

Important update:
I had doubts and began to experiment. I found the following: such errors DO NOT occur if you build lazarus (any revision) BEFORE the 44724 compiler revision. The error is probably due to changes in the compiler source code in any revision after rev.44724. This is true for any build x32 and x64.

Please someone check my assumptions...

So my stupid guess is reasonable again  :P
I'm subscribed to the church of 440bx. Say no to OOP  :P

 

TinyPortal © 2005-2018