嵌入式 busybox出错为inetd.c

原创 2013年12月02日 14:45:16
 LINK  busybox_unstripped
Tryinglibraries: crypt m
Failed:-Wl,–start-group -lcrypt -lm -Wl,–end-group
Outputof:
gcc -Wall-Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused-Wunused-parameter -Wunused-function -Wunused-value-Wmissing-prototypes -Wmissing-declarations-Wdeclaration-after-statement -Wold-style-definition-fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer-ffunction-sections -fdata-sections -fno-guess-branch-probability-funsigned-char -static-libgcc -falign-functions=1 -falign-jumps=1-falign-labels=1 -falign-loops=1 -Os -static -o busybox_unstripped-Wl,–sort-common -Wl,–sort-section,alignment -Wl,–start-groupapplets/built-in.o archival/lib.a archival/libarchive/lib.aconsole-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.adebianutils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.ainit/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.amailutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.anetworking/libiproute/lib.a networking/udhcp/lib.a printutils/lib.aprocps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.autil-linux/lib.a util-linux/volume_id/lib.a archival/built-in.oarchival/libarchive/built-in.o console-tools/built-in.ocoreutils/built-in.o coreutils/libcoreutils/built-in.odebianutils/built-in.o e2fsprogs/built-in.o editors/built-in.ofindutils/built-in.o init/built-in.o libbb/built-in.olibpwdgrp/built-in.o loginutils/built-in.o mailutils/built-in.omiscutils/built-in.o modutils/built-in.o networking/built-in.onetworking/libiproute/built-in.o networking/udhcp/built-in.oprintutils/built-in.o procps/built-in.o runit/built-in.oselinux/built-in.o shell/built-in.o sysklogd/built-in.outil-linux/built-in.o util-linux/volume_id/built-in.o-Wl,–end-group -Wl,–start-group -lcrypt -lm-Wl,–end-group
==========
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld:cannot find -lcrypt
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld:cannot find -lm
collect2: ldreturned 1 exit status
make: ***[busybox_unstripped] Error 1
在centos 5.6 上编译 ,采用静态编译的方式。以及在openSuSE11.2 交叉编译到mipsel 平台上 ,采用静态编译的方式,却都没有问题。
看到-lXXX 的错误我就想到so没有链接正确,对比openSuSE 和CentOS ldconfig如下:

libm.so.6 (libc6,x86-64, OS ABI: Linux 2.6.16) =>/lib64/libm.so.6
libm.so.6 (libc6, OS ABI: Linux 2.6.16) => /lib/libm.so.6
libm.so (libc6,x86-64, OS ABI: Linux 2.6.16) =>/usr/lib64/libm.so

libm.so.6 (libc6,x86-64, OS ABI: Linux 2.6.9) =>/lib64/libm.so.6
libm.so.6 (libc6, hwcap: 0×0018000000000000, OS ABI:Linux 2.6.9) => /lib/i686/nosegneg/libm.so.6
libm.so.6 (libc6, OS ABI: Linux 2.6.9) => /lib/libm.so.6
libm.so (libc6,x86-64, OS ABI: Linux 2.6.9) =>/usr/lib64/libm.so
libm.so (libc6, OS ABI: Linux 2.6.9) =>/usr/lib/libm.so

貌似openSuSE 缺少libm.so 的x86 链接 ,于是ln -s /lib/libm.so.6/usr/lib/libm.so  但问题依旧。

另外一个就是红色标注的那个了,我尝试在CentOS 中删除这个链接,好像也不影响编译。
后来无意间发现CentOS 及 mips编译链中都有libm.a ,在想到我编译busybox为静态方式 。所以… 赶紧find下openSuSE的库文件,果然没有libm.a 。 用rpm -qf 找到libm.a 属于CentOS 的glibc-devel包 ,但在openSuSE 下属于glibc-devel-static包 ~~~ 这个真是把人害苦了。

在Fedora 16下,使用yum provides */libcrypt.a,提供该库的包是glibc-static

接下来继续报错:
networking/lib.a(nslookup.o): In function`print_host’:
nslookup.c:(.text.print_host+0x3f): warning:Using ‘getaddrinfo’ in statically linked applications requires atruntime the shared libraries from the glibc version used forlinking
networking/lib.a(ipcalc.o):In function `ipcalc_main’:
ipcalc.c:(.text.ipcalc_main+0×201): warning:Using ‘gethostbyaddr’ in statically linked applications requires atruntime the shared libraries from the glibc version used forlinking
util-linux/lib.a(mount.o):In function `nfsmount’:
mount.c:(.text.nfsmount+0xd4): warning: Using‘gethostbyname’ in statically linked applications requires atruntime the shared libraries from the glibc version used forlinking
networking/lib.a(inetd.o):In function `reread_config_file’:
inetd.c:(.text.reread_config_file+0x75b):warning: Using ‘getservbyname’ in statically linked applicationsrequires at runtime the shared libraries from the glibc versionused for linking
networking/lib.a(netstat.o):In function `ip_port_str’:
netstat.c:(.text.ip_port_str+0x3e): warning:Using ‘getservbyport’ in statically linked applications requires atruntime the shared libraries from the glibc version used forlinking
networking/lib.a(inetd.o):In function `reread_config_file’:
inetd.c:(.text.reread_config_file+0x6dd):warning: Using ‘getrpcbyname’ in statically linked applicationsrequires at runtime the shared libraries from the glibc versionused for linking
networking/lib.a(inetd.o):In function `unregister_rpc’:
inetd.c:(.text.unregister_rpc+0x1f):undefined reference to `pmap_unset’
networking/lib.a(inetd.o):In function `register_rpc’:
inetd.c:(.text.register_rpc+0×57): undefinedreference to `pmap_unset’
inetd.c:(.text.register_rpc+0×73): undefinedreference to `pmap_set’
networking/lib.a(inetd.o):In function `prepare_socket_fd’:
inetd.c:(.text.prepare_socket_fd+0x7e):undefined reference to `bindresvport’
util-linux/lib.a(mount.o):In function `xdr_fhstatus’:
mount.c:(.text.xdr_fhstatus+0xb): undefinedreference to `xdr_u_int’
mount.c:(.text.xdr_fhstatus+0x2a): undefinedreference to `xdr_opaque’
util-linux/lib.a(mount.o):In function `xdr_dirpath’:
mount.c:(.text.xdr_dirpath+0×6): undefinedreference to `xdr_string’
util-linux/lib.a(mount.o):In function `xdr_mountres3′:
mount.c:(.text.xdr_mountres3+0xa): undefinedreference to `xdr_enum’
mount.c:(.text.xdr_mountres3+0×29): undefinedreference to `xdr_bytes’
mount.c:(.text.xdr_mountres3+0×42): undefinedreference to `xdr_int’
mount.c:(.text.xdr_mountres3+0×50): undefinedreference to `xdr_array’
util-linux/lib.a(mount.o):In function `nfsmount’:
mount.c:(.text.nfsmount+0×845): undefinedreference to `pmap_getmaps’
mount.c:(.text.nfsmount+0x9de): undefinedreference to `clntudp_create’
mount.c:(.text.nfsmount+0xa2f): undefinedreference to `clnttcp_create’
mount.c:(.text.nfsmount+0xa56): undefinedreference to `clnt_spcreateerror’
mount.c:(.text.nfsmount+0xa68): undefinedreference to `authunix_create_default’
mount.c:(.text.nfsmount+0xaeb): undefinedreference to `clnt_sperror’
mount.c:(.text.nfsmount+0xb12): undefinedreference to `clnt_sperror’
mount.c:(.text.nfsmount+0xca5): undefinedreference to `bindresvport’
mount.c:(.text.nfsmount+0xcee): undefinedreference to `pmap_getport’
collect2: ld returned 1 exitstatus
make: ***[busybox_unstripped] Error 1
 
好像是和glibc版本过高有关,找不到相关函数,这个好办,make menuconfig去掉如下选项
Linux System Utilities —>  [ ]  Support mounting NFS file systems 网络文件系统
Networking Utilities  —> [ ]inetd (Internet 超级服务器 )
然后就ok 了

相关文章推荐

BusyBox 简化嵌入式 Linux 系统

http://www.ibm.com/developerworks/cn/linux/l-busybox/index.html 为小环境准备的一个小工具包M. Tim Jones (mtj@mtjon...
  • chla
  • chla
  • 2011年06月16日 14:38
  • 243

嵌入式的瑞士军刀 - BusyBox

From: 文件系统 事物总是有N多种表现形式 - XXLinux 内核启动到最后的时候,摇身一变,进入托管模式。内核就默默的退居幕后,应用程序变身前台主人,所有对于用户的交互都是都APPlicati...

编辑定制自己的嵌入式busybox和ramdisk

定制自己的arm ramdisk编辑命令busybox

嵌入式设备的时区设置-busybox版本

/etc/TZ中,有可以设置时区 但是,当busybox是glibc的时候,就得用/etc/localtime了。它与PC端的/usr/share/zoneinfo/是一致的。 将PC端LINUX...

(嵌入式)busybox中TFTP服务器的使用

# tftp  BusyBox v1.12.1 (2012-10-11 16:59:29 CST) multi-call binary Usage: tftp [OPTION]... HO...

嵌入式 QT+VS2010开发出错处理

一、下载源码并解压 从QT官网http://qt.nokia.com/ 下载最新的QT源码包,我下载的是4.8.1的版本。文件名为“qt-everywhere-opensource-src-4.8.1...
  • skdkjxy
  • skdkjxy
  • 2013年12月02日 14:38
  • 829

嵌入式通讯中串口接收出错

下面写了两端代码。 1. char str[40]; int i; i=0; for(i=0;i
  • lxk7280
  • lxk7280
  • 2015年03月29日 22:09
  • 1340

protobuf-c 在arm linux 嵌入式平台的使用 protobuf和Json对比测试

关于什么是protobuf,网上搜搜一大堆,很多人用的都还是json,以为json是多种语言传输数据是万能的,看完了protobuf的实现,就明白了简单高效才是王道。 1、首先写一个.proto扩展...

嵌入式C中volatile的用法

转自 http://blog.chinaunix.net/uid-26923078-id-3238368.html 根据c/c++语法,const可以出现的地方,volatile几乎也都...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:嵌入式 busybox出错为inetd.c
举报原因:
原因补充:

(最多只允许输入30个字)