QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2805|回复: 1

busybox的静态编译问题

[复制链接]
发表于 2008-5-3 23:15:41 | 显示全部楼层 |阅读模式
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 编辑 ]
  • 发表于 2008-5-5 21:02:50 | 显示全部楼层
    注释掉就可以了
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    GMT+8, 2024-11-23 00:00 , Processed in 0.039068 second(s), 15 queries .

    © 2021 Powered by Discuz! X3.5.

    快速回复 返回顶部 返回列表