[Libguestfs] [PATCH 4/4] lib: Use -fvisibilty=hidden by default; only ABI symbols are now visible.

Richard W.M. Jones rjones at redhat.com
Wed Jan 18 18:14:05 UTC 2012


On Wed, Jan 18, 2012 at 06:47:25PM +0100, Jim Meyering wrote:
> > diff --git a/src/Makefile.am b/src/Makefile.am
> > index 28a1b92..b91ffc1 100644
> > --- a/src/Makefile.am
> > +++ b/src/Makefile.am
> > @@ -55,7 +55,8 @@ lib_LTLIBRARIES = libguestfs.la
> >  # This convenience library is solely to compile its generated sources with
> >  # custom flags.
> >  libprotocol_la_SOURCES = guestfs_protocol.c  guestfs_protocol.h
> > -libprotocol_la_CFLAGS = -Wall -Wno-unused -fno-strict-aliasing
> > +libprotocol_la_CFLAGS = \
> > +	-Wall -Wno-unused -fno-strict-aliasing $(GCC_VISIBILITY_HIDDEN)
> 
> I'm curious why you're not using $(WARN_CFLAGS) $(WERROR_CFLAGS) here.
> 
> >  # Build the errnostring perfect hash code.  The generated code has lots
> >  # of warnings so we must compile it in a separate mini-library.
> > @@ -63,7 +64,7 @@ liberrnostring_la_SOURCES = \
> >  	errnostring_gperf.c \
> >  	errnostring.h \
> >  	errnostring.c
> > -liberrnostring_la_CFLAGS =
> > +liberrnostring_la_CFLAGS = $(GCC_VISIBILITY_HIDDEN)
> 
> And here.

The reason is these contain generated code from rpcgen and gperf
respectively which contains many problems.  In particular we have to
compile the rpcgen code with -fno-strict-aliasing.  In both cases we
don't want pages of warnings to appear that we can't do much about.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org




More information about the Libguestfs mailing list