SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Build failure with joystick support disabled

Open AMDmi3 opened this issue 3 years ago • 2 comments

There's build regression in 2.24.0 (2.0.22 built fine) with joystick disabled (--disable-joystick --disable-haptic)

libtool: compile:  cc -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -std=c99 -DLIBICONV_PLUG -isystem /usr/local/include -DUSING_GENERATED_CONFIG_H -Iinclude -I/work/usr/ports/devel/sdl20/work/SDL2-2.24.0/include -idirafter /work/usr/ports/devel/sdl20/work/SDL2-2.24.0/src/video/khronos -DSDL_BUILD_MAJOR_VERSION=2 -DSDL_BUILD_MINOR_VERSION=24 -DSDL_BUILD_MICRO_VERSION=0 -mmmx -msse -msse2 -Wall -fno-strict-aliasing -fvisibility=hidden -Wdeclaration-after-statement -Werror=declaration-after-statement -I/usr/local/include -I/usr/local/include -I/usr/local/include/libdrm -I/usr/local/include -I/usr/local/include -I/usr/local/include/libepoll-shim -Igen -D_REENTRANT -D_THREAD_SAFE -MMD -MT build/SDL_evdev.lo -c /work/usr/ports/devel/sdl20/work/SDL2-2.24.0/src/core/linux/SDL_evdev.c  -fPIC -DPIC -o build/.libs/SDL_evdev.o
/work/usr/ports/devel/sdl20/work/SDL2-2.24.0/src/core/linux/SDL_evdev.c:621:23: error: use of undeclared identifier 'SDL_UDEV_DEVICE_TOUCHPAD'
        (udev_class & SDL_UDEV_DEVICE_TOUCHPAD) ? SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE : SDL_TOUCH_DEVICE_DIRECT,
                      ^
/work/usr/ports/devel/sdl20/work/SDL2-2.24.0/src/core/linux/SDL_evdev.c:774:26: warning: implicit declaration of function 'NBITS' is invalid in C99 [-Wimplicit-function-declaration]
    unsigned long relbit[NBITS(REL_MAX)] = { 0 };
                         ^
/work/usr/ports/devel/sdl20/work/SDL2-2.24.0/src/core/linux/SDL_evdev.c:774:26: error: variable-sized object may not be initialized
    unsigned long relbit[NBITS(REL_MAX)] = { 0 };
                         ^~~~~~~~~~~~~~
/work/usr/ports/devel/sdl20/work/SDL2-2.24.0/src/core/linux/SDL_evdev.c:802:32: warning: implicit declaration of function 'test_bit' is invalid in C99 [-Wimplicit-function-declaration]
        item->relative_mouse = test_bit(REL_X, relbit) && test_bit(REL_Y, relbit);
                               ^
/work/usr/ports/devel/sdl20/work/SDL2-2.24.0/src/core/linux/SDL_evdev.c:808:23: error: use of undeclared identifier 'SDL_UDEV_DEVICE_TOUCHSCREEN'
    if (udev_class & (SDL_UDEV_DEVICE_TOUCHSCREEN | SDL_UDEV_DEVICE_TOUCHPAD)) {
                      ^
/work/usr/ports/devel/sdl20/work/SDL2-2.24.0/src/core/linux/SDL_evdev.c:808:53: error: use of undeclared identifier 'SDL_UDEV_DEVICE_TOUCHPAD'
    if (udev_class & (SDL_UDEV_DEVICE_TOUCHSCREEN | SDL_UDEV_DEVICE_TOUCHPAD)) {
                                                    ^
2 warnings and 4 errors generated.

AMDmi3 avatar Sep 02 '22 15:09 AMDmi3

What platform are you building on?

slouken avatar Sep 02 '22 16:09 slouken

FreeBSD 13.1 amd64

AMDmi3 avatar Sep 02 '22 19:09 AMDmi3

The same for Ubuntu but not sure what is the dependencies on particular version: failed on 16.04, 18.04, 22.04. Some instances build the code fine, some are failing with the error. I assume some dev libraries/dependencies are not installed on those which have build errors. It would be helpful to have some kid of guidance how to configure the system to avoid the failure while we're waiting for a fix. For me it looks like HAVE_LIBUDEV_H is not defined which makes the definitions hidden while the point of use ain't protected by the came CC

apylchagin avatar Sep 27 '22 02:09 apylchagin

This should be fixed by 71fb91f7e43c5f046a037bf5ca59214d93fe2d51. Can you confirm?

cgutman avatar Sep 27 '22 02:09 cgutman

Yes, this works for me.

AMDmi3 avatar Sep 27 '22 10:09 AMDmi3

same here. Also it was fixed on ubuntu by installing those two packages: libudev-dev libusb-1.0-0-dev

apylchagin avatar Sep 27 '22 14:09 apylchagin

I've got a report that it's still broken with disabled joystick, libudev and wayland. The thing is that FreeBSD port pulled evdev-proto for any of these, so it's not available when neither is enabled, but is still used by SDL. However, this case builds fine if the patch is removed. So either this needs different fix, or it should be stated somewhere what evdev-proto is always required.

AMDmi3 avatar Sep 28 '22 18:09 AMDmi3

Yes, it sounds like we need a different fix. Any chance I can ssh into a box with this configuration and troubleshoot?

slouken avatar Sep 28 '22 20:09 slouken

I think this is fixed, feel free to reopen with more details if you're still seeing this.

Thanks!

slouken avatar Nov 11 '22 18:11 slouken

Thank you, I will recheck this when updating FreeBSD port for the next SDL release.

AMDmi3 avatar Nov 11 '22 19:11 AMDmi3

Would you mind rechecking before the next release (Any Day Now (tm))? I'd hate for us to release and then you try it out and go "Um... actually..." :)

slouken avatar Nov 11 '22 21:11 slouken

Well, that's how it works in the real world, and that's exactly why we have release early, release often motto. But sure - I've checked and it builds fine with either only joystick, or all options which pull evdev_proto disabled so the fix is confirmed. Thank you very much!

AMDmi3 avatar Nov 14 '22 15:11 AMDmi3

Great, you're welcome!

slouken avatar Nov 14 '22 16:11 slouken

--disable-joystick --disable-haptic does not build:

/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c: In function 'SDL_EVDEV_init_touchscreen':
/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c:621:23: error: 'SDL_UDEV_DEVICE_TOUCHPAD' undeclared (first use in this function)
         (udev_class & SDL_UDEV_DEVICE_TOUCHPAD) ? SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE : SDL_TOUCH_DEVICE_DIRECT,
                       ^
/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c:621:23: note: each undeclared identifier is reported only once for each function it appears in
/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c: In function 'SDL_EVDEV_device_added':
/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c:774:5: warning: implicit declaration of function 'NBITS' [-Wimplicit-function-declaration]
     unsigned long relbit[NBITS(REL_MAX)] = { 0 };
     ^
/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c:774:5: error: variable-sized object may not be initialized
/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c:774:5: warning: excess elements in array initializer [enabled by default]
/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c:774:5: warning: (near initialization for 'relbit') [enabled by default]
/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c:802:9: warning: implicit declaration of function 'test_bit' [-Wimplicit-function-declaration]
         item->relative_mouse = test_bit(REL_X, relbit) && test_bit(REL_Y, relbit);
         ^
/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c:808:23: error: 'SDL_UDEV_DEVICE_TOUCHSCREEN' undeclared (first use in this function)
     if (udev_class & (SDL_UDEV_DEVICE_TOUCHSCREEN | SDL_UDEV_DEVICE_TOUCHPAD)) {
                       ^
/__w/SDL2-binaries/SDL2-binaries/SDL2-2.24.2/src/core/linux/SDL_evdev.c:808:53: error: 'SDL_UDEV_DEVICE_TOUCHPAD' undeclared (first use in this function)
     if (udev_class & (SDL_UDEV_DEVICE_TOUCHSCREEN | SDL_UDEV_DEVICE_TOUCHPAD)) {
                                                     ^

Mailaender avatar Nov 17 '22 09:11 Mailaender

Did you try with the latest code in git?

slouken avatar Nov 17 '22 14:11 slouken

No, sorry. I didn't see the 2.26 milestone.

Mailaender avatar Nov 17 '22 17:11 Mailaender