Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 587458

Summary: net-fs/autofs-5.1.2[-libtirpc] - ../include/rpc_subs.h:19:21: fatal error: rpc/rpc.h: No such file or directory
Product: Gentoo Linux Reporter: Martin von Gagern <Martin.vGagern>
Component: Current packagesAssignee: Yixun Lan <dlan>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 381391    
Attachments: build log
emerge --info

Description Martin von Gagern 2016-06-29 06:05:16 UTC
Created attachment 439106 [details]
build log

Upgrading net-fs/autofs from 5.1.1-r1 to 5.1.2 I'm encountering compile errors:

In file included from ../include/automount.h:32:0,
                 from cat_path.c:18:
../include/rpc_subs.h:19:21: fatal error: rpc/rpc.h: No such file or directory
compilation terminated.
In file included from ../include/automount.h:32:0,
                 from cache.c:25:
../include/rpc_subs.h:19:21: fatal error: rpc/rpc.h: No such file or directory
compilation terminated.
make[1]: *** [../Makefile.rules:64: cache.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [../Makefile.rules:64: cat_path.o] Error 1
In file included from ../include/automount.h:32:0,
                 from log.c:26:
../include/rpc_subs.h:19:21: fatal error: rpc/rpc.h: No such file or directory
compilation terminated.
make[1]: *** [../Makefile.rules:64: log.o] Error 1
In file included from ../include/automount.h:32:0,
                 from mounts.c:31:
../include/rpc_subs.h:19:21: fatal error: rpc/rpc.h: No such file or directory
compilation terminated.
make[1]: *** [../Makefile.rules:64: mounts.o] Error 1
In file included from ../include/automount.h:32:0,
                 from nsswitch.c:26:
../include/rpc_subs.h:19:21: fatal error: rpc/rpc.h: No such file or directory
compilation terminated.
make[1]: *** [../Makefile.rules:64: nsswitch.o] Error 1
make[1]: Leaving directory '/var/tmp/portage/net-fs/autofs-5.1.2/work/autofs-5.1.2/lib'
make: *** [Makefile:14: daemon] Error 2
 * ERROR: net-fs/autofs-5.1.2::gentoo failed (compile phase):
 *   emake failed

The old version compiled just fine, but that's presumably due to a change in USE flags: 5.1.1-r1 had +libtirpc in its config, 5.1.2 dropped the +. This issue might be related to bug #374403 even though that is ancient.

# for i in $(locate /usr/\*/rpc.h); do qfile -v "$i"; done
dev-libs/libevent-2.1.5-r4 (/usr/include/event2/rpc.h)
net-libs/libtirpc-1.0.1 (/usr/include/tirpc/rpc/rpc.h)
net-misc/freerdp-1.2.1_pre20150326-r1 (/usr/include/winpr/rpc.h)
cross-mingw32/w32api-3.17.2 (/usr/mingw32/usr/include/rpc.h)
sys-kernel/gentoo-sources-4.5.2 (/usr/src/linux-4.5.2-gentoo/drivers/staging/lustre/lnet/selftest/rpc.h)
sys-kernel/gentoo-sources-4.6.1 (/usr/src/linux-4.6.1-gentoo/drivers/staging/lustre/lnet/selftest/rpc.h)
sys-kernel/gentoo-sources-4.6.3 (/usr/src/linux-4.6.3-gentoo/drivers/staging/lustre/lnet/selftest/rpc.h)
cross-x86_64-w64-mingw32/mingw64-runtime-4.0.6 (/usr/x86_64-w64-mingw32/usr/include/rpc.h)

I'm not sure whether autofs should have compiled against any of these in the absence of libtirpc. But libtirpc is the only one where the rpc.h is contained in a directory called rpc. If rpc/rpc.h should come from some other package, then said package is presumably missing on my system, and the ebuild did not catch the absence of it, indicating an incomplete set of dependencies.

For the moment I'll simply enable the libtirpc USE flag manually, but in the long run it would be nice to capture this using the ebuild dependenciy information.
Comment 1 Martin von Gagern 2016-06-29 06:07:46 UTC
Created attachment 439108 [details]
emerge --info
Comment 2 Martin von Gagern 2016-06-29 21:10:02 UTC
(In reply to Martin von Gagern from comment #0)
> For the moment I'll simply enable the libtirpc USE flag manually,

Does not solve the problem. Configured with --with-libtirpc, but configure reported

checking if libtirpc is requested and available... no

and after that it's back to “rpc/rpc.h: No such file or directory”.

Details from the config log:

configure:3188: checking if libtirpc is requested and available
configure:3216: x86_64-pc-linux-gnu-gcc -o conftest -march=amdfam10 -O2 -ggdb -pipe -I/usr/include/tirpc  -Wl,--as-needed -ltirpc conftest.c  >&5
/var/tmp/portage/net-fs/autofs-5.1.2/temp/ccJIfquo.o: In function `main':
/var/tmp/portage/net-fs/autofs-5.1.2/work/autofs-5.1.2/conftest.c:18: undefined reference to `clntudp_bufcreate'
collect2: error: ld returned 1 exit status
configure:3216: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_LINUX_PROCFS 1
| /* end confdefs.h.  */
|  #include <rpc/rpc.h>
| int
| main ()
| {
|  CLIENT *cl;
|       struct sockaddr_in addr;
|       int fd;
|       unsigned long ul; struct timeval t; unsigned int ui;
|       cl = clntudp_bufcreate(&addr,ul,ul,t,&fd,ui,ui);
|   ;
|   return 0;
| }
configure:3221: result: no

The problem here, as far as I can tell, is that -ltirpc should come AFTER conftest.c, not before it. aclocal.m4 writes this as

af_check_libtirpc_save_cflags="$CFLAGS"
af_check_libtirpc_save_ldflags="$LDFLAGS"
CFLAGS="$CFLAGS -I/usr/include/tirpc"
LDFLAGS="$LDFLAGS -ltirpc"

where this probably should be going into LIBS instead of LDFLAGS. I don't know why the previous installation of autofs-5.1.1-r1 managed to pass the configure check, but the build log tells me that id did do so.
Comment 3 Martin von Gagern 2016-07-05 21:29:18 UTC
(In reply to Martin von Gagern from comment #2)
> > For the moment I'll simply enable the libtirpc USE flag manually,
> Does not solve the problem.

I've opened bug #588106 about the build problem with the libtirpc USE flag, so that this one here can concentrate on the original problem when that USE flag is NOT present.
Comment 4 Mike Gilbert gentoo-dev 2017-12-09 17:33:22 UTC
Since glibc-2.26 is removing rpc support unconditionally, we should probably just remove the libtirpc USE flag.
Comment 5 Yixun Lan archtester gentoo-dev 2018-01-30 05:36:16 UTC
(In reply to Mike Gilbert from comment #4)
> Since glibc-2.26 is removing rpc support unconditionally, we should probably
> just remove the libtirpc USE flag.

removing USE=libtirpc sounds like a aggressive suggestion, let's leave it for a while, and I think this problem is already fixed by following commit.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=016a75127809bdb2b6c396aa0c2b99aef665437c


I'm closing this, please re-open if you still have problem