Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936443 - media-libs/libsdl2-2.28.5-r2: fails to build with gui-libs/libdecor-0.2 - error: incompatible function pointer types assigning to 'SDL_DYNWAYLANDFN_libdecor_frame_get_max_content_size'
Summary: media-libs/libsdl2-2.28.5-r2: fails to build with gui-libs/libdecor-0.2 - err...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-07-21 16:33 UTC by Sv. Lockal
Modified: 2024-08-01 07:05 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sv. Lockal 2024-07-21 16:33:05 UTC
Build of media-libs/libsdl2-2.28.5-r2  USE="X alsa dbus gles2 haptic joystick opengl pipewire pulseaudio sound threads udev video vulkan wayland"

with gui-libs/libdecor-0.2.2-r1 (the only available version - see https://packages.gentoo.org/packages/gui-libs/libdecor)

fails with:

libtool: compile:  clang -march=native -O2 -pipe -fdiagnostics-color=always -flto=thin -Werror=odr -Werror=strict-aliasing -DUSING_GENERATED_CONFIG_H -Iinclude -I/var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/include -idirafter /var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/khronos -DSDL_BUILD_MAJOR_VERSION=2 -DSDL_BUILD_MINOR_VERSION=28 -DSDL_BUILD_MICRO_VERSION=5 -mmmx -msse -msse2 -msse3 -Wall -Wno-unused-local-typedefs -fno-strict-aliasing -fvisibility=hidden -Wdeclaration-after-statement -Werror=declaration-after-statement -I/usr/include/pipewire-0.3 -I/usr/include/spa-0.2 -D_REENTRANT -D_REENTRANT -I/usr/lib64/libffi/include -Igen -I/usr/include/libdecor-0 -I/usr/lib64/libffi/include -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -D_REENTRANT -DHAVE_LINUX_VERSION_H -MMD -MT build/SDL_waylanddyn.lo -c /var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylanddyn.c  -fPIC -DPIC -o build/.libs/SDL_waylanddyn.o
In file included from /var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylanddyn.c:168:
/var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylandsym.h:222:1: error: incompatible function pointer types assigning to 'SDL_DYNWAYLANDFN_libdecor_frame_get_min_content_size' (aka 'void (*)(struct libdecor_frame *, int *, int *)') from 'void (const struct libdecor_frame *, int *, int *)' [-Wincompatible-function-pointer-types]
  222 | SDL_WAYLAND_SYM_OPT(void, libdecor_frame_get_min_content_size, (struct libdecor_frame *,\
      | ^                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylanddyn.c:166:58: note: expanded from macro 'SDL_WAYLAND_SYM_OPT'
  166 | #define SDL_WAYLAND_SYM_OPT(rc, fn, params) WAYLAND_##fn = fn;
      |                                                          ^ ~~
In file included from /var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylanddyn.c:168:
/var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylandsym.h:225:1: error: incompatible function pointer types assigning to 'SDL_DYNWAYLANDFN_libdecor_frame_get_max_content_size' (aka 'void (*)(struct libdecor_frame *, int *, int *)') from 'void (const struct libdecor_frame *, int *, int *)' [-Wincompatible-function-pointer-types]
  225 | SDL_WAYLAND_SYM_OPT(void, libdecor_frame_get_max_content_size, (struct libdecor_frame *,\
      | ^                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylanddyn.c:166:58: note: expanded from macro 'SDL_WAYLAND_SYM_OPT'
  166 | #define SDL_WAYLAND_SYM_OPT(rc, fn, params) WAYLAND_##fn = fn;
      |                                                          ^ ~~
2 errors generated.

Issue was already fixed in https://github.com/libsdl-org/SDL/commit/4ce935b9106a0311436e41c5f28f00db30a93de1

The issue only affects libsdl2-2.28.5-r2.ebuild.

libsdl2-2.30.2-r1.ebuild works fine.
Comment 1 Eli Schwartz gentoo-dev 2024-07-21 20:26:19 UTC
Someone already opened a bug for this, but it relied on automagic to hit the issue. I fixed the automagic :D so now you always hit it...
Comment 2 jms 2024-07-22 10:57:06 UTC
Hi,
Hitting this bug today with 

 gui-libs/libdecor (dbus gtk -examples )
media-libs/libsdl2-2.28.5-r2 (X alsa dbus gles2 haptic joystick opengl pipewire pulseaudio sound threads udev video vulkan wayland )
Comment 3 Avraham Hollander 2024-07-23 18:32:58 UTC
Same issue here, on GCC 14.1 rather than Clang. There is definitely a problem. Looks like the libdecor/wayland settings were changed in the ebuild again.

My libdecor is built without USE=gtk. Enabling it doesn't make a difference. It does build with USE=-wayland, which is expected.

/var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylanddyn.c:166:58: error: assignment to 'SDL_DYNWAYLANDFN_libdecor_frame_get_min_content_size' {aka 'void (*)(struct libdecor_frame *, int *, int *)'} from incompatible pointer type 'void (*)(const struct libdecor_frame *, int *, int *)' [-Wincompatible-pointer-types]
  166 | #define SDL_WAYLAND_SYM_OPT(rc, fn, params) WAYLAND_##fn = fn;
      |                                                          ^
/var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylandsym.h:222:1: note: in expansion of macro 'SDL_WAYLAND_SYM_OPT'
  222 | SDL_WAYLAND_SYM_OPT(void, libdecor_frame_get_min_content_size, (struct libdecor_frame *,\
      | ^~~~~~~~~~~~~~~~~~~
/var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylanddyn.c:166:58: error: assignment to 'SDL_DYNWAYLANDFN_libdecor_frame_get_max_content_size' {aka 'void (*)(struct libdecor_frame *, int *, int *)'} from incompatible pointer type 'void (*)(const struct libdecor_frame *, int *, int *)' [-Wincompatible-pointer-types]
  166 | #define SDL_WAYLAND_SYM_OPT(rc, fn, params) WAYLAND_##fn = fn;
      |                                                          ^
/var/tmp/portage/media-libs/libsdl2-2.28.5-r2/work/SDL2-2.28.5/src/video/wayland/SDL_waylandsym.h:225:1: note: in expansion of macro 'SDL_WAYLAND_SYM_OPT'
  225 | SDL_WAYLAND_SYM_OPT(void, libdecor_frame_get_max_content_size, (struct libdecor_frame *,\
      | ^~~~~~~~~~~~~~~~~~~
make: *** [Makefile:743: build/SDL_waylanddyn.lo] Error 1

libsdl2 USE flags: "X alsa custom-cflags dbus gles2 haptic joystick opengl pipewire pulseaudio sound threads udev video vulkan wayland (-aqua) -doc -fcitx4 -gles1 -ibus -jack -kms -libsamplerate -nas -oss -sndio -static-libs -test -xscreensaver" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="mmx sse sse2 -3dnow" VIDEO_CARDS="(-vc4)"

libsdl2-2.30.3 builds fine after unmasking it. So that's an easy solution for now.
Comment 4 Larry the Git Cow gentoo-dev 2024-08-01 07:05:48 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4da31bd05ccf902cd7da0e367da45e29c5ff26cc

commit 4da31bd05ccf902cd7da0e367da45e29c5ff26cc
Author:     Sv. Lockal <lockalsash@gmail.com>
AuthorDate: 2024-07-21 16:36:38 +0000
Commit:     Eli Schwartz <eschwartz@gentoo.org>
CommitDate: 2024-08-01 06:59:55 +0000

    media-libs/libsdl2: Fix build with >=gui-libs/libdecor-0.2.0
    
    This applies https://github.com/libsdl-org/SDL/commit/4ce935b9106a0311436e41c5f28f00db30a93de1
    to libsdl2-2.28.
    
    Closes: https://bugs.gentoo.org/936443
    Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/37657
    Closes: https://bugs.gentoo.org/936020
    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>

 .../files/libsdl2-2.28.5-fix-libdecor-0.2.patch       | 19 +++++++++++++++++++
 media-libs/libsdl2/libsdl2-2.28.5-r2.ebuild           |  1 +
 2 files changed, 20 insertions(+)