【CLFS】記錄:

來源:互聯網
上載者:User

CLFS線上文檔:
http://cross-lfs.org/view/clfs-embedded/arm/index.html

1、環境變數準備:
export CLFS_HOST=$(echo ${MACHTYPE} | sed "s/-[^-]*/-cross/")

export CLFS=/home/wutiejun/host/clfs
export CLFS_HOST=i686-cross-linux
export CLFS_TARGET=arm-wap-linux-uclibceabi
export CLFS_PREFIX=/home/wutiejun/host/clfs/cross-tools
export CLFS_ARCH="arm"
export CLFS_ENDIAN="little"
export CLFS_FLOAT="soft"
export CLFS_ABI="aapcs-linux"
export CLFS_ARM_ARCH="armv6"
export CLFS_ARM_MODE="arm"
export CLFS_FPU=""

/home/wutiejun/host/clfs/cross-tools/usr/include

arm-wap-linux-uclibceabi-

2、準備核心標頭檔:
make mrproper
make ARCH=${CLFS_ARCH} headers_check
make ARCH=${CLFS_ARCH} INSTALL_HDR_PATH=${CLFS_PREFIX}/usr/include headers_install

cp -rv dest/include/* ${CLFS}/usr/include

3、GMP包編譯:
CPPFLAGS=-fexceptions ./configure \
    --prefix=${CLFS}/cross-tools

make
make check
make install

3、編譯MPFR包:
LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
  ./configure --prefix=${CLFS}/cross-tools --enable-shared \
  --with-gmp=${CLFS}/cross-tools

make
make install

3、編譯MPC包:
LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
  ./configure --prefix=${CLFS}/cross-tools \
      --with-gmp=${CLFS}/cross-tools \
      --with-mpfr=${CLFS}/cross-tools

make
make install

3、編譯binutils;
config參數:

../binutils-2.21/configure --prefix=${CLFS}/cross-tools \
   --target=${CLFS_TARGET} --with-sysroot=${CLFS} --disable-nls \
   --enable-shared --disable-multilib

make configure-host
make

make install

cp -v ../binutils-2.21/include/libiberty.h ${CLFS}/usr/include

4、編譯靜態gcc:

AR=ar LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
  ../gcc-4.6.0/configure --prefix=${CLFS}/cross-tools \
  --build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} \
  --with-sysroot=${CLFS} --disable-nls  --disable-shared \
  --with-mpfr=${CLFS}/cross-tools --with-gmp=${CLFS}/cross-tools \
  --with-mpc=${CLFS}/cross-tools --without-headers --with-newlib \
  --disable-decimal-float --disable-libgomp --disable-libmudflap \
  --disable-libssp --disable-threads --enable-languages=c \
  --disable-multilib --with-abi=${CLFS_ABI} --with-arch=${CLFS_ARM_ARCH} \
  --with-mode=${CLFS_ARM_MODE} --with-float=${CLFS_FLOAT} \
  --with-fpu=${CLFS_FPU}

make all-gcc all-target-libgcc

make install-gcc install-target-libgcc

5、編譯uclibc:
declare -x

PATH="/home/wutiejun/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt

/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin"

export PATH=$PATH:${CLFS_PREFIX}/bin

patch -Np1 -i ../uClibc-0.9.31-configs-2.patch

修改eabi或者oabi
cp -v clfs/config.${CLFS_ARCH}.${CLFS_ENDIAN} .config
if [ "${CLFS_ABI}" == "aapcs" ] || [ "${CLFS_ABI}" == "aapcs-linux" ]; \
  then sed -i s/CONFIG_ARM_OABI/CONFIG_ARM_EABI/g .config; fi

make oldconfig

make

make PREFIX=${CLFS} install

6、編譯gcc第二次:

AR=ar LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \
  ../gcc-4.6.0/configure --prefix=${CLFS}/cross-tools \
  --build=${CLFS_HOST} --target=${CLFS_TARGET} --host=${CLFS_HOST} \
  --with-sysroot=${CLFS} --disable-nls --enable-shared \
  --enable-languages=c --enable-c99 --enable-long-long \
  --with-mpfr=${CLFS}/cross-tools --with-gmp=${CLFS}/cross-tools \
  --with-mpc=${CLFS}/cross-tools --disable-multilib \
  --with-abi=${CLFS_ABI} --with-arch=${CLFS_ARM_ARCH} \
  --with-mode=${CLFS_ARM_MODE} --with-float=${CLFS_FLOAT} \
  --with-fpu=${CLFS_FPU}

make

make install

cp -v ${CLFS}/cross-tools/${CLFS_TARGET}/lib/libgcc_s.so.1 ${CLFS}/lib

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.