On Wed, Jul 24, 2013 at 11:31 AM, Ian Kent <raven@xxxxxxxxxx> wrote: > On Wed, 2013-07-24 at 10:37 +0800, Lan Yixun (dlan) wrote: >> From: "Lan Yixun (dlan)" <dennis.yxun@xxxxxxxxx> >> >> this is need when libtirpc is enabled, otherwise autofs fail to start >> due to it can't find symbol clnt_dg_create (which is provided by libtirpc) > > Yeah, I use libtirpc all the time but that's something I haven't > noticed, probably because TIRPC_WORKAROUND will cause the library to be > dlopen()ed at start. > > So while the change is needed and I'll apply it, I'm not sure why you're > seeing it since the library should be open and loaded already. > >> >> --- >> autofs error log from /var/log/message: >> >> Jul 23 12:11:58 ofire automount[25699]: open_mount:244: parse(sun): cannot open mount module >> nfs (/usr/lib64/autofs/mount_nfs.so: undefined symbol: clnt_dg_create) >> Jul 23 12:11:58 ofire automount[25699]: lookup(file): failed to open parse context >> >> without this patch, mount_nfs.so fail link to libtirpc.so >> # ldd /usr/lib64/autofs/mount_nfs.so |grep tirpc >> >> with this patch applied: >> # ldd /usr/lib64/autofs/mount_nfs.so |grep tirpc >> libtirpc.so.1 => /lib64/libtirpc.so.1 (0x00007f7d94920000) >> >> Signed-off-by: Lan Yixun (dlan) <dennis.yxun@xxxxxxxxx> >> --- >> modules/Makefile | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/modules/Makefile b/modules/Makefile >> index 4bb1096..0fe8ae8 100644 >> --- a/modules/Makefile >> +++ b/modules/Makefile >> @@ -116,6 +116,6 @@ lookup_ldap.so: lookup_ldap.c dclist.o base64.o $(SASL_OBJ) >> >> mount_nfs.so: mount_nfs.c replicated.o >> $(CC) $(SOLDFLAGS) $(CFLAGS) -o mount_nfs.so \ >> - mount_nfs.c replicated.o $(AUTOFS_LIB) $(LIBNSL) >> + mount_nfs.c replicated.o $(AUTOFS_LIB) $(LIBNSL) $(TIRPCLIB) >> $(STRIP) mount_nfs.so >> > > Hi Ian: I spend a few time dig into the code, and found the root cause. In gentoo linux, user are legal to pass customized CFLAGS/LDFLAGS, and here we append "-Wl,--as-needed" to LDFLAGS. with this flag append, the final image - "automount" won't link to library tirpc. command of "ldd /usr/sbin/automount |grep tirpc" shows nothing. I think this is totally fine, since autmount itself doesn't use any symbol from libtirpc. but without my previous patch, the mount_nfs.so don't link to libtirpc, see following. # ldd /usr/lib64/autofs/mount_nfs.so linux-vdso.so.1 (0x00007fff4bfff000) libnsl.so.1 => /lib64/libnsl.so.1 (0x00007fc55957c000) libc.so.6 => /lib64/libc.so.6 (0x00007fc5591d1000) /lib64/ld-linux-x86-64.so.2 (0x00007fc559a04000) #objdump -t /usr/lib64/autofs/mount_nfs.so |grep clnt_dg_creat 0000000000000000 *UND* 0000000000000000 clnt_dg_create you can see clnt_dg_create is a undefined symbol, which is come from libtirpc. so, module mount_nfs need libtirpc. I think you haven't encounter the problem is that the application automont accidentally link in libtirpc, while mount_nfs.so doesn't. so mount_nfs.so can found the symbol which loaded by automount when it started to run. I can filter the "-Wl,--as-needed" flag, but still think my patch address right to the problem. Thanks. Dennis Lan (dlan) -- To unsubscribe from this list: send the line "unsubscribe autofs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html