busybox1.9编译错误问题解决方法

  • Post author:
  • Post category:其他


busybox-1.9编译

几乎全部选择:

第一次错误信息:

In file included from include/busybox.h:10,

from applets/applets.c:11:

include/libbb.h:50:29: selinux/selinux.h: No such file or directory

include/libbb.h:51:29: selinux/context.h: No such file or directory

include/libbb.h:52:27: selinux/flask.h: No such file or directory

include/libbb.h:53:36: selinux/av_permissions.h: No such file or directory

In file included from include/busybox.h:10,

from applets/applets.c:11:

include/libbb.h:844: error: syntax error before “sid”

include/libbb.h:844: warning: function declaration isn’t a prototype

include/libbb.h:845: error: syntax error before “set_security_context_component”

include/libbb.h:845: error: syntax error before “cur_context”

include/libbb.h:846: warning: type defaults to `int’ in declaration of `set_security_context_component’

include/libbb.h:846: warning: function declaration isn’t a prototype

include/libbb.h:846: warning: data definition has no type or storage class

include/libbb.h:847: error: syntax error before “scontext”

include/libbb.h:847: warning: function declaration isn’t a prototype

make[1]: *** [applets/applets.o] Error 1

make: *** [applets] Error 2

看来这玩意真是不可靠,系统/usr/include/中明明有selinux/selinux.h这个的,没法,在busybox的include目录:ln -sf /usr/src/selinux selinux

继续make

第二次出错:

loginutils/login.c:22:31: security/pam_appl.h: No such file or directory

loginutils/login.c:23:31: security/pam_misc.h: No such file or directory

loginutils/login.c:24: error: variable `conv’ has initializer but incomplete type

loginutils/login.c:25: error: `misc_conv’ undeclared here (not in a function)

loginutils/login.c:25: warning: excess elements in struct initializer

loginutils/login.c:25: warning: (near initialization for `conv’)

loginutils/login.c:27: warning: excess elements in struct initializer

loginutils/login.c:27: warning: (near initialization for `conv’)

loginutils/login.c: In function `login_main’:

loginutils/login.c:248: error: `pam_handle_t’ undeclared (first use in this function)

loginutils/login.c:248: error: (Each undeclared identifier is reported only once

loginutils/login.c:248: error: for each function it appears in.)

loginutils/login.c:248: error: `pamh’ undeclared (first use in this function)

loginutils/login.c:249: warning: ISO C90 forbids mixed declarations and code

loginutils/login.c:315: warning: implicit declaration of function `pam_start’

loginutils/login.c:316: error: `PAM_SUCCESS’ undeclared (first use in this function)

loginutils/login.c:321: warning: implicit declaration of function `pam_set_item’

loginutils/login.c:321: error: `PAM_TTY’ undeclared (first use in this function)

loginutils/login.c:326: warning: implicit declaration of function `pam_authenticate’

loginutils/login.c:336: warning: implicit declaration of function `pam_acct_mgmt’

loginutils/login.c:345: warning: implicit declaration of function `pam_get_item’

loginutils/login.c:345: error: `PAM_USER’ undeclared (first use in this function)

loginutils/login.c:359: warning: implicit declaration of function `pam_open_session’

loginutils/login.c:364: warning: implicit declaration of function `pam_setcred’

loginutils/login.c:364: error: `PAM_ESTABLISH_CRED’ undeclared (first use in this function)

loginutils/login.c:373: warning: implicit declaration of function `pam_strerror’

loginutils/login.c:373: warning: format argument is not a pointer (arg 3)

make[1]: *** [loginutils/login.o] Error 1

make: *** [loginutils] Error 2

这次有点头大,查找一翻,是libpam0g-dev包没装,ok, sudo apt-get install libpam0g-dev

继续在busybox的include目录: ln -sf /usr/include/security security

接着make

又出错:

selinux/setfiles.c:9:25: sepol/sepol.h: No such file or directory

selinux/setfiles.c: In function `canoncon’:

selinux/setfiles.c:420: warning: implicit declaration of function `sepol_check_context’

selinux/setfiles.c: In function `setfiles_main’:

selinux/setfiles.c:555: warning: implicit declaration of function `sepol_set_policydb_from_file’

make[1]: *** [selinux/setfiles.o] Error 1

make: *** [selinux] Error 2

老办法,进入include目录:

ln -sf /usr/include/sepol sepol

要是系统没这个目录的话,呵呵,这个包的名字叫做libsepol1-dev,咋装不用说了吧

继续make

呵呵,链接出错,这是肯定的了,

LINK    busybox_unstripped

Trying libraries: crypt m pam pam_misc selinux sepol

Failed: busybox_unstripped /opt/crosstool/gcc-3.4.5-glibc-2.3.6/arm-davinci-linux/bin/arm-davinci-linux-gcc  -static   applets/built-in.o  archival/lib.a  archival/libunarchive/lib.a  console-tools/lib.a  coreutils/lib.a  coreutils/libcoreutils/lib.a  debianutils/lib.a  e2fsprogs/lib.a  editors/lib.a  findutils/lib.a  init/lib.a  ipsvd/lib.a  libbb/lib.a  libpwdgrp/lib.a  loginutils/lib.a  miscutils/lib.a  modutils/lib.a  networking/lib.a  networking/libiproute/lib.a  networking/udhcp/lib.a  procps/lib.a  runit/lib.a  selinux/lib.a  shell/lib.a  sysklogd/lib.a  util-linux/lib.a  archival/built-in.o  archival/libunarchive/built-in.o  console-tools/built-in.o  coreutils/built-in.o  coreutils/libcoreutils/built-in.o  debianutils/built-in.o  e2fsprogs/built-in.o  editors/built-in.o  findutils/built-in.o  init/built-in.o  ipsvd/built-in.o  libbb/built-in.o  libpwdgrp/built-in.o  loginutils/built-in.o  miscutils/built-in.o  modutils/built-in.o  networking/built-in.o  networking/libiproute/built-in.o  networking/udhcp/built-in.o  procps/built-in.o  runit/built-in.o  selinux/built-in.o  shell/built-in.o  sysklogd/built-in.o  util-linux/built-in.o  m crypt pam pam_misc selinux sepol -Wl,–start-group -lcrypt -lm -lpam -lpam_misc -lselinux -lsepol -Wl,–end-group

Output of:

/opt/crosstool/gcc-3.4.5-glibc-2.3.6/arm-davinci-linux/bin/arm-davinci-linux-gcc -static -o busybox_unstripped -Wl,–sort-common -Wl,–sort-section -Wl,alignment -Wl,–gc-sections -Wl,–start-group applets/built-in.o archival/lib.a archival/libunarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a ipsvd/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a archival/built-in.o archival/libunarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o ipsvd/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o miscutils/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o procps/built-in.o runit/built-in.o selinux/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o -Wl,–end-group -Wl,–start-group -lcrypt -lm -lpam -lpam_misc -lselinux -lsepol -Wl,–end-group

==========

/opt/crosstool/gcc-3.4.5-glibc-2.3.6/arm-davinci-linux/lib/gcc/arm-davinci-linux/3.4.5/../../../../arm-davinci-linux/bin/ld: cannot find -lpam

collect2: ld returned 1 exit status

make: *** [busybox_unstripped] Error 1

这几个库交叉编译器可是没有的哦

没路了,要么交叉编译所需要的库,(痛苦的事情,我没成功),

要么重新配置下,去掉selinux和loging中的pam就OK了

make

ok,生成了



版权声明:本文为crazyervip原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。