Recent

Author Topic: Building Lazarus for x86_64-win64  (Read 8426 times)

Pascal

  • Hero Member
  • *****
  • Posts: 932
Building Lazarus for x86_64-win64
« on: May 31, 2016, 03:40:28 pm »
I've manged to build x86_64-win64 Lazarus by external script.
But if i do "Build Lazarus" from the tools menu with
Win64 and x86_64 i get the Error: Illegal parameter: -Twin64

What do i have to setup in the options or elsewhere?

Regards
Pascal
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Building Lazarus for x86_64-win64
« Reply #1 on: May 31, 2016, 03:44:06 pm »
Where does the cross compiler toolchain gets installed? And please post your fpc.cfg.

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Building Lazarus for x86_64-win64
« Reply #2 on: May 31, 2016, 04:06:55 pm »
don't you have c:\freepascal\fpc\3.0.1\bin\x86_64-win64\ppcx64.exe ?

or an equivalent c:\freepascal\fpc\3.0.1\bin\x86_64-win64\fpc.exe ?

Because you should...

Other option:

Do you have a c:\freepascal\fpc\3.0.1\bin\i386-win32\ppcrossx64.exe ?

If none of the options apply, you did something wrong and Lazarus just defaults to 32 bit windows.

To be very, very sure also check: c:\freepascal\fpc\3.0.1\units\x86_64-win64
Is it there and filled with subdirectories with nicely compiled units?
« Last Edit: May 31, 2016, 04:34:03 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Building Lazarus for x86_64-win64
« Reply #3 on: May 31, 2016, 05:07:35 pm »
Where does the cross compiler toolchain gets installed? And please post your fpc.cfg.
I don't know i just did:
make all OS_TARGET=win64 CPU_TARGET=x86_64
make crossinstall
in my c:\freepascal\fpc\3.0.1 directory

Code: Pascal  [Select][+][-]
  1. #
  2. # Config file generated by fpcmkcfg on 15.05.2016 - 19:18:34
  3. # Example fpc.cfg for Free Pascal Compiler
  4. #
  5.  
  6. # ----------------------
  7. # Defines (preprocessor)
  8. # ----------------------
  9.  
  10. #
  11. # nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE, #UNDEF are allowed
  12. #
  13. # -d is the same as #DEFINE
  14. # -u is the same as #UNDEF
  15. #
  16.  
  17. #
  18. # Some examples (for switches see below, and the -? helppages)
  19. #
  20. # Try compiling with the -dRELEASE or -dDEBUG on the commandline
  21. #
  22.  
  23. # For a release compile with optimizes and strip debuginfo
  24. #IFDEF RELEASE
  25.   -O2
  26.   -Xs
  27.   #WRITE Compiling Release Version
  28. #ENDIF
  29.  
  30. # For a debug version compile with debuginfo and all codegeneration checks on
  31. #IFDEF DEBUG
  32.   -gl
  33.   -Crtoi
  34.   #WRITE Compiling Debug Version
  35. #ENDIF
  36.  
  37. # assembling
  38. #ifdef darwin
  39. # use pipes instead of temporary files for assembling
  40. -ap
  41. # path to Xcode 4.3+ utilities (no problem if it doesn't exist)
  42. -FD/Applications/Xcode.app/Contents/Developer/usr/bin
  43. #endif
  44.  
  45. # ----------------
  46. # Parsing switches
  47. # ----------------
  48.  
  49. # Pascal language mode
  50. #      -Mfpc      free pascal dialect (default)
  51. #      -Mobjfpc   switch some Delphi 2 extensions on
  52. #      -Mdelphi   tries to be Delphi compatible
  53. #      -Mtp       tries to be TP/BP 7.0 compatible
  54. #      -Mgpc      tries to be gpc compatible
  55. #      -Mmacpas   tries to be compatible to the macintosh pascal dialects
  56. #
  57. # Turn on Object Pascal extensions by default
  58. #-Mobjfpc
  59.  
  60. # Assembler reader mode
  61. #      -Rdefault  use default assembler
  62. #      -Ratt      read AT&T style assembler
  63. #      -Rintel    read Intel style assembler
  64. #
  65. # All assembler blocks are AT&T styled by default
  66. #-Ratt
  67.  
  68. # Semantic checking
  69. #      -S2        same as -Mobjfpc
  70. #      -Sc        supports operators like C (*=,+=,/= and -=)
  71. #      -Sa        include assertion code.
  72. #      -Sd        same as -Mdelphi
  73. #      -Se<x>     error options. <x> is a combination of the following:
  74. #         <n> : compiler stops after <n> errors (default is 1)
  75. #         w   : compiler stops also after warnings
  76. #         n   : compiler stops also after notes
  77. #         h   : compiler stops also after hints
  78. #      -Sg        allow LABEL and GOTO
  79. #      -Sh        Use ansistrings
  80. #      -Si        support C++ styled INLINE
  81. #      -Sk        load fpcylix unit
  82. #      -SI<x>     set interface style to <x>
  83. #         -SIcom    COM compatible interface (default)
  84. #         -SIcorba  CORBA compatible interface
  85. #      -Sm        support macros like C (global)
  86. #      -So        same as -Mtp
  87. #      -Sp        same as -Mgpc
  88. #      -Ss        constructor name must be init (destructor must be done)
  89. #      -Sx        enable exception keywords (default in Delphi/ObjFPC modes)
  90. #
  91. # Allow goto, inline, C-operators, C-vars
  92. -Sgic
  93.  
  94. # ---------------
  95. # Code generation
  96. # ---------------
  97.  
  98. # Uncomment the next line if you always want static/dynamic units by default
  99. # (can be overruled with -CD, -CS at the commandline)
  100. #-CS
  101. #-CD
  102.  
  103. # Set the default heapsize to 8Mb
  104. #-Ch8000000
  105.  
  106. # Set default codegeneration checks (iocheck, overflow, range, stack)
  107. #-Ci
  108. #-Co
  109. #-Cr
  110. #-Ct
  111.  
  112. # Optimizer switches
  113. # -Os        generate smaller code
  114. # -Oa=N      set alignment to N
  115. # -O1        level 1 optimizations (quick optimizations, debuggable)
  116. # -O2        level 2 optimizations (-O1 + optimizations which make debugging more difficult)
  117. # -O3        level 3 optimizations (-O2 + optimizations which also may make the program slower rather than faster)
  118. # -Oo<x>     switch on optimalization x. See fpc -i for possible values
  119. # -OoNO<x>   switch off optimalization x. See fpc -i for possible values
  120. # -Op<x>     set target cpu for optimizing, see fpc -i for possible values
  121.  
  122. #ifdef darwin
  123. #ifdef cpui386
  124. -Cppentiumm
  125. -Oppentiumm
  126. #endif
  127. #endif
  128.  
  129. # -----------------------
  130. # Set Filenames and Paths
  131. # -----------------------
  132.  
  133. # Both slashes and backslashes are allowed in paths
  134.  
  135. # path to the messagefile, not necessary anymore but can be used to override
  136. # the default language
  137. #-FrC:\freepascal\fpc\3.0.1/msg/errore.msg
  138. #-FrC:\freepascal\fpc\3.0.1/msg/errorn.msg
  139. #-FrC:\freepascal\fpc\3.0.1/msg/errores.msg
  140. #-FrC:\freepascal\fpc\3.0.1/msg/errord.msg
  141. #-FrC:\freepascal\fpc\3.0.1/msg/errorr.msg
  142.  
  143. # search path for unicode binary files (FPC 2.x does not know this switch)
  144. #ifndef VER2
  145. -FM/unicode/
  146. #endif
  147.  
  148. # searchpath for units and other system dependent things
  149. -FuC:\freepascal\fpc\3.0.1/units/$fpctarget
  150. -FuC:\freepascal\fpc\3.0.1/units/$fpctarget/*
  151. -FuC:\freepascal\fpc\3.0.1/units/$fpctarget/rtl
  152.  
  153. #ifdef cpui8086
  154. -FuC:\freepascal\fpc\3.0.1/units/$fpctarget/$fpcsubarch-$fpcmemorymodel
  155. -FuC:\freepascal\fpc\3.0.1/units/$fpctarget/$fpcsubarch-$fpcmemorymodel/*
  156. -FuC:\freepascal\fpc\3.0.1/units/$fpctarget/$fpcsubarch-$fpcmemorymodel/rtl
  157. #endif
  158.  
  159. #IFDEF FPCAPACHE_1_3
  160. -FuC:\freepascal\fpc\3.0.1/units/$fpctarget/httpd13/
  161. #ELSE
  162. #IFDEF FPCAPACHE_2_0
  163. -FuC:\freepascal\fpc\3.0.1/units/$fpctarget/httpd20
  164. #ELSE
  165. -FuC:\freepascal\fpc\3.0.1/units/$fpctarget/httpd22
  166. #ENDIF
  167. #ENDIF
  168.  
  169. # searchpath for fppkg user-specific packages
  170. -Fu$LOCAL_APPDATA\FreePascal\fppkg/units/$FPCTARGET/*
  171.  
  172. # path to the gcclib
  173.  
  174.  
  175. # searchpath for libraries
  176. #-FlC:\freepascal\fpc\3.0.1/lib
  177. #-Fl/lib;/usr/lib
  178. -FlC:\freepascal\fpc\3.0.1/lib/$FPCTARGET
  179.  
  180. # searchpath for tools
  181. -FDC:\freepascal\fpc\3.0.1/bin/$FPCTARGET
  182.  
  183. #IFNDEF CPUI386
  184. #IFNDEF CPUAMD64
  185. #DEFINE NEEDCROSSBINUTILS
  186. #ENDIF
  187. #ENDIF
  188.  
  189. #IFNDEF Win32
  190. #DEFINE NEEDCROSSBINUTILS
  191. #ENDIF
  192.  
  193. # never need cross-prefix when targeting the JVM
  194. # (no native compiler, always cross-compiling)
  195. #ifdef cpujvm
  196. #undef NEEDCROSSBINUTILS
  197. #endif
  198.  
  199. # for android cross-prefix is set by compiler
  200. #ifdef android
  201. #undef NEEDCROSSBINUTILS
  202. #endif
  203.  
  204. # never need cross-prefix when targeting the i8086
  205. # (no native compiler, always cross-compiling)
  206. #ifdef cpui8086
  207. #undef NEEDCROSSBINUTILS
  208. #endif
  209.  
  210. # never need cross-prefix when targeting the i8086
  211. # (no native compiler, always cross-compiling)
  212. #ifdef cpujvm
  213. #undef NEEDCROSSBINUTILS
  214. #endif
  215.  
  216. # binutils prefix for cross compiling
  217. #IFDEF FPC_CROSSCOMPILING
  218. #IFDEF NEEDCROSSBINUTILS
  219.  -XP$FPCTARGET-
  220. #ENDIF
  221. #ENDIF
  222.  
  223.  
  224. # -------------
  225. # Linking
  226. # -------------
  227.  
  228. # generate always debugging information for GDB (slows down the compiling
  229. # process)
  230. #      -gc        generate checks for pointers
  231. #      -gd        use dbx
  232. #      -gg        use gsym
  233. #      -gh        use heap trace unit (for memory leak debugging)
  234. #      -gl        use line info unit to show more info for backtraces
  235. #      -gv        generates programs tracable with valgrind
  236. #      -gw        generate dwarf debugging info
  237. #
  238. # Enable debuginfo and use the line info unit by default
  239. #-gl
  240.  
  241. # always pass an option to the linker
  242. #-k-s
  243.  
  244. # Always strip debuginfo from the executable
  245. -Xs
  246.  
  247. # Always use smartlinking on i8086, because the system unit exceeds the 64kb
  248. # code limit
  249. #ifdef cpui8086
  250. -CX
  251. -XX
  252. #endif
  253.  
  254.  
  255. # -------------
  256. # Miscellaneous
  257. # -------------
  258.  
  259. # Write always a nice FPC logo ;)
  260. -l
  261.  
  262. # Verbosity
  263. #      e : Show errors (default)       d : Show debug info
  264. #      w : Show warnings               u : Show unit info
  265. #      n : Show notes                  t : Show tried/used files
  266. #      h : Show hints                  s : Show time stamps
  267. #      i : Show general info           q : Show message numbers
  268. #      l : Show linenumbers            c : Show conditionals
  269. #      a : Show everything             0 : Show nothing (except errors)
  270. #      b : Write file names messages   r : Rhide/GCC compatibility mode
  271. #          with full path              x : Executable info (Win32 only)
  272. #      v : write fpcdebug.txt with     p : Write tree.log with parse tree
  273. #          lots of debugging info
  274. #
  275. # Display Info, Warnings and Notes
  276. -viwn
  277. # If you don't want so much verbosity use
  278. #-vw
  279.  
  280.  
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Building Lazarus for x86_64-win64
« Reply #4 on: May 31, 2016, 05:09:56 pm »
don't you have c:\freepascal\fpc\3.0.1\bin\x86_64-win64\ppcx64.exe ?

or an equivalent c:\freepascal\fpc\3.0.1\bin\x86_64-win64\fpc.exe ?

Because you should...

Other option:

Do you have a c:\freepascal\fpc\3.0.1\bin\i386-win32\ppcrossx64.exe ?

If none of the options apply, you did something wrong and Lazarus just defaults to 32 bit windows.

To be very, very sure also check: c:\freepascal\fpc\3.0.1\units\x86_64-win64
Is it there and filled with subdirectories with nicely compiled units?

There is only a c:\freepascal\fpc\3.0.1\bin\i386-win32 directory with a ppcrossx64.exe in it

if i got it right there is no native x86_64-win64 compiler.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Building Lazarus for x86_64-win64
« Reply #5 on: May 31, 2016, 05:51:54 pm »
To be very, very sure also check: c:\freepascal\fpc\3.0.1\units\x86_64-win64
Is it there and filled with subdirectories with nicely compiled units?
Yes it is there and filled.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Building Lazarus for x86_64-win64
« Reply #6 on: May 31, 2016, 07:48:12 pm »
Ok, why don't you point your Lazarus configuration to the right compiler, because now it points to a 32 bit one and Lazarus is not smart enough to know you actually mean a 64 bit one. See your own screenshot.
That goes for the compiler and the unit directories.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Building Lazarus for x86_64-win64
« Reply #7 on: May 31, 2016, 10:04:49 pm »
Ok, why don't you point your Lazarus configuration to the right compiler, because now it points to a 32 bit one and Lazarus is not smart enough to know you actually mean a 64 bit one. See your own screenshot.
That goes for the compiler and the unit directories.
I tried it using the ppccrosssx64.exe as compiler and it seems to work.
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

 

TinyPortal © 2005-2018