博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【CLFS】记录:
阅读量:6636 次
发布时间:2019-06-25

本文共 3285 字,大约阅读时间需要 10 分钟。

CLFS在线文档:

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

 

 

 

转载地址:http://tnsvo.baihongyu.com/

你可能感兴趣的文章
zabbix自动发现端口并监控
查看>>
【转】WaitForSingleObject()& ReleaseMutex()的用法
查看>>
加域时,客户机必须启动的服务
查看>>
MY BACKUP JOB COMPLETED BUT HAS EXCEPTIONS OR WARNINGS, WHY?
查看>>
杭电 hdu 2010
查看>>
Uwsgi的安装
查看>>
关于短信的管理:删除、读、等等
查看>>
仿猪八戒首页导航菜单
查看>>
Nginx 漏洞 (CVE-2018-16843,CVE-2018-16844)
查看>>
轻松解决“正在连接”无线的故障
查看>>
直接退出程序
查看>>
poj 2481 Cows【线段树单点更新】
查看>>
32位LINUX下hadoop2.2.0重新编译及安装步骤
查看>>
前端开发学习系列之一:准备工作
查看>>
活动目录中的Get-Aduser这个cmdlets调用的是账户的哪个属性?
查看>>
我的友情链接
查看>>
shell中if的参数说明
查看>>
随笔-java注解,反射,枚举
查看>>
jqm two columns
查看>>
我的友情链接
查看>>