当前时区 GMT+8, 现在时间是 2008-7-6 10:20 游客: 注册 登录 仅登录论坛 | 搜索 帮助


标题: busybox的静态编译问题
albert198511
新手上路
Rank: 1



UID 246711
精华 0
积分 32
帖子 63
阅读权限 10
注册 2008-2-12
状态 离线
发表于 2008-5-3 23:15  资料  短消息  加为好友 
busybox的静态编译问题

busybox-1.9.2版本:

Build Options 中选择:
  
  • Build BusyBox as a static binary (no shared libs)                                │ │
      [ ] Build shared libbusybox                                                          │ │
      
  • Build with Large File Support (for accessing files > 2 GB)     

    执行make命令,出现如下错误:
    [root@localhost busybox-1.9.2]# make
    cat: /dev/null: 没有那个文件或目录
      SPLIT   include/autoconf.h -> include/config/*
      GEN     include/bbconfigopts.h
      HOSTCC  applets/usage
      GEN     include/usage_compressed.h
      HOSTCC  applets/applet_tables
      GEN     include/applet_tables.h
      CC      applets/applets.o
    applets/applets.c:15:2: warning: #warning Static linking against glibc produces buggy executables
    applets/applets.c:16:2: warning: #warning (glibc does not cope well with ld --gc-sections).
    applets/applets.c:17:2: warning: #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
    applets/applets.c:18:2: warning: #warning Note that glibc is unsuitable for static linking anyway.
    applets/applets.c:19:2: warning: #warning If you still want to do it, remove -Wl,--gc-sections
    applets/applets.c:20:2: warning: #warning from scripts/trylink and remove this warning.
    applets/applets.c:21:2: #error Aborting compilation.
    make[1]: *** [applets/applets.o] 错误 1
    make: *** [applets] 错误 2

    查看applets/applets.c文件:
    [root@localhost busybox-1.9.2]# vi applets/applets.c
    #include <assert.h>
    #include "busybox.h"

    /* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */
    #if ENABLE_STATIC && defined(__GLIBC__) && !defined(__UCLIBC__)
    #warning Static linking against glibc produces buggy executables
    #warning (glibc does not cope well with ld --gc-sections).
    #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
    #warning Note that glibc is unsuitable for static linking anyway.
    #warning If you still want to do it, remove -Wl,--gc-sections
    #warning from scripts/trylink and remove this warning.
    #error Aborting compilation.
    #endif

    #if ENABLE_BUILD_LIBBUSYBOX
    int main(int argc, char **argv)
    {
        return lbb_main(argc, argv);
    }
    #endif
    #if ENABLE_STATIC && defined(__GLIBC__) && !defined(__UCLIBC__)-----这句在哪可以改设置?

    谢谢!

    [ 本帖最后由 albert198511 于 2008-5-4 08:41 编辑 ]

  • 顶部
    duzhig
    新手上路
    Rank: 1


    UID 179908
    精华 0
    积分 75
    帖子 54
    阅读权限 10
    注册 2005-1-26
    状态 离线
    发表于 2008-5-5 21:02  资料  短消息  加为好友 
    注释掉就可以了

    顶部
     


    Powered by Discuz! 5.5.0  © 2001-2007 Comsenz Inc.
    清除 Cookies - 联系我们 - 中国Linux公社 - WAP