* * *

Author Topic: Crosscompilation to Mac OSX possible?  (Read 2308 times)

Rel

  • New member
  • *
  • Posts: 33
Crosscompilation to Mac OSX possible?
« on: January 09, 2018, 08:27:54 am »
Hello! Sorry, I'm new to FreePascal, this may be a stupid question, but...
I've used Golang a few times, and it is very easy to crosscompile from any
supported OS to any supported OS, including for example crosscompiling
from Windows to Mac OSX. As far as I understood FPC uses native binutils
for linking and Apple's binutils are closed source, so it is not possible for FPC
to crosscompile to Mac OSX from Windows or Linux. Is it correct? However
I've seen that FPC seems to have it's own linker implementation, what is it
used for? Can I somehow utilize it for crosscompilation to Mac OSX?

Phil

  • Hero Member
  • *****
  • Posts: 2733
Re: Crosscompilation to Mac OSX possible?
« Reply #1 on: January 09, 2018, 02:54:05 pm »
Quote
Apple's binutils are closed source

No, you are wrong.

https://developer.apple.com/opensource/

Probably the issue with cross-compiling to macOS is the need to have access to a Mac for testing the resulting binary. macOS is not licensed to use on anything except Apple-branded computers.

http://images.apple.com/legal/sla/docs/macOS1013.pdf

« Last Edit: January 09, 2018, 02:56:04 pm by Phil »

Leledumbo

  • Hero Member
  • *****
  • Posts: 7928
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Crosscompilation to Mac OSX possible?
« Reply #2 on: January 09, 2018, 08:35:46 pm »
It used to be possible, but has been long broken and nobody seems wanting to revive the effort. There are ready made cross binutils in github if one wants to try.

avra

  • Hero Member
  • *****
  • Posts: 1297
    • Additional info
Re: Crosscompilation to Mac OSX possible?
« Reply #3 on: January 09, 2018, 09:39:34 pm »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Rel

  • New member
  • *
  • Posts: 33
Re: Crosscompilation to Mac OSX possible?
« Reply #4 on: January 10, 2018, 11:34:40 am »
fpcupdeluxe seems nice, but my development machine has to be offline due to some paranoid security rules of my company... %)
and it even fails while downloading svn client... nice...
« Last Edit: January 10, 2018, 11:53:33 am by Rel »

avra

  • Hero Member
  • *****
  • Posts: 1297
    • Additional info
Re: Crosscompilation to Mac OSX possible?
« Reply #5 on: January 11, 2018, 11:40:25 am »
fpcupdeluxe seems nice, but my development machine has to be offline due to some paranoid security rules of my company... %)
If you do it all at home and then copy to the same dir on your work pc, your Lazarus will work. Just make sure that you also copy your generated shortcut and start Lazarus only through that. It simply works.

and it even fails while downloading svn client...
Are you behind a proxy? If not, then something in your path probably bothers FpcUpDeluxe. Try something similar to this:
http://www.pilotlogic.com/sitejoom/index.php/forum/installation-setup/2907-fcllaz-pas-fatal-error-while-i-build-typhonide?start=20
If I remember well, fpcupdeluxe has alternative download method that you can set in it's options (setup button). That should be your first bet.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Rel

  • New member
  • *
  • Posts: 33
Re: Crosscompilation to Mac OSX possible?
« Reply #6 on: January 11, 2018, 02:27:45 pm »
yes, I'm behind the proxy... I tried downloading files manually and put them into proper locations,
but got sick and tired of it very quickly... the other download method (using curl and wget) doesn't
work properly either...

avra

  • Hero Member
  • *****
  • Posts: 1297
    • Additional info
Re: Crosscompilation to Mac OSX possible?
« Reply #7 on: January 12, 2018, 01:06:13 am »
yes, I'm behind the proxy
Did you enter all proxy authorization data in options (Setup+ button)?
If you did, then turn on "be extra verbose" option and report to the author.
You can skip all proxy stuff and do it at home as I have already said and just use it at work.

If everything else fails, you can try to set cross compiler manually (very hard), or try CodeTyphon (but you will also need internet connection).
« Last Edit: January 12, 2018, 01:08:59 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Rel

  • New member
  • *
  • Posts: 33
Re: Crosscompilation to Mac OSX possible?
« Reply #8 on: January 12, 2018, 09:24:39 am »
Quote
Did you enter all proxy authorization data in options (Setup+ button)?
the proxy I'm using has no authorization...

Quote
If you did, then turn on "be extra verbose" option and report to the author.
sadly setting this option doesn't seem to change anything, it still reports "FPCNativeInstaller
(GetFile) Could not download file with URL..." and nothing concrete about the actual error...

Quote
You can skip all proxy stuff and do it at home as I have already said and just use it at work.
I'm on Linux at home and on Windows at work... I tried to install VirtualBox on my linux at home and
create virtual machine with Windows 7, but when I run virtual machine my Linux computer hangs...
I couldn't as of yet figure out what is the problem...  :(

Quote
or try CodeTyphon (but you will also need internet connection)
CodeTyphon is a huge package, it seems to be including everything that is needed in the package,
however for some strange reason CodeTyphon doesn't have an option to build crosscompiler from
Windows to Mac OS X, only to different Linux variants...

Rel

  • New member
  • *
  • Posts: 33
Re: Crosscompilation to Mac OSX possible?
« Reply #9 on: January 12, 2018, 09:51:02 am »
nevermind, a buddy of mine gave me a copy of Proxifier app, that hooks all request
and tunnels it through the proxy, at very least fpcupdeluxe now started downloading
everything as it should...

avra

  • Hero Member
  • *****
  • Posts: 1297
    • Additional info
Re: Crosscompilation to Mac OSX possible?
« Reply #10 on: January 12, 2018, 11:22:48 am »
I tried to install VirtualBox on my linux at home and create virtual machine with Windows 7
Wine?

Quote
CodeTyphon doesn't have an option to build crosscompiler from
Windows to Mac OS X, only to different Linux variants...
It looks you're right. Mac OS X seams to be supported as a host OS, but not as a target OS. Sorry for missleading.

nevermind, a buddy of mine gave me a copy of Proxifier app, that hooks all request
and tunnels it through the proxy, at very least fpcupdeluxe now started downloading
everything as it should...
I am glad you made it. Sometimes for a problematic nail all you need is a bigger hammer...  :D
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

DonAlfredo

  • Hero Member
  • *****
  • Posts: 910
Re: Crosscompilation to Mac OSX possible?
« Reply #11 on: January 12, 2018, 12:15:08 pm »
@Rel
I hope you will succeed.
FYI, all fpcupdeluxe binaries for Mac are made by cross-compilation from Windows.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus