十、海思编译工具编译glibc

本文详细介绍如何从源代码下载、解压、配置并编译glibc库,特别针对arm-himix100-linux平台,包括解决配置错误及版本兼容性问题。

一、下载glic源代码
http://ftp.gnu.org/gnu/libc/

二、解压glic源代码
 

tar -zxvf ./glibc-2.30.tar.gz

三、配置glibc

  进到glibc目录下,新建一个目录,如

1、创建output目录

mkdir output

2、进入到output目录后执行

`pwd`/../configure --host=arm-himix100-linux --program-prefix=arm-hisi- --prefix=`pwd`

 本人尝试过,直接在源代码的根目录直接配置(错误做法

./configure --host=arm-himix100-linux --program-prefix=arm-hisi- --prefix=`pwd`/output

会出现如下错误信息

checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-himix100-linux-gnu
checking for arm-himix100-linux-gcc... arm-himix100-linux-gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-himix100-linux-gcc accepts -g... yes
checking for gcc... gcc
checking for arm-himix100-linux-readelf... arm-himix100-linux-readelf
checking for arm-himix100-linux-g++... arm-himix100-linux-g++
checking whether we are using the GNU C++ compiler... yes
checking whether arm-himix100-linux-g++ accepts -g... yes
checking whether arm-himix100-linux-g++ can link programs... yes
configure: error: you must configure in a separate build directory

因此,需要参考步骤1与2来做即可。

配置过程中出现以下错误:

configure: error: 
*** These critical programs are missing or too old: make
*** Check the INSTALL file for required versions.

     由于目前使用的是海思原厂提供的编译工具,因此我们无法更换编译工具,只有将glibc的版本降低,经测试,在使用glibc-2.20可以通过配置。

    重新解压glibc-2.20 这个版本,然后按照步骤1、2重新configue一次即可。

四、编译
  在output目录下执行

  make && make install

 大概经过十几分钟的编译,即可在output目录下生成glibc相关的库文件。如下图

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值