libc编译及问题解决

目标:

编译出libc库文件,进行替换验证;

下载源码:

https://www.gnu.org/software/libc/

编译:

mkdir libc

cd libc

tar -xzf glibc-2.18.tar.gz

cd glibc-2.18/

mkdir build

cd build

../configure CC=arm-cortex_a9-linux-gnueabi-gcc CXX=arm-cortex_a9-linux-gnueabi-g++ --host=arm-linux-gnueabi --build=i686-pc-linux-gnu --prefix=$ROOTDIR/out --enable-add-ons=nptl,ports --with-headers=$ROOTDIR/headers/include --enable-kernel=3.4.39 libc_cv_forced_unwind=yes libc_cv_ctors_header=yes libc_cv_c_cleanup=yes --disable-oldest-abi

make

make install

编译过程中问题及解决:

问题1:

configure: error: Old ABI no longer supported

解决:

--host=arm-linux-gnueabi 

这里如果为--host=arm-linux将会报上面的错误,因为

glibc-2.18/ports/sysdeps/arm/preconfigure中要求--host=arm-linux-gnueabi

  5 arm*)
  6   case $config_os in
  7   linux-gnueabi*)
  8     # If the compiler enables unwind tables by default, this causes
  9     # problems with undefined symbols in -nostdlib link tests.  To
 10     # avoid this, add -fno-unwind-tables here and remove it in
 11     # sysdeps/unix/sysv/linux/arm/configure.in after those tests have
 12     # been run.
 13     if test "${CFLAGS+set}" != "set"; then
 14       CFLAGS="-g -O2"
 15     fi
 16     CFLAGS="$CFLAGS -fno-unwind-tables"
 17     ;;
 18   linux*)
 19     as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
 20     ;;



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值