Martin Kletzander
2017-Nov-18 18:44 UTC
[Libguestfs] [PATCH] build: Reference RPC_CFLAGS where needed
Since glibc-2.26 removed the /usr/include/rpc/rpc.h, it caused problem even though probing for libtirpc has taken place and worked properly. The problem is that RPC_CFLAGS (usually `-I/usr/include/tirpc` on Linux) was not used in places where it was needed. So the build failed with messages like the following: In file included from guestfs_protocol.c:6:0: guestfs_protocol.h:9:10: fatal error: rpc/rpc.h: No such file or directory #include <rpc/rpc.h> ^~~~~~~~~~~ Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- Notes: Using $(RPC_CFLAGS) in places where needed fixes the issue and libguestfs compiles cleanly with glibc-2.26 for me. Disclaimer: I wasn't able to build with everything enabled, so there might be some more build sources that need this, but I haven't found them. common/protocol/Makefile.am | 3 ++- fish/Makefile.am | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/protocol/Makefile.am b/common/protocol/Makefile.am index cfac2d8d375f..778758209d4c 100644 --- a/common/protocol/Makefile.am +++ b/common/protocol/Makefile.am @@ -34,7 +34,8 @@ noinst_LTLIBRARIES = libprotocol.la # warnings here. libprotocol_la_SOURCES = guestfs_protocol.c guestfs_protocol.h libprotocol_la_CFLAGS = \ - -Wall -Wno-unused -fno-strict-aliasing $(GCC_VISIBILITY_HIDDEN) + -Wall -Wno-unused -fno-strict-aliasing $(GCC_VISIBILITY_HIDDEN) \ + $(RPC_CFLAGS) if HAVE_RPCGEN diff --git a/fish/Makefile.am b/fish/Makefile.am index a6efbb43966c..8623e8ecae72 100644 --- a/fish/Makefile.am +++ b/fish/Makefile.am @@ -101,7 +101,7 @@ guestfish_SOURCES = \ # This convenience library is solely to compile its generated sources with # custom flags. librc_protocol_la_SOURCES = rc_protocol.c rc_protocol.h -librc_protocol_la_CFLAGS = -Wall -Wno-unused -fno-strict-aliasing +librc_protocol_la_CFLAGS = -Wall -Wno-unused -fno-strict-aliasing $(RPC_CFLAGS) # Build the command lookup perfect hash code. The generated code has # lots of warnings so we must compile it in a separate mini-library. -- 2.15.0
Richard W.M. Jones
2017-Nov-19 20:05 UTC
Re: [Libguestfs] [PATCH] build: Reference RPC_CFLAGS where needed
Thanks, pushed upstream. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Apparently Analagous Threads
- [PATCH] lib: Prefer tirpc for XDR, and rationlise how we search for alternatives.
- [PATCH] Fix dependencies on generator.ml
- [PATCH libguestfs] avoid compiler warnings about unused vars in generated code
- [PATCH v2 1/7] lib: Share common protocol and errnostring libraries with the library and daemon.
- [PATCH v2] lib: Prefer tirpc for XDR, and rationalise how we search for alternatives.