Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
826 views
in Technique[技术] by (71.8m points)

macos - Cross-compiler for Linux on Mac OS X?

I've been reading lots of documents on the internet about creating a cross compiler for linux on mac os x but can't seam to get any to work.

It seams as if no one can help me with the question: Getting GMP to work with GCC 4.5.2

Is there any easy'er way to create a cross compiler?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You need to:

  1. install the xcode base build tools
  2. install the optional xcode command line tools
  3. install homebrew
  4. install the homebrew build tools
    4.1 brew install crosstool-ng mpfr gmp grep
    4.2 brew tap homebrew/dupes
  5. create a case sensitive volume using "disk utility"
  6. use this volume to build the tool chain itself
    6.1 generate a base configuration (for me this is an arm cortex a8)
    6.1.1 ct-ng arm-cortex_a8-linux-gnueabi
    6.2 use menuconfig (ct-ng menuconfig) to tweak the configuration
    6.2.1. disable fortran and java (c compiler)
    6.2.2. turn off static linking (c compiler)
    6.2.3. change the paths to be on the volume you created above (paths and misc options)
    6.2.4. remove dmalloc (debug facilities)
    6.3 invoke the build:
    6.3.1 ulimit -n 1024
    6.3.2 ct-ng build

with much thanks to the crosstools-ng list.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...