打补丁:
$root@host:/home/arm/build-tools/# cd gcc-4.2.1
$root@host:/home/arm/build-tools/gcc-4.2.1#
patch –Np1 –i /home/arm/build-tools/patch/gcc-4.2.1-*
$root@host:/home/arm/build-tools/ gcc-4.2.1# cd ..
$root@host:/home/arm/build-tools/# cd build-boot-gcc
$root@host:/home/arm/build-tools/build-boot-gcc#
../gcc-4.2.1/configure --target=${TARGET} --prefix=${PREFIX}
--with-newlib --enable-languages=c --disable-threads --disable-shared
$root@host:/home/arm/build-tools/build-boot-gcc # make all-gcc
$root@host:/home/arm/build-tools/build-boot-gcc # make install-gcc
在${PREFIX}/bin下会生成 arm-linux-开头的文件:
$root@host:/home/arm/build-tools/build-boot-gcc # ls ${PREFIX}/bin
5、 生成glibc库文件:
$root@host:/home/arm/build-tools/build-boot-gcc # cd ..
$root@host:/home/arm/build-tools# cd build-glibc
$root@host:/home/arm/build-tools/build-glibc# CC=arm-linux-gcc ../glibc-2.6.1/configure --host=$TARGET --prefix=”/usr”
--cache-file=config.cache
这里的config.cache与前面编译glibc头文件时的config.cache完全相同。
$root@host:/home/arm/build-tools/build-glibc# make
$root@host:/home/arm/build-tools/build-glibc#
make install_root=${TARGET_PREFIX} prefix=”” install
对libc.so作出修改:
$root@host:/home/arm/build-tools/build-glibc# cd ${TARGET_PREFIX}/lib
$root@host:/home/arm/tools/arm-linux/lib#
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( /lib/libc.so.6 /lib/libc_nonshared.a
将GROUP这一行的内容改为:
GROUP ( libc.so.6 libc_nonshared.a
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( /lib/libpthread.so.0 /lib/libpthread_nonshared.a )
6、 生成完整的编译工具:
$root@host:/home/arm/tools/arm-linux/lib# cd ${PRJROOT}/build-tools/build-gcc
$root@host:/home/arm/build-tools/build-gcc#
../gcc-4.2.1/configure --target=$TARGET --prefix=${PREFIX}
--enable-languages=c,c++ --with-threads=posix
上一篇:基于3c2410的linux2.6.22移植(2)
下一篇:基于3c2410的linux2.6.22移植(4)
推荐阅读最新更新时间:2024-03-16 14:52