libwayland static builds aren't well supported
This came up with weston!1472 which hilights the fact that libwayland-cursor when built statically collides with other software (libdecor, libweston) that has os_create_anonymous_file.
My initial suggestion to just burn down static libraries entirely and change all our lib builds to shared was not met with mirth: !372
The problems I see so far are:
- Our test suite doesn't pass when only static libraries are built (fix in !373 (merged))
- Our CI doesn't perform static library builds
- Our libraries use symbol names like
os_create_anonymous_file
that collide with other libs.
There is some humour in the fact that os_create_anonymous_file
is copied from weston(a88a4386), and this issue arose because it then collided with weston. We probably should prefix every non-static function with something distinct to these libraries.
This problem has only been noticed with libwayland-cursor so far, but all of libwayland probably needs an audit for Bad symbol names, as we have at least a get_next_argument
in wayland-private.h
that could cause a static library use a surprise.
Perhaps surprisingly, there doesn't seem to be a problem when libwayland-server.a
and libwayland-client.a
are used at the same time.
tl;dr: We probably need to:
- fix the test suite (land !373 (merged))
- Enable static builds in the test suite
- Audit all the symbols that end up in .a files to make sure they have a wl_mumble_ prefix
It would also be nice to add some kind of automated test that ensures that no .a file is produced with unprefixed symbols, but I'm not sure that's possible...