| Summary: | generated Wayland interfaces are included in the library's ABI | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Simon McVittie <smcv> |
| Component: | build | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | 2.0.14 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
build: Prefer to use `wayland-scanner private-code`
waylandtouch: Don't export interface structs |
||
Created attachment 4661 [details] build: Prefer to use `wayland-scanner private-code` In versions since 1.15, the `code` mode is a deprecated alias for `public-code`, which emits symbols with default visibility, overriding SDL's -fvisibility=hidden option. Use the `private-code` mode instead. This emits symbols with hidden visibility, so they do not affect the ABI of libSDL. See also: https://bugreports.qt.io/browse/QTBUG-73099, https://lists.freedesktop.org/archives/wayland-devel/2018-February/037097.html Patch added, thanks! https://hg.libsdl.org/SDL/rev/0530cf0a871c Sorry, I missed some that are included in the C code rather than being generated at build-time. It would probably be better if they were generated at build-time like the rest, but for now, I'll just take them out of the ABI... Created attachment 4665 [details]
waylandtouch: Don't export interface structs
These are explicitly written in C code rather than generated at build
time, so they weren't affected by changing how we invoke
wayland-scanner.
Patch added, thanks! https://hg.libsdl.org/SDL/rev/a3d4219798f6 |
If SDL is built with Wayland enabled, the ABI of the library includes generated code for Wayland interfaces. I assume this was not intended to be present? For example: $ objdump -T -x build/.libs/libSDL2-2.0.so.0 ... 0000000000173aa0 g O .data.rel.ro 0000000000000028 zxdg_shell_v6_interface ... 0000000000172ea0 g O .data.rel.ro 0000000000000028 wl_data_source_interface ... 0000000000171820 g O .data.rel.ro 0000000000000028 qt_extended_surface_interface This seems to be because SDL is using the deprecated form `wayland-scanner code`. In recent versions of wayland-scanner, this produces symbols that are marked with __attribute__((visibility("default")), overriding SDL's -fvisibility=hidden. A similar report in Qt: https://bugreports.qt.io/browse/QTBUG-73099 I'll attach a patch in a moment.