[PATCH libevdev 5/5] Add some minimal documentation about static linking

Peter Hutterer peter.hutterer at who-t.net
Wed Aug 20 17:50:46 PDT 2014


On Wed, Aug 20, 2014 at 12:22:55PM +0200, David Herrmann wrote:
> Hi
> 
> On Tue, Aug 19, 2014 at 12:24 PM, Peter Hutterer
> <peter.hutterer at who-t.net> wrote:
> > I can't recommend it, but I can't stop people from doing it, so at least
> > document the ground rules.
> 
> Ugh? Why do we stop people from shooting themselves in their foot?
> (regarding the whole series, not just this patch)

2/5 and 3/5 were general patches that needed fixing anyway. In particular,
the GCOV_LDFLAGS patch is needed because right now the build is broken if
gcov is enabled.

> I'm fine with renaming symbols to something more sane (log_* to
> _libevdev_log_*), but all this fake static-linking supports seems to
> solve problem no-one cares about. The toolchain we use does not
> provide proper support for static linking. Let those people fix the
> toolchain to add symbol-visibility support for static linking, and
> everything will work great. Now we just fix bugs in the wrong places.

yes, and no. This wasn't just some idea I cooked up, it was a bug triggered
by a libinput build. I'm still chasing down the actual causes and use-case
here but fact is that if someone runs configure && make on another project
and the build breaks because of libevdev we have a bug that needs fixing. In
both projects, but still.

The safest way to prevent that in the future is to have a couple of tests
that check for that bug to re-appear.

Cheers,
   Peter


> I will not stop you from applying those patches, but I really don't
> see the point.
> 
> Thanks
> David
> 
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> >  libevdev/libevdev.h | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/libevdev/libevdev.h b/libevdev/libevdev.h
> > index 321f980..5797190 100644
> > --- a/libevdev/libevdev.h
> > +++ b/libevdev/libevdev.h
> > @@ -541,6 +541,20 @@ extern "C" {
> >   */
> >
> >  /**
> > + * @page static_linking Statically linking libevdev
> > + *
> > + * Statically linking libevdev.a is generally supported but not
> > + * recommended. Symbol visibility is difficult to control in a static
> > + * library, so extra care must be taken to only use symbols that are
> > + * explicitly exported. libevdev's API stability guarantee only applies to
> > + * those symbols.
> > + *
> > + * In addition to the exported symbols, libevdev reserves the
> > + * <b>_libevdev_*</b> namespace. Do not use or create symbols with that
> > + * prefix, they are subject to change at any time.
> > + */
> > +
> > +/**
> >   * @page testing libevdev-internal test suite
> >   *
> >   * libevdev's internal test suite uses the
> > --
> > 1.9.3
> >
> > _______________________________________________
> > Input-tools mailing list
> > Input-tools at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/input-tools


More information about the Input-tools mailing list