| Summary: | need to link against libtirpc with FEATURE_MOUNT_NFS and glibc-2.14+ | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Bart Kus <bart.kus> |
| Component: | Standard Compliance | Assignee: | unassigned |
| Status: | REOPENED --- | ||
| Severity: | normal | CC: | bart.kus, busybox-cvs, zigiwifitha |
| Priority: | P2 | ||
| Version: | 1.19.x | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| URL: | http://lists.busybox.net/pipermail/busybox/2011-July/076157.html | ||
| See Also: | https://bugs.gentoo.org/show_bug.cgi?id=637536 | ||
| Host: | Target: | ||
| Build: | |||
|
Description
Bart Kus
2011-11-29 11:47:09 UTC
semi-known issue Unlike the linked email thread where -ltirpc and -lpthread fixed the issue, I still have missing symbols when linking against the latest glibc: eo@jo ~/busybox $ export CONFIG_STATIC=y eo@jo ~/busybox $ 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-group applets/built-in.o archival/lib.a archival/libarchive/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 libbb/lib.a libpwdgrp/lib.a loginutils/lib.a mailutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a printutils/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a util-linux/volume_id/lib.a archival/built-in.o archival/libarchive/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 libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o mailutils/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 printutils/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 util-linux/volume_id/built-in.o -Wl,--end-group -Wl,--start-group -lcrypt -lm -ltirpc -lpthread -Wl,--end-group networking/lib.a(nslookup.o): In function `print_host': nslookup.c:(.text.print_host+0x3d): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking networking/lib.a(ipcalc.o): In function `ipcalc_main': ipcalc.c:(.text.ipcalc_main+0x211): warning: Using 'gethostbyaddr' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libbb/lib.a(inet_common.o): In function `INET_resolve': inet_common.c:(.text.INET_resolve+0x47): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking networking/lib.a(inetd.o): In function `reread_config_file': inetd.c:(.text.reread_config_file+0x79e): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used 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 at runtime the shared libraries from the glibc version used for linking networking/lib.a(inetd.o): In function `reread_config_file': inetd.c:(.text.reread_config_file+0x724): warning: Using 'getrpcbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/libtirpc.a(libtirpc_la-auth_des.o): In function `authdes_validate': (.text+0xee): undefined reference to `ecb_crypt' /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/libtirpc.a(libtirpc_la-auth_des.o): In function `authdes_marshal': (.text+0x252): undefined reference to `cbc_crypt' /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/libtirpc.a(libtirpc_la-auth_des.o): In function `authdes_marshal': (.text+0x320): undefined reference to `ecb_crypt' /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/libtirpc.a(libtirpc_la-auth_des.o): In function `authdes_refresh': (.text+0x446): undefined reference to `key_encryptsession_pk' /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/libtirpc.a(libtirpc_la-auth_des.o): In function `authdes_pk_seccreate': (.text+0x5c9): undefined reference to `getnetname' /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/libtirpc.a(libtirpc_la-auth_des.o): In function `authdes_pk_seccreate': (.text+0x775): undefined reference to `key_gendes' /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/libtirpc.a(libtirpc_la-auth_des.o): In function `authdes_seccreate': (.text+0x91e): undefined reference to `getpublickey' collect2: ld returned 1 exit status eo@jo ~/busybox $ Any tips on how to get a static version built at all? I marked it as major originally since static doesn't wanna build no matter what I've tried. The missing symbols listed in this modified command line also look to have been dropped from the latest glibc static version: eo@jo ~/busybox $ nm /usr/lib64/libc.a 2>/dev/null | grep _crypt eo@jo ~/busybox $ nm /usr/lib64/libc.a 2>/dev/null | wc -l 15029 glibc does not "fully" support static linking. It's a known decision of glibc developers.
Having said that, in current git FEATURE_MOUNT_NFS is changed so that it can be disabled and NFS mounts will still work, but will require somewhat recent 2.6 kernels. Maybe you can disable it. Also, consider enabling local crypt routines (CONFIG_USE_BB_CRYPT=y, CONFIG_USE_BB_CRYPT_SHA=y)
> Any tips on how to get a static version built at all?
I suggest switching to uclibc for static build. uclibc project DOES support static build, and this build will be MUCH smaller (~300k) than one against glibc.
to clarify for people, there's two ways to fix this: - disable the rpc settings in your busybox config. there's only like two ... one for inetd, and one for mount for supporting nfs. the latter isn't even really needed to mount nfs if you don't mind disabling some nfs mount features. - manually link against libtirpc yourself the issue is that newer glibc has been removing rpc functionality (which is good because this stuff is old and doesn't support things like IPv6). but busybox needs to support linking against the libtirpc package (via pkg-config) so that it gets the newer maintained library, and one that works :). Add libraries you need to CONFIG_EXTRA_LDLIBS. i don't think that resolution makes sense. if everyone who wants to use rpc features has to know to set up their lib/cppflags settings correctly, then maybe we should be automating it. otherwise, why do also probe selinux libs in the makefiles ? by that logic, that code should be deleted and force people to manually add -lselinux too. i was planning on implementing this already, so i'll take the bug. *** Bug 6242 has been marked as a duplicate of this bug. *** (In reply to Denys Vlasenko from comment #5) how to do it? i had add CONFIG_EXTRA_LDLIBS: libtirpc and tirpc, the result also is failed. |