安装glib库:
configure 配置选项 --enable-debug=no 选项:默认是mini模式,在release的时候应该使用该选项 --disable-included-printf 选项:这个选项要谨慎使用,可能会造成某些 printf 家族的函数不能使用 tar xf glib-2.40.0.tar.xz cd glib-2.40.0 ./configure --enable-debug=no make make install
配置环境变量:
vim /etc/profile
添加下面的内容:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
那就去清华开源站点下载glibc
https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/
在介绍压缩目录里建build,../configure --prefix=/opt/glibc-2.27 make make install
/data1/ovs/qemu-system-aarch64: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /data1/ovs/qemu-system-aarch64)
/data1/ovs/qemu-system-aarch64: /lib64/libc.so.6: version `GLIBC_2.27' not found (required by /data1/ovs/qemu-system-aarch64)
[Inferior 1 (process 4289) exited with code 01]
(gdb) quit
[root@localhost ovs]# strings /lib64/libc.so.6 | grep GLIBC_
GLIBC_2.17
GLIBC_2.18
GLIBC_PRIVATE
gethostbyname2_r@@GLIBC_2.17
_IO_fopen@@GLIBC_2.17
_IO_file_finish@@GLIBC_2.17
_dl_starting_up@@GLIBC_PRIVATE
_IO_fgetpos@@GLIBC_2.17
getaliasent_r@@GLIBC_2.17
_IO_file_seekoff@@GLIBC_2.17
getrpcent_r@@GLIBC_2.17
getservbyname_r@@GLIBC_2.17
_rtld_global@@GLIBC_PRIVATE
_IO_file_init@@GLIBC_2.17
getservbyport_r@@GLIBC_2.17
__libc_enable_secure@@GLIBC_PRIVATE
posix_spawn@@GLIBC_2.17
tmpfile@@GLIBC_2.17
realpath@@GLIBC_2.17
_IO_fgetpos64@@GLIBC_2.17
getrpcbyname_r@@GLIBC_2.17
_rtld_global_ro@@GLIBC_PRIVATE
__pointer_chk_guard@@GLIBC_PRIVATE
getspent_r@@GLIBC_2.17
_IO_file_close_it@@GLIBC_2.17
sys_sigabbrev@@GLIBC_2.17
_IO_fsetpos@@GLIBC_2.17
_sys_nerr@@GLIBC_2.17
pthread_cond_timedwait@@GLIBC_2.17
_IO_do_write@@GLIBC_2.17
getnetbyname_r@@GLIBC_2.17
getpwnam_r@@GLIBC_2.17
_mcount@@GLIBC_2.18
gethostbyname_r@@GLIBC_2.17
_IO_file_setbuf@@GLIBC_2.17
pthread_cond_destroy@@GLIBC_2.17
getaliasbyname_r@@GLIBC_2.17
getprotoent_r@@GLIBC_2.17
getspnam_r@@GLIBC_2.17
getrpcbynumber_r@@GLIBC_2.17
nftw64@@GLIBC_2.17
getnetent_r@@GLIBC_2.17
_res@GLIBC_2.17
posix_spawnp@@GLIBC_2.17
_IO_popen@@GLIBC_2.17
pclose@@GLIBC_2.17
nftw@@GLIBC_2.17
_IO_file_xsputn@@GLIBC_2.17
_sys_errlist@@GLIBC_2.17
_IO_proc_open@@GLIBC_2.17
_IO_file_overflow@@GLIBC_2.17
_IO_fdopen@@GLIBC_2.17
getgrgid_r@@GLIBC_2.17
getnetbyaddr_r@@GLIBC_2.17
__res_maybe_init@GLIBC_PRIVATE
pthread_cond_signal@@GLIBC_2.17
h_errno@GLIBC_PRIVATE
_IO_file_attach@@GLIBC_2.17
_IO_file_sync@@GLIBC_2.17
getpwuid_r@@GLIBC_2.17
pthread_cond_wait@@GLIBC_2.17
_sys_siglist@@GLIBC_2.17
fopencookie@@GLIBC_2.17
pthread_cond_broadcast@@GLIBC_2.17
getpwent_r@@GLIBC_2.17
gethostbyaddr_r@@GLIBC_2.17
sched_setaffinity@@GLIBC_2.17
getgrent_r@@GLIBC_2.17
fnmatch@@GLIBC_2.17
getgrnam_r@@GLIBC_2.17
_IO_fclose@@GLIBC_2.17
pthread_cond_init@@GLIBC_2.17
regexec@@GLIBC_2.17
localeconv@@GLIBC_2.17
_IO_file_write@@GLIBC_2.17
gethostent_r@@GLIBC_2.17
_IO_proc_close@@GLIBC_2.17
getservent_r@@GLIBC_2.17
_IO_file_fopen@@GLIBC_2.17
getprotobyname_r@@GLIBC_2.17
sched_getaffinity@@GLIBC_2.17
__tls_get_addr@@GLIBC_2.17
getprotobynumber_r@@GLIBC_2.17
_IO_file_underflow@@GLIBC_2.17
_dl_argv@@GLIBC_PRIVATE
pthread_attr_init@@GLIBC_2.17
_IO_fsetpos64@@GLIBC_2.17
*** These critical programs are missing or too old: bison
*** Check the INSTALL file for required versions.
[root@localhost build]# bison --version
-bash: bison: command not found
[root@localhost build]# bison -V
-bash: bison: command not found
[root@localhost build]# yum install bison -y
使配置文件立即生效
source /etc/profile
root@cloud:/home/ubuntu/glib-2.40.0# ls /usr/bin/gcc -al lrwxrwxrwx 1 root root 5 May 21 2019 /usr/bin/gcc -> gcc-7 root@cloud:/home/ubuntu/glib-2.40.0# ls /usr/bin/g++ -al lrwxrwxrwx 1 root root 5 May 21 2019 /usr/bin/g++ -> g++-7 root@cloud:/home/ubuntu/glib-2.40.0#
Makefile:1386: recipe for target 'libglib_2_0_la-gdate.lo' failed
apt-get install gcc-5 g++-5
root@cloud:/home/ubuntu/glib-2.40.0# rm /usr/bin/gcc root@cloud:/home/ubuntu/glib-2.40.0# rm /usr/bin/g++ root@cloud:/home/ubuntu/glib-2.40.0# ln -s /usr/bin/gcc-5 /usr/bin/gcc root@cloud:/home/ubuntu/glib-2.40.0# ln -s /usr/bin/g++-5 /usr/bin/g++ root@cloud:/home/ubuntu/glib-2.40.0#
sudo apt --fix-broken install sudo dpkg --configure -a sudo apt-get update sudo apt-get upgrade sudo apt-get remove gcc-7 g++-7 sudo apt-get remove gcc-6 g++-6 sudo apt-get install gcc-5 g++-5 sudo apt autoremove sudo unlink /usr/bin/gcc sudo unlink /usr/bin/g++ sudo ln -s /usr/bin/g++-5 /usr/bin/g++ sudo ln -s /usr/bin/gcc-5 /usr/bin/gcc gcc --version