Cross Compile On Linux For Mac



  1. Cross Compile Linux Kernel Module
  2. Arm Linux Cross Compile
  3. Cross Compile On Linux For Macs

Real cross-compiling (building on Linux for MacOS X) This means that you have a gcc version on your Linux machine that emits executables that run on OSX. Unfortunately, OSX uses MACH-O binaries and building a cross-compiling gcc is very tricky. So I would not consider this as a reasonable option. Nachos accepts COFF binary files produced by any MIPS compiler be it installed on Linux, Windows or Mac OSX. Therefore, you can compile your user program on the instructional machine and copy to your test directory for execution. Errors in compiling user programs typically come from incompatibility between the compiler and the machine.

  • 1Cross compiling for macOS on Linux

Cross compiling for macOS on Linux

Requirements

What you'll need:

Adb

  • an Intel Mac running Leopard, Snow Leopard, or Lion
  • Xcode installed on your Mac or the original or retail operating system DVD (for the SDK)
  • a working Linux setup (tested with Debian Squeeze)
  • up to date source for FPC (tested with 2.4.x) and Lazarus (tested with 0.9.30)
  • the Open Darwin cctools (odcctools)

Warning: These instructions are for i386 Linux; trying this on x64 Linux has failed. Update 2013-12-13: cross compiling from Linux for macOS no longer works at all for 10.8 and above. The compiler works fine but viable linker tools (cctools for linux) are not available for Linux anymore. Please adjust instructions if you find a solution for this. The cctools are available in Arch Linux.

STEP 1: copy the SDK from your Mac

You need to install Xcode from your operating system DVD if you've not already done so and copy the SDK to an appropriate location on your Linux box.

I'd recommend Leopard 10.5.sdk (compatible with Leopard) but it depends on how far back you want to be compatible. The 10.5.sdk is located in /Developer/SDKs on the Mac.I put mine at /opt/Mac/ on my Debian box. Example using ssh from your Linux box to copy over the files:

STEP 2: grab odcctools from SVN

Odcctools apparantly provide binutils for OSX/Darwin.

On 64 bit Linux environments, fpc mailing list users have problems with this step. Perhaps this StackOverflow question and answer can help: in the configure step, you'd apparently need to setCC='gcc -m32' CXX='g++ -m32' ./configure blah blah blah

and build it as

This installs the tools in /opt/odcctools.I've specified gcc 4.4 but it should be okay with other versions.

For

STEP 3: rebuild FPC

Mac

(my sources are in ~/hg/pascal)

Note that the options (OPT) as shown are vital, especially -gw.

STEP 4: configure fpc.cfg

Add a darwin (cross-compile) clause to /etc/fpc.cfg:

STEP 5: build the Carbon LCL

Cross Compile Linux Kernel Module

Be sure to specify the Darwin OS target, i386 CPU target and, most importantly, add the -gw option. Perform a Clean+Build of the LCL and the Package Registration.

Video editor for mac. Adobe Photoshop Elements. Where you can use it: Mac and Windows Why we love it: While not truly a free photo editor, Photoshop Elements does have a free trial, and it’s far and away among the best photo editing software for Mac and Windows.The suite of automated editing tools — including for exposure, color balance, and reducing the effects of camera shake — make short work of the. Verdict: The licensed version of Pixelmator is widely perceived as of the best photo editing apps for Mac from third-party developers.It features an easy-to-navigate interface with a set of basic features that will make your workflow easier. An amazing feature that Pixelmator Pro offers is the naming of layers imported from external files by their content. Hopefully, our selection of the best free programs for photo editing on Mac will help you choose the right app to suit all your creative needs. Luminar (7 days trial) Luminar is another full-featured photo editor that’s popular with both Mac and Windows users. It can work as a standalone app as well as a plugin for such popular programs as.

Arm Linux Cross Compile

You should now be able to use Lazarus in Linux to build for macOS.

Gotcha's

There are two more gotcha's when cross-compiling to macOS:

  • Be sure to specify the -gw in your projects to avoid problems

reported in (the unfixable) FPC bug #12001.

  • Be sure to specify the -XR option pointing to your SDK root (e.g. -XR/opt/Mac/Leopard10.5.sdk), or the Darwin linker will try to link to the wrong startup object (/usr/lib/crt1.o).

Source

Fpc Mailing list 6 August 2011 post by Bruce titled 'Re: Cross Compiling from Linux to Leopard 10.5 or Snow Leopard 10.6 target. How? [SOLVED]'Adapted by BigChimp

Older instructions

This section was taken from the general Cross compiling page and may still be of interest:

Cross compile on linux for macbook pro
  • First you need the binutils for the platform you want to compile to. Download odcctools from this site (use the cvs version) and follow their instructions for installing. http://www.opendarwin.org/projects/odcctools/
  • you need to create a fake root dir like: $HOME/darwinroot copy at least the /System and /Frameworks and /usr directories (you may have to copy more than this) from your Apple or Darwin computer to $HOME/darwinroot
  • now that you have these files make a folder in $HOME/darwinroot called cross. where ever you installed the odcctools you need to make links for the cross tools to be more fpc friendly. there are a bunch of files from odcc tools called powerpc-apple-darwin-* you need to make links (or rename them) so powerpc-apple-darwin-ld becomes powerpc-darwin-ld, do the same for *-ar and *-as.
  • now you are ready to crosscompile fpc. basically you need to have the fpc source and have a terminal open there.

type:

Cross Compile On Linux For Macs

type (iirc):

if that succeded you can install it to whereever you want with:

Arm linux cross compile

now copy the file ./compiler/ppccross somewhere you will be able to find it as it's the compiler you'll need to build powerpc programs

  • configure your /etc/fpc.cfg file.

add a section like this:

whenever you want to crosscompile you have to have ppccross and the symlinks to powerpc-darwin-* in the PATHand you should be able to just do ppccross someprogie.pas and it will create a darwin executable.

I may have missed some things (or most everything) as it's been a while since I did this.

Retrieved from 'https://wiki.freepascal.org/index.php?title=Cross_compiling_OSX_on_Linux&oldid=129917'