-
Notifications
You must be signed in to change notification settings - Fork 29
Alien::SDL fails to build from source with GCC 15 and Perl 5.42 #313
Description
Alien::SDL (dependency of kthakore/frozen-bubble) fails to build in openSUSE 16.0 under Windows Subsystem for Linux due to GCC 15 and Clang 16 not allowing empty parameter prototypes for functions which actually take arguments. Also, SDLPango_CopyFTBitmapToSurface() is used before it is defined.
After fixing all of the below prototype problems, the Perl module builds, but I haven't tested that it works.
I found this bug because my brother tried to install frozen-bubble on his NixOS-unstable computer and he got a compile error. I'm running Windows 10 and I get the same error as him under openSUSE-WSL and also in a NixOS-25.11 VirtualBox VM using an overlay.
Builds on:
• NixOS-25.11
Doesn't build on:
• openSUSE 16.0
• NixOS-unstable
• NixOS-25.11 VM with overlay to grab latest Perl and GCC
Steps to reproduce:
• try to run perl Build.PL;perl Build in Alien-SDL checkout with GCC 15.
• Or, cpan install Alien::SDL with GCC 15.
Reproducibility:
Always fails to build with GCC 15; used to work on older GCC as it was less strict.
Expected vs Actual:
Expected it to build successfully with no errors.
Actual: 4 different source files give an error on GCC 15.
My computer's WSL software:
Perl version: 5.42.1 (installed with perlbrew)
GCC version: 15.2.0
openSUSE version: 16.0
Hardware: MSI GS63 Stealth 8RE
Windows Terminal version: 1.23.20211.0
Windows Subsystem for Linux version:
WSL version: 2.6.3.0
Kernel version: 6.6.87.2-1
WSLg version: 1.0.71
MSRDC version: 1.2.6353
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.19045.7058
Wrong prototypes:
close_display in Xinerama.c
• fixed in libsdl-org/SDL-1.2@e738cff
XiGMiscCloseDisplay in xme.c (also fixed in above commit)
Mix_InitFluidSynth/Mix_QuitFluidSynth
• reported in libsdl-org/SDL_mixer#287
• fixed in libsdl-org/SDL_mixer@05b12a3
SDLPango_CopyFTBitmapToSurface needs a prototype, used before function definition seen.
• SDL_Pango from sourceforge seems to be inactive
• SDL2 version at markuskimius/SDL2_Pango
close_display() error
bin/sh ./libtool --mode=compile gcc -I/mnt/d/Linux_home/nathan/.cpan/build/Alien-SDL-1.446-2/sharedir/1.446_5cf799bf/include -I/usr/include -I/usr/local/include -DNO_SHARED_MEMORY -fPIC -DPIC -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -D_REENTRANT -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c ./src/video/Xext/Xinerama/Xinerama.c -o build/Xinerama.lo
libtool: compile: gcc -I/mnt/d/Linux_home/nathan/.cpan/build/Alien-SDL-1.446-2/sharedir/1.446_5cf799bf/include -I/usr/include -I/usr/local/include -DNO_SHARED_MEMORY -fPIC -DPIC -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -D_REENTRANT -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c ./src/video/Xext/Xinerama/Xinerama.c -fPIC -DPIC -o build/.libs/Xinerama.o
./src/video/Xext/Xinerama/Xinerama.c:61:5: error: initialization of ‘int (*)(Display *, XExtCodes *)’ from incompatible pointer type ‘int (*)(void)’ [-Wincompatible-pointer-types]
61 | close_display, /* close_display */
| ^~~~~~~~~~~~~
./src/video/Xext/Xinerama/Xinerama.c:61:5: note: (near initialization for ‘panoramiX_extension_hooks.close_display’)
./src/video/Xext/Xinerama/Xinerama.c:53:12: note: ‘close_display’ declared here
53 | static int close_display();
| ^~~~~~~~~~~~~
In file included from ./src/video/Xext/Xinerama/Xinerama.c:39:
./src/video/Xext/Xinerama/Xinerama.c:73:37: error: conflicting types for ‘close_display’; have ‘int(Display *, XExtCodes *)’
73 | static XEXT_GENERATE_CLOSE_DISPLAY (close_display, panoramiX_ext_info)
| ^~~~~~~~~~~~~
./src/video/Xext/Xinerama/../extensions/extutil.h:203:5: note: in definition of macro ‘XEXT_GENERATE_CLOSE_DISPLAY’
203 | int proc (Display *dpy, XExtCodes *codes) \
| ^~~~
./src/video/Xext/Xinerama/Xinerama.c:53:12: note: previous declaration of ‘close_display’ with type ‘int(void)’
53 | static int close_display();
| ^~~~~~~~~~~~~
./src/video/Xext/Xinerama/Xinerama.c:53:12: warning: ‘close_display’ used but never defined
./src/video/Xext/Xinerama/Xinerama.c:73:37: warning: ‘close_display’ defined but not used [-Wunused-function]
73 | static XEXT_GENERATE_CLOSE_DISPLAY (close_display, panoramiX_ext_info)
| ^~~~~~~~~~~~~
./src/video/Xext/Xinerama/../extensions/extutil.h:203:5: note: in definition of macro ‘XEXT_GENERATE_CLOSE_DISPLAY’
203 | int proc (Display *dpy, XExtCodes *codes) \
| ^~~~
make: *** [build-deps:1623: build/Xinerama.lo] Error 1
###ERROR### [512] during make ... at inc/My/Builder/Unix.pm line 117.
FROGGS/Alien-SDL-1.446.tar.gz
./Build -- NOT OK
XiGMiscCloseDisplay() error
/bin/sh ./libtool --mode=compile gcc -I/home/nathan/src/Alien-SDL/sharedir/1.446_5cf799bf/include -I/usr/local/include -I/usr/include -DNO_SHARED_MEMORY -fPIC -DPIC -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -D_REENTRANT -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c ./src/video/Xext/XME/xme.c -o build/xme.lo
libtool: compile: gcc -I/home/nathan/src/Alien-SDL/sharedir/1.446_5cf799bf/include -I/usr/local/include -I/usr/include -DNO_SHARED_MEMORY -fPIC -DPIC -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -D_REENTRANT -DXTHREADS -D_REENTRANT -DHAVE_LINUX_VERSION_H -Wall -c ./src/video/Xext/XME/xme.c -fPIC -DPIC -o build/.libs/xme.o
./src/video/Xext/XME/xme.c:218:5: error: initialization of ‘int (*)(Display *, XExtCodes *)’ from incompatible pointer type ‘int (*)(void)’ [-Wincompatible-pointer-types]
218 | XiGMiscCloseDisplay, /* close_display */
| ^~~~~~~~~~~~~~~~~~~
./src/video/Xext/XME/xme.c:218:5: note: (near initialization for ‘xigmisc_extension_hooks.close_display’)
./src/video/Xext/XME/xme.c:209:12: note: ‘XiGMiscCloseDisplay’ declared here
209 | static int XiGMiscCloseDisplay();
| ^~~~~~~~~~~~~~~~~~~
In file included from ./src/video/Xext/XME/xme.c:27:
./src/video/Xext/XME/xme.c:226:37: error: conflicting types for ‘XiGMiscCloseDisplay’; have ‘int(Display *, XExtCodes *’
226 | static XEXT_GENERATE_CLOSE_DISPLAY (XiGMiscCloseDisplay, xigmisc_info)
| ^~~~~~~~~~~~~~~~~~~
./src/video/Xext/XME/../extensions/extutil.h:203:5: note: in definition of macro ‘XEXT_GENERATE_CLOSE_DISPLAY’
203 | int proc (Display *dpy, XExtCodes *codes) \
| ^~~~
./src/video/Xext/XME/xme.c:209:12: note: previous declaration of ‘XiGMiscCloseDisplay’ with type ‘int(void)’
209 | static int XiGMiscCloseDisplay();
| ^~~~~~~~~~~~~~~~~~~
./src/video/Xext/XME/xme.c:209:12: warning: ‘XiGMiscCloseDisplay’ used but never defined
./src/video/Xext/XME/xme.c:226:37: warning: ‘XiGMiscCloseDisplay’ defined but not used [-Wunused-function]
226 | static XEXT_GENERATE_CLOSE_DISPLAY (XiGMiscCloseDisplay, xigmisc_info)
| ^~~~~~~~~~~~~~~~~~~
./src/video/Xext/XME/../extensions/extutil.h:203:5: note: in definition of macro ‘XEXT_GENERATE_CLOSE_DISPLAY’
203 | int proc (Display *dpy, XExtCodes *codes) \
| ^~~~
make: *** [build-deps:1635: build/xme.lo] Error 1
###ERROR### [512] during make ... at inc/My/Builder/Unix.pm line 117, <STDIN> line 7.
Mix_InitFluidSynth() missing prototype
/bin/sh ./libtool --mode=compile gcc -I/home/nathan/src/Alien-SDL/sharedir/1.446_5cf799bf/include -I/usr/include -I/usr/local/include -D_GNU_SOURCE=1 -I/home/nathan/src/Alien-SDL/sharedir/1.446_5cf799bf/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -fvisibility=hidden -DHAVE_FORK -DCMD_MUSIC -DWAV_MUSIC -DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_FLUIDSYNTH_MIDI -DFLUIDSYNTH_DYNAMIC=\"libfluidsynth.so.3\" -DOGG_MUSIC -DOGG_DYNAMIC=\"libvorbisfile.so.3\" -DFLAC_MUSIC -DFLAC_DYNAMIC=\"libFLAC.so.12\" -DHAVE_SIGNAL_H -DHAVE_SETBUF -MMD -MT build/mixer.lo -c mixer.c -o build/mixer.lo
libtool: compile: gcc -I/home/nathan/src/Alien-SDL/sharedir/1.446_5cf799bf/include -I/usr/include -I/usr/local/include -D_GNU_SOURCE=1 -I/home/nathan/src/Alien-SDL/sharedir/1.446_5cf799bf/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -fvisibility=hidden -DHAVE_FORK -DCMD_MUSIC -DWAV_MUSIC -DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_FLUIDSYNTH_MIDI -DFLUIDSYNTH_DYNAMIC=\"libfluidsynth.so.3\" -DOGG_MUSIC -DOGG_DYNAMIC=\"libvorbisfile.so.3\" -DFLAC_MUSIC -DFLAC_DYNAMIC=\"libFLAC.so.12\" -DHAVE_SIGNAL_H -DHAVE_SETBUF -MMD -MT build/mixer.lo -c mixer.c -fPIC -DPIC -o build/.libs/mixer.o
mixer.c: In function ‘Mix_Init’:
mixer.c:153:60: error: implicit declaration of function ‘Mix_InitFluidSynth’ [-Wimplicit-function-declaration]
153 | if ((initialized & MIX_INIT_FLUIDSYNTH) || Mix_InitFluidSynth() == 0) {
| ^~~~~~~~~~~~~~~~~~
mixer.c: In function ‘Mix_Quit’:
mixer.c:205:17: error: implicit declaration of function ‘Mix_QuitFluidSynth’ [-Wimplicit-function-declaration]
205 | Mix_QuitFluidSynth();
| ^~~~~~~~~~~~~~~~~~
make: *** [Makefile:149: build/mixer.lo] Error 1
###ERROR### [512] during make ... at inc/My/Builder/Unix.pm line 117.
SDLPango_CopyFTBitmapToSurface() used before being declared
make[1]: Entering directory '/home/nathan/src/Alien-SDL/build_src/SDL_Pango-0.1.2/src'
if /bin/sh ../libtool --mode=compile gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"SDL_Pango\" -DVERSION=\"0.1.2\" -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DBUILD_DLL -I. -I. -I/home/nathan/src/Alien-SDL/sharedir/1.446_5cf799bf/include -I/usr/include -I/usr/local/include -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/pango-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/home/nathan/src/Alien-SDL/sharedir/1.446_5cf799bf/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -MT SDL_Pango.lo -MD -MP -MF ".deps/SDL_Pango.Tpo" -c -o SDL_Pango.lo SDL_Pango.c; \
then mv -f ".deps/SDL_Pango.Tpo" ".deps/SDL_Pango.Plo"; else rm -f ".deps/SDL_Pango.Tpo"; exit 1; fi
libtool: compile: gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"SDL_Pango\" -DVERSION=\"0.1.2\" -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DBUILD_DLL -I. -I. -I/home/nathan/src/Alien-SDL/sharedir/1.446_5cf799bf/include -I/usr/include -I/usr/local/include -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/pango-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/home/nathan/src/Alien-SDL/sharedir/1.446_5cf799bf/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -MT SDL_Pango.lo -MD -MP -MF .deps/SDL_Pango.Tpo -c SDL_Pango.c -fPIC -DPIC -o .libs/SDL_Pango.o
SDL_Pango.c: In function ‘SDLPango_Init’:
SDL_Pango.c:301:5: warning: ‘g_type_init’ is deprecated [-Wdeprecated-declarations]
301 | g_type_init();
| ^~~~~~~~~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
from /usr/include/glib-2.0/gobject/gbinding.h:31,
from /usr/include/glib-2.0/glib-object.h:24,
from /usr/include/pango-1.0/pango/pango-coverage.h:25,
from /usr/include/pango-1.0/pango/pango-font.h:25,
from /usr/include/pango-1.0/pango/pango-attributes.h:25,
from /usr/include/pango-1.0/pango/pango.h:25,
from SDL_Pango.c:229:
/usr/include/glib-2.0/gobject/gtype.h:737:23: note: declared here
737 | void g_type_init (void);
| ^~~~~~~~~~~
SDL_Pango.c: In function ‘drawGlyphString’:
SDL_Pango.c:345:5: error: implicit declaration of function ‘SDLPango_CopyFTBitmapToSurface’ [-Wimplicit-function-declaration]
345 | SDLPango_CopyFTBitmapToSurface(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SDL_Pango.c: At top level:
SDL_Pango.c:661:1: warning: conflicting types for ‘SDLPango_CopyFTBitmapToSurface’; have ‘void(const FT_Bitmap *, SDL_Surface *, const SDLPango_Matrix *, SDL_Rect *)’ {aka ‘void(const struct FT_Bitmap_ *, SDL_Surface *, const struct _SDLPango_Matrix *, SDL_Rect *)’}
661 | SDLPango_CopyFTBitmapToSurface(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SDL_Pango.c:345:5: note: previous implicit declaration of ‘SDLPango_CopyFTBitmapToSurface’ with type ‘void(const FT_Bitmap *, SDL_Surface *, const SDLPango_Matrix *, SDL_Rect *)’ {aka ‘void(const struct FT_Bitmap_ *, SDL_Surface *, const struct _SDLPango_Matrix *, SDL_Rect *)’}
345 | SDLPango_CopyFTBitmapToSurface(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib64/glib-2.0/include/glibconfig.h:9,
from /usr/include/glib-2.0/glib/gtypes.h:34,
from /usr/include/glib-2.0/glib/galloca.h:34,
from /usr/include/glib-2.0/glib.h:32,
from /usr/include/glib-2.0/gobject/gbinding.h:30:
SDL_Pango.c: In function ‘SDLPango_CreateContext_GivenFontDesc’:
/usr/include/glib-2.0/glib/gmacros.h:1301:33: warning: Deprecated pre-processor symbol: replace with "const"
1301 | #define _GLIB_GNUC_DO_PRAGMA(x) _Pragma(G_STRINGIFY (x))
| ^~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1304:3: note: in expansion of macro ‘_GLIB_GNUC_DO_PRAGMA’
1304 | _GLIB_GNUC_DO_PRAGMA(GCC warning G_STRINGIFY (Deprecated pre-processor symbol: replace with #f))
| ^~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/glib-visibility.h:108:46: note: in expansion of macro ‘GLIB_DEPRECATED_MACRO_FOR’
108 | #define GLIB_DEPRECATED_MACRO_IN_2_30_FOR(f) GLIB_DEPRECATED_MACRO_FOR (f)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1052:30: note: in expansion of macro ‘GLIB_DEPRECATED_MACRO_IN_2_30_FOR’
1052 | #define G_CONST_RETURN const GLIB_DEPRECATED_MACRO_IN_2_30_FOR(const)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SDL_Pango.c:730:5: note: in expansion of macro ‘G_CONST_RETURN’
730 | G_CONST_RETURN char *charset;
| ^~~~~~~~~~~~~~
SDL_Pango.c:735:5: warning: ‘pango_ft2_font_map_create_context’ is deprecated: Use 'pango_font_map_create_context' instead [-Wdeprecated-declarations]
735 | context->context = pango_ft2_font_map_create_context (PANGO_FT2_FONT_MAP (context->font_map));
| ^~~~~~~
In file included from SDL_Pango.c:230:
/usr/include/pango-1.0/pango/pangoft2.h:128:15: note: declared here
128 | PangoContext *pango_ft2_font_map_create_context (PangoFT2FontMap *fontmap);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:295: SDL_Pango.lo] Error 1
make[1]: Leaving directory '/home/nathan/src/Alien-SDL/build_src/SDL_Pango-0.1.2/src'
make: *** [Makefile:294: install-recursive] Error 1
###ERROR### [512] during make ... at inc/My/Builder/Unix.pm line 117.