一、下载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相关的库文件。如下图




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

591

被折叠的 条评论
为什么被折叠?



