Skip to content

Draft: scanner: extern struct should use protected visibility

scanner: extern struct should use protected visibility

When add a new request in xdg_toplevel, kwin and qtwayland support/use it, but a qt program link to libmpv which depends on libsdl and it still use the old xml file and not compile with the new xml, will cause the new request method not found and crash.

With LD_DEBUG="all" we can find the problem is: the symbol was found in not in qtwayland itself.

This is a symbol replaced issue, we can use: attribute ((visibility ("protected"))) to make sure the struct use in our module(qtwayland) is the correct one, not from other library, here the issue symbol is xdg_toplevel_interface.

The scanner output change like below: wayland-xdg-shell-protocol.c from

extern const struct wl_interface xdg_toplevel_interface;


extern WL_EXPORT_PROTECTED const struct wl_interface xdg_toplevel_interface;

Signed-off-by: Hongfei Shang

Edited by Hongfei Shang

Merge request reports