Recent

Author Topic: [SOLVED] Compiling x86_64 LCL/IDE possible  (Read 6833 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
[SOLVED] Compiling x86_64 LCL/IDE possible
« on: February 20, 2012, 06:23:05 pm »
Hi all,

Working on my fpcup FPC+Lazarus SVN downloader/installer.

Starting with a universal binary bootstrap compiler, I seem to be able to compile a valid x64 FPC compiler with it.

However, when compiling the LCL I get
Quote
NSValue.inc(317,13) Error: Illegal type conversion: "Pobjc_object" to "Single"
NSValue.inc(327,13) Warning: Conversion between ordinals and pointers is not portable
foundation.pas(31) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
Error: /Users/reinier/fpc/bin/i386-darwin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)
make[3]: *** [interfaces.ppu] Error 1
make[2]: *** [carbon_all] Error 2
make[1]: *** [interfaces] Error 2
make: *** [lcl] Error 2
(Yes, I know the bin path is i386, but the compiler is x64)

Doing make all in the Lazarus directory with the system-wide FPC I installed (FPC 2.6.0 from last week's snapshots) works and gives a 32 bit Lazarus.

Questions:
1. Is it possible to build a 64 bit LCL+Lazarus? What switches should I give when running make? (edit: select widgetset cocoa instead of carbon in some way?)
2. Is it actually advisable to do so?
3. If I want to make a 32 bit FPC+Lazarus install, should I just specify -Pi386 to get a 386 build?

Thanks,
BigChimp
« Last Edit: February 25, 2012, 10:31:05 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1071
Re: Compiling x86_64 LCL/IDE possible
« Reply #1 on: February 20, 2012, 08:42:51 pm »
Working on my fpcup FPC+Lazarus SVN downloader/installer.

Starting with a universal binary bootstrap compiler, I seem to be able to compile a valid x64 FPC compiler with it.

However, when compiling the LCL I get
Quote
NSValue.inc(317,13) Error: Illegal type conversion: "Pobjc_object" to "Single"
NSValue.inc(327,13) Warning: Conversion between ordinals and pointers is not portable
foundation.pas(31) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
Error: /Users/reinier/fpc/bin/i386-darwin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)
make[3]: *** [interfaces.ppu] Error 1
make[2]: *** [carbon_all] Error 2
make[1]: *** [interfaces] Error 2
make: *** [lcl] Error 2
(Yes, I know the bin path is i386, but the compiler is x64)

Doing make all in the Lazarus directory with the system-wide FPC I installed (FPC 2.6.0 from last week's snapshots) works and gives a 32 bit Lazarus.

Questions:
1. Is it possible to build a 64 bit LCL+Lazarus? What switches should I give when running make? (edit: select widgetset cocoa instead of carbon in some way?)
2. Is it actually advisable to do so?
The above error message is from compiling the Cocoa widegetset. It obviously doesn't compile yet for 64 bit.

Quote
3. If I want to make a 32 bit FPC+Lazarus install, should I just specify -Pi386 to get a 386 build?

Please do not change the default target cpu on Mac OS X/Intel compared to the default FPC install (which is i386). It will cause problems when people report FPC bugs. The default target cpu depends on for which cpu target the installed "fpc" binary is installed (that binary is overwritten when you perform a "make install", not when doing a "make crossinstall"; this is why the ppcx64 installed by the official FPC installers is a cross-compiler).

Shebuka

  • Sr. Member
  • ****
  • Posts: 429
Re: Compiling x86_64 LCL/IDE possible
« Reply #2 on: February 21, 2012, 10:17:18 am »
No, you can't compile carbon in 64bit, so actually with carbon you can't compile neither 64bit IDE neither 64bit applications (but if you really want, you can do this for example with Qt, cocoa widgetset is still too basic to support a complete IDE).

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Compiling x86_64 LCL/IDE possible
« Reply #3 on: February 21, 2012, 11:04:40 am »
Thanks, Shebuka & Jonas!

So basically 64 bit OSX IDE is out unless you want to do it on Qt... I think I'll switch to i386 then...

Quote
3. If I want to make a 32 bit FPC+Lazarus install, should I just specify -Pi386 to get a 386 build?

Please do not change the default target cpu on Mac OS X/Intel compared to the default FPC install (which is i386). It will cause problems when people report FPC bugs. The default target cpu depends on for which cpu target the installed "fpc" binary is installed (that binary is overwritten when you perform a "make install", not when doing a "make crossinstall"; this is why the ppcx64 installed by the official FPC installers is a cross-compiler).
Thanks Jonas.

Let me see if I understand you correctly - and sneak in some questions ;)
I can use the bootstrap compiler from
ftp.freepascal.org/pub/fpc/dist/2.6.0/bootstrap/universal-darwin-ppcuniversal.tar.bz2
then download FPC source from SVN,
(up to now is what I already do with fpcup)
then build:
Code: [Select]
make all FPC=<bootstrap_FPC> CPU_TARGET=i386then do a make install for i386
Code: [Select]
make all INSTALL_PREFIX=<ourfpcdirectory> FPC=<bootstrap_FPC_or_newly_installed_compiler> CPU_TARGET=i386
With this compiler, I can then compile the LCL, which will be i386 because the default compiler is, too.

... after that, I could do a cross compiler for x86_64 (presumably without any CROSSBINDIR= or BINUTILSPREFIX= ??)

Edit: removed superfluous i386, formatting, clarified LCL
« Last Edit: February 21, 2012, 03:26:04 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1071
Re: Compiling x86_64 LCL/IDE possible
« Reply #4 on: February 24, 2012, 05:55:32 pm »
I can use the bootstrap compiler from
ftp.freepascal.org/pub/fpc/dist/2.6.0/bootstrap/universal-darwin-ppcuniversal.tar.bz2
then download FPC source from SVN,
(up to now is what I already do with fpcup)
then build:
Code: [Select]
make all FPC=<bootstrap_FPC> CPU_TARGET=i386then do a make install for i386
Code: [Select]
make all INSTALL_PREFIX=<ourfpcdirectory> FPC=<bootstrap_FPC_or_newly_installed_compiler> CPU_TARGET=i386
With this compiler, I can then compile the LCL, which will be i386 because the default compiler is, too.

... after that, I could do a cross compiler for x86_64 (presumably without any CROSSBINDIR= or BINUTILSPREFIX= ??)
Yes, that looks correct. Indeed no CROSSBINDIR and BINUTILSPREFIX settings are required.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Compiling x86_64 LCL/IDE possible
« Reply #5 on: February 25, 2012, 10:30:52 am »
Thanks, Jonas, I'll add it to my todo list ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018