How to cross compile from Mac OS X to Linux x86?

后端 未结 5 964
眼角桃花
眼角桃花 2020-11-29 05:27

I\'m running Mac OS X 10.5.8 and want to compile for target CentOS 5.3 with GCC 4.1.2. How could I:

  1. Compile GCC 4.1.2 toolchain and related tools?
  2. Use
5条回答
  •  悲哀的现实
    2020-11-29 06:05

    Your simplest solution is to just run CentOS 5.3 in a VM (e.g. Sun VirtualBox). This requires minimal setup, has quite reasonable overhead (assuming an Intel Mac), and you'll be able to actually test and debug what you are building.

    If you really insist on cross-compiling, you must build a cross-compiler. Instructions are here and here, but beware: it will likely take you several days to get it right, and then you'll still need a VM to test the result, so I don't see any point in doing it that way.

提交回复
热议问题