zoukankan      html  css  js  c++  java
  • glibc 编译安装( version `GLIBC_2.14' not found")

    用了kali一段时间了,没想到有一天使用vi命令时候突然就出现“GLIBC_2.14 not found"错误。没法子,果断查资料。

    我是在kali-3.18.0中编译的。

    glibc的下载地址:http://ftp.gnu.org/gnu/glibc/

    或者:http://www.gnu.org/software/libc/download.html

    安装:

    下载的glibc的源码解压到某个目录,并进入源码目录 建立构建目录,并cd进入构建目录:

    [ghui@StuOS glibc-2.14]$ mkdir build  

    [ghui@StuOS glibc-2.14]$ cd build  
     
    配置:
    运行configure :
     
    [ghui@StuOS build]$ ../configure --prefix=/opt/glibc-2.14  

    [ghui@StuOS build]$ make -j4   

    [ghui@StuOS build]$ sudo make install  

     

    临时修改环境变量:

    [ghui@StuOS bin]$ export LD_LIBRARY_PATH=/opt/glibc-2.14/lib:$LD_LIBRARY_PATH  

     

    最后如果执行程序最好是要执行以下 ldconfig 以便查找该共享库。


    如果你没有安装gawk,你可能会看到以下的错误信息:
    mawk: scripts/gen-sorted.awk: line 19: syntax error at or near ]
    mawk: scripts/gen-sorted.awk: line 19: runaway regular expression /, "", subd ...
    make[1]: *** No rule to make target `/home/wstone/Build/glibc/glibc-build/Versions.all', needed by `/home/wstone/Build/glibc/glibc-build/abi-versions.h'.  Stop.
    make[1]: Leaving directory `/home/wstone/Build/glibc/glibc-2.9'
    make: *** [all] Error 2
    这是因为ubuntu使用的是mawk,安装上glibc需要的gawk即可:
    $ sudo apt-get install gawk  ##kali上也是同理。

    在ubuntu上编译glibc可能还会看到以下错误:
    ../misc/syslog.c: In function ‘__vsyslog_chk’:
    ../misc/syslog.c:123: sorry, unimplemented: inlining failed in call to ‘syslog’: function body not available
    ../misc/syslog.c:155: sorry, unimplemented: called from here
    make[2]: *** [/home/wstone/Build/glibc/glibc-build/misc/syslog.o] Error 1
    make[2]: Leaving directory `/home/wstone/Build/glibc/glibc-2.9/misc'
    make[1]: *** [misc/subdir_lib] Error 2
    make[1]: Leaving directory `/home/wstone/Build/glibc/glibc-2.9'
    make: *** [all] Error 2
    网上讨论这个是gcc的问题,使用以下的方式configure可以解决:
    $ echo "CFLAGS +=-O2 -U_FORTIFY_SOURCE  -march=i486 -mtune=native -fno-stack-protector" >configparm
    $ ../glibc-2.9/configure  --prefix=/usr  --disable-profile --enable-kernel=2.6.15

    关于这个问题的内容,可以参考:
    1、http://swiss.ubuntuforums.org/showthread.php?p=7624127
    2、https://wiki.ubuntu.com/CompilerFlags

    另外glibc的编译,可以参考lfs的内容:
    1、http://www.linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html

    如果想了解一些具体的编译选项,那么应该仔细阅读glibc源码中的一些说明性文档。

    参考地址:http://www.cnblogs.com/wainiwann/p/4206582.html

    http://blog.chinaunix.net/uid-223060-id-2215317.html

    you can do everything what you want but must be hold on
  • 相关阅读:
    不用if/else swich for while实现累加
    1.java数据结构
    青蛙跳台阶问题
    next与nextLine
    9.遗传算法
    Docker镜像管理
    Docker镜像管理
    CentOS 6.7安装Docker
    CentOS 6.7安装Docker
    数字三角形_递归_递推(动态规划)
  • 原文地址:https://www.cnblogs.com/skylumia/p/4607175.html
Copyright © 2011-2022 走看看