# Cross-compile on FreeBSD PPC64 for OSX PPC(64)?



## barracuda156 (Dec 13, 2021)

If anyone has a practical experience, please advise me.

I am a Mac user for past 20 years, and at the moment I am trying to build some modern open-source software to run on my G5 Quad under 10.6 PPC. Most of it does build (I use Macports for that). However some fail, including software that I would really want to have on it (for example, RStudio and one or the other implementation of Stan).
The problem seems to be two-fold: 1) gcc8 and later fail to build on 10.5.8 and 10.6 PowerPC with Bus errors, no solution found so far (and no recent clang builds); 2) Xcode 3.2 does not support some modern features (for instance I get errors with ibtool and XIBs).

Then I tried to build a cross-compiler on an Intel Mac with Catalina and Xcode 12.4 that could compile PowerPC code against 10.5 and 10.6 SDKs (XcodeLegacy project makes that possible in principle). That ran into some errors which are of unclear nature.

So I start considering alternatives, and an immediate one seems to be FreeBSD which supports PPC and PPC64 and has some similarities with OSX (for which reason I prefer it over any Linux). Could this possibly work?

P. S. While I might as well just have FreeBSD as a second system for using required scientific software like R with Stan, this is a fallback option, since some software that I also use does not exist for Unix at all (think of Adobe). Rebooting from one to another is certainly doable, but inconvenient.


----------



## msplsh (Dec 13, 2021)

You can't run the OS X toolchain on FreeBSD.  You will need to solve your errors of "unclear nature."


----------



## barracuda156 (Dec 13, 2021)

msplsh said:


> You can't run the OS X toolchain on FreeBSD.  You will need to solve your errors of "unclear nature."



Yeah, of course, but toolchains to cross-compile for OSX certainly do exist: https://github.com/tpoechtrager/osxcross


----------



## msplsh (Dec 13, 2021)

Is the question then "does that even work?" because the answer is going to be "it depends on the project."  If you think the mere existence of the cross compiler will solve your problem, then go ahead and try it? 

You could try an earlier, but still deprecated, toolchain like 4.6.2 for 10.8 depending on what is the earliest version of OS X your Intel Mac will accept.

If these are open source projects, you may need to consider that the projects dropped support for 10.6 PPC for a reason, and that may be because they require more work than some tweak tips from a FreeBSD forum.  The project might require an API that doesn't even exist on the platform you're attempting to compile against and making a shim could be an incredible amount of work.


----------



## Alain De Vos (Dec 13, 2021)

Big chance that cross will not work because of slightly different or not updated versions.


----------

