Building a GCC PowerPC/Linux Cross Compiler For SPARC/Solaris[2]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 huzancheng 的 blog

  • binutils
    1. extract
      1. cd <source dir>
      2. gtar zxvf <archive dir>/binutils-2.10.1.tar.gz

    2. build
      1. mkdir <tool dir>/host
      2. mkdir <tool dir>/host/sparc-sun-solaris
      3. mkdir <object dir>/binutils-2.10.1
      4. cd <object dir>/binutils-2.10.1
      5. <source dir>/binutils-2.10.1/configure --host=sparc-sun-solaris --target=powerpc-linux --prefix=<tool dir>/host/sparc-sun-solaris
      6. gmake

    3. install
      1. gmake install
      2. gmake install-info

    4. access

      subsequent build steps will need to use the tools created by this step. as such, the path to these tools will need to be added to your environment's path variable:

      1. path=${path}":<tool dir>/host/sparc-sun-solaris/bin"
      2. export path

  • gcc (core)
    1. extract
      1. cd <source dir>
      2. gtar zxvf <archive dir>/gcc-core-2.95.2.tar.gz

    2. build
      1. mkdir <object dir>/gcc-2.95.2
      2. cd <object dir>/gcc-2.95.2
      3. <source dir>/gcc-2.95.2/configure --host=sparc-sun-solaris --target=powerpc-linux --prefix=<tool dir>/host/sparc-sun-solaris --with-newlib
      4. gmake

    3. install
      1. gmake install

  • linux headers
  • the 2.4.0 kernel contains powerpc support; however, it may not contain the absolute latest bleeding-edge changes to accomodate various powerpc architectures. such changes are maintained elsewhere.

    1. extract
      1. cd <source dir>
      2. gtar zxvf <archive dir>/linux-2.4.0.tar.gz

    2. build
      1. cd <source dir>/linux
      2. edit the makefile
        1. comment out the existing "arch :=" line and add a new line with "arch := ppc". line.
        2. find the "cross_compile =" line and append 'powerpc-linux-' so that it reads "cross_compile = powerpc-linux-"

      3. if you have tcl/tk installed, then "gmake xconfig", or if you have the gnu ncurses library installed, then "gmake menuconfig", otherwise "gmake config" .
      4. gmake dep
      5. gmake clean
      6. gmake zimage

      the zimage build process does not have to complete successfully; only the headers are required.

    3. verify

      verify that the headers were created.

      1. find ./include/. -name "version.h"

      you should see output similar to: "./include/./linux/version.h".

      if you do not have the appropriate headers, use the "gmake distclean" command and repeat the steps for this section again.

    本文关键:Building a GCC PowerPC/Linux Cross Compiler For SPARC/Solaris
      相关方案
    Google
     

    本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

    go top