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

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

本文简介:选择自 huzancheng 的 blog

  • glibc
    1. link
      1. ln -sf <linux source dir>/include/asm <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/asm
      2. ln -sf <linux source dir>/include/linux <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/linux
      3. ls -la <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/asm/*
      4. ls -la <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/linux/*

    2. extract
      1. cd <source dir>
      2. gtar zxvf <archive dir>/glibc-2.1.3.tar.gz
      3. cd <source dir>/glibc-2.1.3
      4. gtar zxvf <archive dir>/glibc-crypt-2.1.3.tar.gz
      5. gtar zxvf <archive dir>/glibc-linuxthreads-2.1.3.tar.gz

    3. build
    4. first, create a separate subdirectory, such as <tool dir> /target/powerpc-linux-gnu in which to install the glibc libraries. this will be the target of the --prefix configure switch.

      the configure script is quite specific about what versions (and flavors) of various build tools it requires. if it doesn't find what it's looking for, chance are that things won't build. try to appease it.

      1. mkdir <tool dir>target
      2. mkdir <tool dir>target/powerpc-linux-gnu
      3. mkdir <object dir>/glibc-2.1.3
      4. cd <object dir>/glibc-2.1.3
      5. cc=powerpc-linux-gcc ar=powerpc-linux-ar ranlib=powerpc-linux-ranlib <source dir>/glibc-2.1.3/configure --host=powerpc-linux --with-headers=<linux source dir>/include --enable-add-ons=crypt,linuxthreads --enable-shared --prefix=<tool dir>/target/powerpc-linux-gnu
      6. gmake

        there are a few likely pitfalls here. first, depending on which echo the make process finds (svr4, bsd, gnu, shell built-in, etc.) there will be an error in csu/version-info.h if it picks the wrong one. picking the wrong one results in '-n version...' rather than the intended 'version...' in csu/version-info.h.

        you will also probably notice in the csu/version-info.h file that it reports that it was compiled "on a linux 5.7 system". this should report "on a linux 2.4.0 system". this due to more echo problems. the actual content doesn't really matter, it just affects what it output when /usr/lib/libc.so is executed.

      7. edit and fix the csu/version-info.h file as necessary.
      8. gmake

        the second pitfall when building on a stock solaris 2.7 machine, is that there is a limit of 64 open file descriptors. this will result in an error building in the iconvdata/ subdirectory. this can be remedied by ratcheting up the limit to 1024:

      9. /usr/bin/ulimit -n 1024
      10. gmake

      the overall build process should take several hours to complete, even on the brawniest of hardware.

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

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

    go top