Recent

Author Topic: Cross-platform - how to target Linux  (Read 6390 times)

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Cross-platform - how to target Linux
« Reply #30 on: October 16, 2024, 10:59:27 pm »
The cross-compiling from M1 should work.
Would be good to try to solve the issue !
Indeed it would.

Just to make sure I understood: There is no way that FPCUpdeluxe (on its own/by default) would use (fallback to) a previous compiler revision in order to create a cross-compiler ?

@carl_caulkett:
How/why is FPCUpdeluxe able to find/locate a FPC 3.2.2 (host) compiler in your Lazarus installation directory ? I ask to make sure because you specifically stated to be using Lazarus 3.99 and FPC 3.3.1.

Technically both situations at the same time can't be (shouldn't be) happening.
« Last Edit: October 16, 2024, 11:03:18 pm by TRon »
Today is tomorrow's yesterday.

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: Cross-platform - how to target Linux
« Reply #31 on: October 16, 2024, 11:09:40 pm »
@carl_caulkett:
How/why is FPCUpdeluxe able to find/locate a FPC 3.2.2 (host) compiler in your Lazarus installation directory ? I ask to make sure because you specifically stated to be using Lazarus 3.99 and FPC 3.3.1.

Technically both situations at the same time can't be (shouldn't be) happening.

I still have a FPC 3.2.2/Lazarus 3.4 installation alongside my FPC 3.3.1/Lazarus 3.99 one. The old one was installed using the default installers from the website, whereas the 3.3.1/3.99 one was done with fpcupdeluxe. Maybe it's picking up the old 3.2.2 compiler, although I got the impression that fpcupdeluxe was  self-sufficient enough not to need any outside compilers...
"It builds... ship it!"

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Cross-platform - how to target Linux
« Reply #32 on: October 16, 2024, 11:19:40 pm »
Maybe it's picking up the old 3.2.2 compiler, although I got the impression that fpcupdeluxe was  self-sufficient enough not to need any outside compilers...
FPCUpdeluxe can do without but remember what I told about system wide installations ? In the end it is going to bite the proverbial buttocks  :)

The scripts and other mechanisms that are in place are suppose to do things by the book but that doesn't always turn out that way (bug, oversight and/or other catastrophic things that might happen). F.e. one of the most common things that does happen is for whatever makefile or program/buildtool to pick up on a system wide fpc.cfg file and which might toss things around in unexpected ways.

It would be interesting to understand/know why this situation happens for you.

Edit: Drats, this VM thing back 'n forth got me confused. It is the cross-compiler used by Lazarus that is reported to be 3.2.2 so it is more likely related to your Lazarus settings, not FPCUpDeluxe.

Can you share your Lazarus configuration for the cross-compilation in detail ?
« Last Edit: October 16, 2024, 11:27:35 pm by TRon »
Today is tomorrow's yesterday.

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: Cross-platform - how to target Linux
« Reply #33 on: October 16, 2024, 11:55:58 pm »
Can you share your Lazarus configuration for the cross-compilation in detail ?

Sorry it's late here! Where do I find that information?
"It builds... ship it!"

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Cross-platform - how to target Linux
« Reply #34 on: October 17, 2024, 12:14:38 am »
@carl:
Please paste text from following text controls:
- menu project, project options / compiler options / config and target, button show options
- menu view, IDE internals / About FPC, both tabs please
- optionally:  menu view / IDE internals / About IDE , first tab only

edit: I forgot to mention: do this when you have your project opened and targeted for cross-compiling to arm windows (dunno if you have to save the options first so let's make sure and do).
« Last Edit: October 17, 2024, 12:26:23 am by TRon »
Today is tomorrow's yesterday.

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: Cross-platform - how to target Linux
« Reply #35 on: October 17, 2024, 01:08:34 am »
FPCUpdeluxe can do without but remember what I told about system wide installations ? In the end it is going to bite the proverbial buttocks  :)

I'm pretty sure that my current FPC/Lazarus setup is not using the FPC 3.2.2 compiler at all. To confirm this I renamed my old Lazarus 3.4 installation from its old name of /Applications/Lazarus to /Applications/LazarusXXX. I then did a which fpc to find out where the old system-wide fpc was installed. It was /usr/local/bin/fpc. So I renamed this fpcXXX, and to double check tried running fpc. It came back with zsh: command not found: fpc.

In the meantime, all 4 modes of my Lazarus 3.99 installation, macOS, Linux and Windows all build with any problem, proving, I would say, that my old FPC 3.2.2 installation is not a factor here!

Oh, and I took on board what you said about not having the default settings for my Mac option. I've explicitly created a Darwin/aarch64 cross-compiler in fpcupdeluxe, and created a Project Option called macOS aarch64, as well as a Darwin/x86_64 cross-compiler and a Project Option called macOS x86_64, each with the appropriate OS and CPU selected. All four project options build successfully, without even touching the old system-wide fpc!

This means I can choose between Mac Silicon, Mac Intel, Linux and Windows, all using fpcupdeluxe generated cross-compilers :D
« Last Edit: October 17, 2024, 01:49:03 am by carl_caulkett »
"It builds... ship it!"

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: Cross-platform - how to target Linux
« Reply #36 on: October 17, 2024, 01:43:39 am »
@carl:
Please paste text from following text controls:
- menu project, project options / compiler options / config and target, button show options
Code: Text  [Select][+][-]
  1. /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh
  2. -Twin64
  3. -Px86_64
  4. -MObjFPC
  5. -Scghi
  6. -O1
  7. -gw2
  8. -godwarfsets
  9. -gl
  10. -gh
  11. -Xg
  12. -l
  13. -vewnhibq
  14. -Filib/x86_64-win64
  15. -Fu/Users/carlcaulkett/Code/FPC/OsmosePresets/
  16. -Fu../caMidi
  17. -Fu/Applications/Lazarus_trunk/lazarus/components/virtualtreeview/lib/x86_64-win64-win32
  18. -Fu/Applications/Lazarus_trunk/lazarus/components/ideintf/units/x86_64-win64/win32
  19. -Fu/Applications/Lazarus_trunk/lazarus/components/lclextensions/lib/x86_64-win64-win32
  20. -Fu/Applications/Lazarus_trunk/lazarus/components/lazcontrols/lib/x86_64-win64/win32
  21. -Fu/Applications/Lazarus_trunk/lazarus/lcl/units/x86_64-win64/win32
  22. -Fu/Applications/Lazarus_trunk/lazarus/lcl/units/x86_64-win64
  23. -Fu/Applications/Lazarus_trunk/lazarus/components/freetype/lib/x86_64-win64
  24. -Fu/Applications/Lazarus_trunk/lazarus/components/debuggerintf/lib/x86_64-win64
  25. -Fu/Applications/Lazarus_trunk/lazarus/components/buildintf/units/x86_64-win64
  26. -Fu/Applications/Lazarus_trunk/lazarus/components/lazutils/lib/x86_64-win64
  27. -Fu/Applications/Lazarus_trunk/lazarus/components/lazdebuggers/lazdebuggerintf/lib/x86_64-win64
  28. -Fu../caLibrary/lib/x86_64-win64
  29. -Fu/Applications/Lazarus_trunk/lazarus/packager/units/x86_64-win64
  30. -FUlib/x86_64-win64
  31. -FE.
  32. -oOsmosePresets.exe
  33. -dLCL
  34. -dLCLwin32
  35. -vd
  36. -gh
  37. -glh
  38. -Xg
  39. OsmosePresets.lpr
  40.  

- menu view, IDE internals / About FPC, both tabs please

FPC Values used by the IDE

Code: Text  [Select][+][-]
  1. Lazarus version: 3.99
  2. Lazarus revision: main_3_99-2797-gb854ec9036
  3. Lazarus build date: 2024/10/13 15:04:48
  4. Lazarus was compiled for x86_64-darwin
  5. Lazarus was compiled with FPC 3.3.1
  6.  
  7. Environment variables:
  8. PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  9. PP=
  10. FPCDIR=
  11. USESVN2REVISIONINC=
  12. USER=carlcaulkett
  13. HOME=/Users/carlcaulkett
  14. PWD=
  15. LANG=
  16. LANGUAGE=
  17.  
  18. Global IDE options:
  19. LazarusDirectory=../lazarus/
  20. Resolved LazarusDirectory=/Applications/Lazarus_trunk/lazarus/
  21. Project's CompilerFilename=$(CompPath)
  22. Resolved Project's CompilerFilename=/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh
  23. Default CompilerFilename=/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh
  24. Resolved default compilerFilename=/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh
  25. CompilerMessagesFilename=
  26. Resolved CompilerMessagesFilename=/Applications/Lazarus_trunk/fpcsrc/compiler/msg/errore.msg
  27.  
  28. Project:
  29. lpi=/Users/carlcaulkett/Code/FPC/OsmosePresets/osmosepresets.lpi
  30. Directory=/Users/carlcaulkett/Code/FPC/OsmosePresets/
  31. TargetOS=win64
  32. TargetCPU=x86_64
  33. CompilerFilename=$(CompPath)
  34. CompilerOptions=
  35.  
  36. Active target:
  37. TargetOS=win64
  38. TargetCPU=x86_64
  39. Subtarget=
  40.  
  41. FPC executable:
  42. Compiler=/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh
  43. Options=
  44. CompilerDate=09/30/24 08:23:12 PM
  45. RealCompiler=/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/ppcx64
  46. RealCompilerDate=09/30/24 08:23:12 PM
  47. RealTargetOS=win64
  48. RealTargetCPU=x86_64
  49. RealCompilerInPath=/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/ppcx64
  50. Version=3.3.1-16559-gaefca4c22b
  51. CfgFilename=/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.cfg
  52.  
  53. Defines:
  54. CONSOLE=
  55. CPU64=
  56. CPUAMD64=
  57. CPUINT64=
  58. CPUX64=
  59. CPUX86-64-V1=
  60. CPUX86_64=
  61. CPUX86_HAS_BSWAP=
  62. CPUX86_HAS_BTX=
  63. CPUX86_HAS_CMOV=
  64. CPUX86_HAS_SSE2=
  65. CPUX86_HAS_SSEUNIT=
  66. ENDIAN_LITTLE=
  67. FPC=
  68. FPC_ABI_DEFAULT=
  69. FPC_ALIGNED_THREADVARTABLES=
  70. FPC_COMP_IS_INT64=
  71. FPC_CROSSCOMPILING=
  72. FPC_CURRENCY_IS_INT64=
  73. FPC_DYNARRAYCOPY_FIXED=
  74. FPC_FULLVERSION=30301
  75. FPC_HAS_ANSICHAR_CHAR=
  76. --8<--
  77. FPC_VARIANTCOPY_FIXED=
  78. FPC_VERSION=3
  79. FPC_WINLIKEWIDESTRING=
  80. FPUSSE64=
  81. INTERNAL_BACKTRACE=
  82. MSWINDOWS=
  83. NEEDCROSSBINUTILS=
  84. REGCALL=
  85. STR_CONCAT_PROCS=
  86. VER3=
  87. VER3_3=
  88. VER3_3_1=
  89. WIN64=
  90. WINDOWS=
  91.  
  92. Undefines:
  93. BSD=
  94. DARWIN=
  95. HASUNIX=
  96. UNIX=
  97.  
  98. Include Paths:
  99. Unit Scopes:
  100. Unit Paths:
  101. /Applications/Lazarus_trunk/config_lazarus
  102. /Applications/Lazarus_trunk/fpc/units/x86_64-win64/httpd22
  103. /Applications/Lazarus_trunk/fpc/units/x86_64-win64/rtl
  104. /Applications/Lazarus_trunk/fpc/units/x86_64-win64/opengl
  105. /Applications/Lazarus_trunk/fpc/units/x86_64-win64/fcl-base
  106. --8<--
  107. /Applications/Lazarus_trunk/fpc/units/x86_64-win64/gnutls
  108. /Applications/Lazarus_trunk/fpc/units/x86_64-win64/pasjpeg
  109. /Applications/Lazarus_trunk/fpc/units/x86_64-win64/libffi
  110. /Applications/Lazarus_trunk/fpc/units/x86_64-win64/bzip2
  111. Units:
  112. acceleratorsresource=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/fcl-res/acceleratorsresource.ppu
  113. activex=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/winunits-base/activex.ppu
  114. adler=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/paszlib/adler.ppu
  115. advancedipc=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/fcl-base/advancedipc.ppu
  116. advancedsingleinstance=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/fcl-base/advancedsingleinstance.ppu
  117. --8<--
  118. zbase=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/paszlib/zbase.ppu
  119. zcompres=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/paszlib/zcompres.ppu
  120. zdeflate=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/paszlib/zdeflate.ppu
  121. zinflate=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/paszlib/zinflate.ppu
  122. zip=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/paszlib/zip.ppu
  123. zipper=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/paszlib/zipper.ppu
  124. ziptypes=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/unzip/ziptypes.ppu
  125. ziputils=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/paszlib/ziputils.ppu
  126. zlib=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/zlib/zlib.ppu
  127. zstream=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/paszlib/zstream.ppu
  128. zuncompr=/Applications/Lazarus_trunk/fpc/units/x86_64-win64/paszlib/zuncompr.ppu
  129.  
  130. Sources:
  131. Directory=/Applications/Lazarus_trunk/fpcsrc
  132. Files.Count=21171
  133. packages/libndsfpc/src/nds/system.inc
  134. packages/libogcfpc/src/ogc/system.inc
  135. rtl/aix/system.pp
  136. rtl/amicommon/classes.pp
  137. rtl/amicommon/sysutils.pp
  138. rtl/amiga/system.pp
  139. rtl/aros/system.pp
  140. --8<--
  141. rtl/win64/classes.pp
  142. rtl/win64/system.pp
  143. rtl/wince/classes.pp
  144. rtl/wince/system.pp
  145. rtl/wince/sysutils.pp
  146. rtl/zxspectrum/system.pp
  147.  

FPC output
Code: Text  [Select][+][-]
  1. The IDE asks the compiler with the following command for the real OS/CPU:
  2. /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh -iTOTP -Fr/Applications/Lazarus_trunk/lazarus/components/codetools/fpc.errore.msg
  3. Working directory: /
  4. Output:
  5. darwin x86_64
  6.  
  7. The IDE asks the compiler with the following command for paths and macros:
  8. /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh -va -Px86_64 -Twin64 -Fr/Applications/Lazarus_trunk/lazarus/components/codetools/fpc.errore.msg compilertest.pas
  9. Working directory: /Applications/Lazarus_trunk/config_lazarus/
  10. Output:
  11. [0.000] Handling option "-Twin64"
  12. [0.000] Interpreting firstpass option "-Twin64"
  13. [0.000] Macro undefined: DARWIN
  14. [0.000] Macro undefined: UNIX
  15. [0.000] Macro undefined: BSD
  16. [0.000] Macro undefined: HASUNIX
  17. [0.000] Macro undefined: FPC_HAS_WINLIKERESOURCES
  18. [0.000] Macro defined: WIN64
  19. [0.000] Macro defined: MSWINDOWS
  20. [0.000] Macro defined: WINDOWS
  21. --8<--
  22. [0.001] Macro defined: FPC_HAS_INTERNAL_SAR
  23. [0.001] Macro defined: INTERNAL_BACKTRACE
  24. [0.001] Macro defined: STR_CONCAT_PROCS
  25. [0.001] Macro defined: REGCALL
  26. [0.001] Macro defined: ENDIAN_LITTLE
  27. [0.001] Macro defined: FPC_LITTLE_ENDIAN
  28. [0.001] Handling option "-n"
  29. [0.001] Interpreting option "-n"
  30. [0.001] Reading further options from /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.cfg
  31. [0.001] Reading options from file /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.cfg
  32. [0.001] Hint: Start of reading config file /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.cfg
  33. [0.001] Interpreting file option "#"
  34. [0.001] Interpreting file option "# Config file generated by fpcmkcfg on 30-9-24 - 13:44:42"
  35. [0.001] Interpreting file option "# Example fpc.cfg for Free Pascal Compiler"
  36. --8<--
  37. [0.005] Interpreting file option "# Display Info, Warnings and Notes"
  38. [0.005] Interpreting file option "#-viwn"
  39. [0.005] Interpreting file option "# If you don't want so much verbosity use"
  40. [0.005] Handling option "-vw"
  41. [0.005] Interpreting option "-vw"
  42. [0.005] Interpreting file option "# begin fpcup do not remove : base settings"
  43. [0.005] Interpreting file option "# Adding binary tools paths to"
  44. [0.005] Interpreting file option "# plain bin dir and architecture bin dir so"
  45. [0.005] Interpreting file option "# fpc 3.1+ fpcres etc can be found."
  46. [0.005] Handling option "-FD/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin;/Applications/Lazarus_trunk/fpc"
  47. [0.005] Interpreting option "-FD/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin;/Applications/Lazarus_trunk/fpc"
  48. [0.005] Interpreting file option "# library search path"
  49. [0.005] Handling option "-Fl/usr/lib/x86_64-win64;/usr/lib/x86_64-win64-gnu;/lib/x86_64-win64;/lib/x86_64-win64-gnu"
  50. [0.005] Interpreting option "-Fl/usr/lib/x86_64-win64;/usr/lib/x86_64-win64-gnu;/lib/x86_64-win64;/lib/x86_64-win64-gnu"
  51. [0.005] Path "/lib/x86_64-win64-gnu/" not found
  52. [0.005] Path "/lib/x86_64-win64/" not found
  53. [0.005] Path "/usr/lib/x86_64-win64-gnu/" not found
  54. [0.005] Path "/usr/lib/x86_64-win64/" not found
  55. [0.005] Interpreting file option "#IFNDEF FPC_CROSSCOMPILING"
  56. [0.005] Interpreting file option "#ENDIF"
  57. [0.005] Interpreting file option "# Add some extra OSX options, if any"
  58. [0.005] Interpreting file option "#IFDEF DARWIN"
  59. [0.005] Interpreting file option "# Prevents crti not found linking errors"
  60. [0.005] Interpreting file option "#IFNDEF FPC_CROSSCOMPILING"
  61. [0.005] Interpreting file option "#ENDIF"
  62. [0.005] Interpreting file option "#ENDIF"
  63. [0.005] Interpreting file option "# MacOS 10.14 Mojave and newer have libs and tools in new, yet non-standard directory"
  64. [0.005] Interpreting file option "#IFDEF DARWIN"
  65. [0.005] Interpreting file option "#ENDIF"
  66. [0.005] Handling option "-Fl/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib"
  67. [0.005] Interpreting option "-Fl/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib"
  68. [0.005] Handling option "-FD/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"
  69. [0.005] Interpreting option "-FD/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin"
  70. [0.005] Interpreting file option "# end fpcup do not remove"
  71. [0.005] Interpreting file option "# begin fpcup do not remove x86_64-win64"
  72. --8<--
  73. [0.005] Interpreting file option "#ENDIF FPC_CROSSCOMPILING"
  74. [0.005] Interpreting file option "# end fpcup do not remove"
  75. [0.005] Hint: End of reading config file /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.cfg
  76. [0.005] Handling option "-va"
  77. [0.005] Interpreting option "-va"
  78. [0.005] Handling option "-Twin64"
  79. [0.005] Interpreting option "-Twin64"
  80. [0.005] Handling option "-Fr/Applications/Lazarus_trunk/lazarus/components/codetools/fpc.errore.msg"
  81. [0.005] Interpreting option "-Fr/Applications/Lazarus_trunk/lazarus/components/codetools/fpc.errore.msg"
  82. [0.007] Handling option "compilertest.pas"
  83. [0.007] Found source file name "compilertest.pas"
  84. [0.007] Free Pascal Compiler version 3.3.1-16559-gaefca4c22b [2024/09/30] for x86_64
  85. [0.007] Copyright (c) 1993-2024 by Florian Klaempfl and others
  86. [0.008] Macro undefined: CPUX86-64-V1
  87. [0.008] Macro defined: CPUX86-64-V1
  88. [0.008] Macro undefined: FPUSSE64
  89. [0.008] Macro defined: FPUSSE64
  90. [0.008] Macro undefined: FPC_ABI_DEFAULT
  91. [0.008] Macro defined: FPC_ABI_DEFAULT
  92. [0.008] Macro defined: CPUX86_64
  93. [0.008] Macro defined: CPUAMD64
  94. [0.008] Macro defined: CPU64
  95. [0.008] Macro defined: CPUX64
  96. [0.008] Macro defined: FPC_CURRENCY_IS_INT64
  97. [0.008] Macro defined: FPC_COMP_IS_INT64
  98. [0.008] Macro defined: CPUINT64
  99. --8<--
  100. [0.008] Macro defined: FPC_HAS_INTERNAL_BSR
  101. [0.008] Macro defined: FPC_LINK_STATIC
  102. [0.008] Macro FPC_VERSION set to 3
  103. [0.008] Macro FPC_RELEASE set to 3
  104. [0.008] Macro FPC_PATCH set to 1
  105. [0.008] Macro FPC_FULLVERSION set to 30301
  106. [0.008] Macro defined: FPC_HAS_INDIRECT_ENTRY_INFORMATION
  107. [0.008] Macro defined: FPC_HAS_INDIRECT_VAR_ACCESS
  108. [0.008] Macro FPC_STACKALIGNMENT set to 16
  109. [0.010] Compiler: /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/ppcx64
  110. [0.010] Compiler OS: Darwin for x86_64
  111. [0.010] Target OS: Win64 for x64
  112. [0.010] Using executable path: /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/
  113. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/httpd22/
  114. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/rtl/
  115. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/opengl/
  116. --8<--
  117. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/gtk1/
  118. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/fcl-mustache/
  119. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/fcl-db/
  120. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/rtl-objpas/
  121. --8<--
  122. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/fcl-web/
  123. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/libgd/
  124. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/
  125. [0.010] Using unit path: /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/
  126. [0.010] Using library path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/
  127. [0.010] Using library path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/httpd22/
  128. --8<--
  129. [0.010] Using library path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/rtl/
  130. [0.010] Using library path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/opengl/
  131. [0.010] Using library path: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/fcl-base/
  132. [0.011] Compiling compilertest.pas
  133. [0.011] Searching file compilertest.pas... found
  134. [0.012] (PROGRAM)  Registering new unit SYSTEM
  135. [0.012] (PROGRAM)  Load from PROGRAM (implementation) unit SYSTEM
  136. [0.012] (SYSTEM)   Loading unit SYSTEM
  137. [0.012] Unitsearch: system.ppu
  138. [0.012] Searching file system.ppu... not found
  139. [0.012] Searching file SYSTEM.PPU... not found
  140. [0.012] Unitsearch: system.pp
  141. [0.012] Searching file system.pp... not found
  142. [0.012] Searching file SYSTEM.PP... not found
  143. [0.012] Unitsearch: system.pas
  144. [0.012] Searching file system.pas... not found
  145. [0.012] Searching file SYSTEM.PAS... not found
  146. --8<--
  147. [0.013] (SYSTEM)   PPU Name: /Applications/Lazarus_trunk/fpc/units/x86_64-win64/rtl/system.ppu
  148. [0.013] (SYSTEM)   PPU Time: 2024/10/14 10:28:29
  149. [0.013] (SYSTEM)   PPU Flags: 4224
  150. [0.013] (SYSTEM)   PPU Crc: 43FC9CD2
  151. [0.013] (SYSTEM)   PPU Crc: 700FF837 (intfc)
  152. [0.013] (SYSTEM)   PPU Crc: 3CE99B3E (indc)
  153. [0.013] (SYSTEM)   Number of definitions: 3895
  154. [0.013] (SYSTEM)   Number of symbols: 10694
  155. [0.013] (SYSTEM)   PPU Source: system.pp not available
  156. [0.013] (SYSTEM)   PPU Source: systemh.inc not available
  157. [0.013] (SYSTEM)   PPU Source: genmathh.inc not available
  158. --8<--
  159. [0.013] (SYSTEM)   PPU Source: sysosh.inc not available
  160. [0.013] (SYSTEM)   PPU Source: rtldefs.inc not available
  161. [0.014] (SYSTEM)   PPU Source: cpuwin.inc not available
  162. [0.014] (SYSTEM)   PPU Source: syswin.inc not available
  163. [0.014] (SYSTEM)   PPU Source: seh64.inc not available
  164. [0.027] (SYSTEM)   Finished loading unit SYSTEM
  165. [0.027] Searching file compilertest.pas... found
  166. [0.027] Searching file compilertest.pas... found
  167. [0.027] Searching file compilertest.pas... found
  168. [0.027] Macro defined: FPC_HAS_FEATURE_HEAP
  169. --8<--
  170. [0.028] Searching file compilertest.pas... found
  171. [0.028] Searching file compilertest.pas... found
  172. [0.028] (PROGRAM)  Parsing implementation of compilertest.pas
  173. [0.028] Fatal: Syntax error, "BEGIN" expected but "end of file" found
  174. [0.031] Fatal: Compilation aborted
  175. Error: /Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/ppcx64 returned an error exitcode
  176.  
  177. NOTE: The compilertest.pas is empty, so compilation fails. This is what we want.
  178.  

- optionally:  menu view / IDE internals / About IDE , first tab only

General

Code: Text  [Select][+][-]
  1. Lazarus version: 3.99
  2. Lazarus revision: main_3_99-2797-gb854ec9036
  3. Lazarus build date: 2024/10/13 15:04:48
  4. Lazarus was compiled for x86_64-darwin
  5. Lazarus was compiled with FPC 3.3.1
  6.  
  7. Global IDE options:
  8. Primary config directory=/Applications/Lazarus_trunk/config_lazarus
  9. Secondary config directory=/etc/lazarus
  10. LazarusDirectory=../lazarus/
  11. Real LazarusDirectory=/Applications/Lazarus_trunk/lazarus/
  12. Default CompilerFilename=/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh
  13. Real Default CompilerFilename=/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh
  14. Project CompilerFilename=$(CompPath)
  15. Real Project CompilerFilename=/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh
  16. CompilerMessagesFilename=
  17. Real CompilerMessagesFilename=/Applications/Lazarus_trunk/fpcsrc/compiler/msg/errore.msg
  18. FPC source directory=/Applications/Lazarus_trunk/fpcsrc
  19. Real FPC source directory=/Applications/Lazarus_trunk/fpcsrc/
  20. Test directory=/Applications/Lazarus_trunk/projects/
  21. Real Test directory=/Applications/Lazarus_trunk/projects/
  22.  
  23. Working directory=/
  24. Application.ExeName=/Applications/Lazarus_trunk/lazarus/lazarus
  25. 2024/10/13 15:04:51
  26.  
  27. Parameters:
  28. /Applications/Lazarus_trunk/lazarus/lazarus
  29.  
  30. System preferred language:
  31. Language ID: 'en_GB'
  32. Language code: 'en'
  33. Country code: 'GB'
  34.  
  35. Environment variables:
  36. COMMAND_MODE=unix2003
  37. HOME=/Users/carlcaulkett
  38. LaunchInstanceID=E2FA81FF-1F60-48EB-8556-C055B179E76C
  39. LOGNAME=carlcaulkett
  40. PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  41. SECURITYSESSIONID=186a2
  42. SHELL=/bin/zsh
  43. SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.MwoKbPSndO/Listeners
  44. TMPDIR=/var/folders/r7/br4d58nj5wq4x1xbvl7cpqsr0000gn/T/
  45. USER=carlcaulkett
  46. USER=carlcaulkett
  47. XPC_SERVICE_NAME=application.lazarus.freepascal.ide.608745903.612079332
  48. __CFBundleIdentifier=lazarus.freepascal.ide
  49. __CF_USER_TEXT_ENCODING=0x1F5:0:2
  50.  

edit: I forgot to mention: do this when you have your project opened and targeted for cross-compiling to arm windows (dunno if you have to save the options first so let's make sure and do).

This exercise has highlighted the fact that my default Lazarus IDE has been built using the x86_64 compiler. I'll have to look at reconfiguring the "Configure Build Lazarus" settings...

The original message was 47K characters, so I had to snip --8<-- some, hopefully. unimportant bits out to trim it down below 20,000 characters  ;)
« Last Edit: October 17, 2024, 01:47:38 am by carl_caulkett »
"It builds... ship it!"

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Cross-platform - how to target Linux
« Reply #37 on: October 17, 2024, 02:53:48 am »
Thank you for sharing your configs.

At first glance that seems to be ok (apart from a few minor details)
Code: [Select]
[0.005] Path "/lib/x86_64-win64-gnu/" not found
[0.005] Path "/lib/x86_64-win64/" not found
[0.005] Path "/usr/lib/x86_64-win64-gnu/" not found
[0.005] Path "/usr/lib/x86_64-win64/" not found

Quote
This exercise has highlighted the fact that my default Lazarus IDE has been built using the x86_64 compiler. I'll have to look at reconfiguring the "Configure Build Lazarus" settings...
Indeed. Though Rosetta seems to be doing fine  :)

Quote
The original message was 47K characters, so I had to snip --8<-- some, hopefully. unimportant bits out to trim it down below 20,000 characters  ;)
Ah yes thank you for the reminder as I keep forgetting that. Only the first parts are of interest though (unless seeking for other specific errors).

But... wasn't the actual issue
Quote
Code: [Select]

Verbose: PPU Loading /Applications/Lazarus_trunk/fpc/units/aarch64-linux/rtl/system.ppu
Verbose: PPU Invalid Version 208
?

Which is not similar to x86_64 win64 target as your configurations show to be using as target.

Unless this ...
This means I can choose between Mac Silicon, Mac Intel, Linux and Windows, all using fpcupdeluxe generated cross-compilers :D
.. means that you got everything sorted out ?
Today is tomorrow's yesterday.

Thaddy

  • Hero Member
  • *****
  • Posts: 19268
  • Glad to be alive.
Re: Cross-platform - how to target Linux
« Reply #38 on: October 17, 2024, 06:18:43 am »
3.3.1 needs 3.2.2 to build. So fpcupdeluxe installs both, because you will need 3.2.2 as a bootstrap compiler for 3.3.1. That is never a full install, though: it is kept to the minimum buitd tools. (almost always the case, not just fpcupdeluxe)
If the paths show otherwise, you did something manually very wrong.
For iinstalling without fpcupdeluxe there is Marcov's tried, tested and trusted build-faq to get you started.
« Last Edit: October 17, 2024, 06:21:48 am by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: Cross-platform - how to target Linux
« Reply #39 on: October 17, 2024, 12:16:47 pm »
Quote
This exercise has highlighted the fact that my default Lazarus IDE has been built using the x86_64 compiler. I'll have to look at reconfiguring the "Configure Build Lazarus" settings...
Indeed. Though Rosetta seems to be doing fine  :)

Strangely, when I amended my "Configure Build Lazarus" settings to Darwin/aarch64, the rebuild failed with...
Code: Text  [Select][+][-]
  1. make[2]: *** [lazarus] Error 1
  2. make[1]: *** [ide] Error 2
  3. Error: make: *** [ide] Error 2
  4. Error: Unsupported target architecture -Paarch64, invoke the "fpc" compiler driver instead.
  5.  

"It builds... ship it!"

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: Cross-platform - how to target Linux
« Reply #40 on: October 17, 2024, 12:31:43 pm »
Quote
This exercise has highlighted the fact that my default Lazarus IDE has been built using the x86_64 compiler. I'll have to look at reconfiguring the "Configure Build Lazarus" settings...
Indeed. Though Rosetta seems to be doing fine  :)

Strangely, when I amended my "Configure Build Lazarus" settings to Darwin/aarch64, the rebuild failed with...
Code: Text  [Select][+][-]
  1. make[2]: *** [lazarus] Error 1
  2. make[1]: *** [ide] Error 2
  3. Error: make: *** [ide] Error 2
  4. Error: Unsupported target architecture -Paarch64, invoke the "fpc" compiler driver instead.
  5.  

I think I've fixed this by running lazbuild from the command line...
Code: Bash  [Select][+][-]
  1. /Applications/Lazarus_trunk/lazarus  ./lazbuild --ws=cocoa --cpu=aarch64 /Applications/Lazarus_trunk/lazarus/ide/lazarus.lpi
  2. SetPrimaryConfigPath NewValue="/Applications/Lazarus_trunk/config_lazarus"
  3. Hint: (lazbuild) Primary config path: "/Applications/Lazarus_trunk/config_lazarus"
  4. Hint: (lazarus) [RunTool] "/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh" "-iWTOTP" "-Paarch64"
  5. Hint: (lazarus) [RunTool] "/Applications/Lazarus_trunk/fpc/bin/x86_64-darwin/fpc.sh" "-va" "/Applications/Lazarus_trunk/config_lazarus/compilertest.pas" "-Paarch64", WorkDir="/Applications/Lazarus_trunk/config_lazarus/"
  6. Hint: [TPCTargetConfigCache.Update] has changed
  7. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-darwin--cocoa New=aarch64-darwin--cocoa Changed: OS/CPU=True LCL=False
  8. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=aarch64-darwin--cocoa New=aarch64-darwin--cocoa Changed: OS/CPU=True LCL=False
  9.  
  10. [Thu Oct 17 2024 11:28am (BST+0100)]  (main) [*]
  11. /Applications/Lazarus_trunk/lazarus
  12.  
"It builds... ship it!"

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Cross-platform - how to target Linux
« Reply #41 on: October 17, 2024, 12:47:44 pm »
1. you shouldn't have to run lazbuild.
2. please stick to a single target at a time. Solve that, then move on to the next.
(now you seem to have switched to yet another target e.g. from macos x86_64 to native macos arm executables while the initial error is/was cross-compiling from x86-64 macos to win64 aarch64)

I can only do so much at a time, e.g. I am not able to focus on 100 different targets at the same time. Especially since at least arm mac is only recently supported (and afaik still in development).  :)

edit: to provide a little more background, Rosetta allows you to run both X86_64 and aarch64 executables seamlessly. However mixing these in a compiler environment is very confusing and you should take some guidelines into consideration. Either run a aarch64 setup or a x86_64 setup and don't mix them up.

So that leaves a choice: run either a x86_64 or a aarch64 setup or decide to have 2 different setups (independent of each other). The used host architecture is leading in what to setup and how to set it up.
« Last Edit: October 17, 2024, 01:12:50 pm by TRon »
Today is tomorrow's yesterday.

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: Cross-platform - how to target Linux
« Reply #42 on: October 17, 2024, 01:25:31 pm »
1. you shouldn't have to run lazbuild.

Perhaps, though the fact that the IDE option to rebuild Lazarus didn't work, while the CLI lazbuild did work, rather forced my hand!

2. please stick to a single target at a time. Solve that, then move on to the next.
(now you seem to have switched to yet another target e.g. from macos x86_64 to native macos arm executables while the initial error is/was cross-compiling from x86-64 macos to win64 aarch64)

I don't know where you're getting macos arm from. Any deviation from the default x86_64 architecture has been towards aarch64!

edit: to provide a little more background, Rosetta allows you to run both X86_64 and aarch64 executables seamlessly. However mixing these in a compiler environment is very confusing and you should take some guidelines into consideration. Either run a aarch64 setup or a x86_64 setup and don't mix them up.
So that leaves a choice: run either a x86_64 or a aarch64 setup or decide to have 2 different setups (independent of each other). The used host architecture is leading in what to setup and how to set it up.

Isn't that precisely what I am trying to do? My hardware and OS is aarch64. I am trying to bring the Lazarus IDE in line with that...
"It builds... ship it!"

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Cross-platform - how to target Linux
« Reply #43 on: October 17, 2024, 01:39:30 pm »
Perhaps, though the fact that the IDE option to rebuild Lazarus didn't work, while the CLI lazbuild did work, rather forced my hand!
Wrong target. Don't mix as it will leave you with empty hands with regards to the command-line compiler.

I don't know where you're getting macos arm from. Any deviation from the default x86_64 architecture has been towards aarch64!
arm64 = aarch64

Quote
Isn't that precisely what I am trying to do? My hardware and OS is aarch64. I am trying to bring the Lazarus IDE in line with that...
No because your host is (natural) arm (aarch64) and the lazarus and compiler you have been referring to are x86_64. In itself that is ok but as I wrote: don't mix but, choose instead.
Today is tomorrow's yesterday.

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: Cross-platform - how to target Linux
« Reply #44 on: October 17, 2024, 02:11:29 pm »
Wrong target. Don't mix as it will leave you with empty hands with regards to the command-line compiler.

So what is the correct target?

arm64 = aarch64

The fact that the CPU drop down lists arm and aarch64 as two distinct options doesn't help matter!

No because your host is (natural) arm (aarch64) and the lazarus and compiler you have been referring to are x86_64. In itself that is ok but as I wrote: don't mix but, choose instead.

If you, or anyone, could explain to me, in terms no more complex linguistically than "the cat sat on the mat", exactly how I can do this, that would make life a lot easier!
"It builds... ship it!"

 

TinyPortal © 2005-2018