RA version 1.22.0 fails to build on Debian unstable
Is there an existing issue for this?
- [x] This is a bug in RetroArch frontend
- [x] I have searched the existing issues
Description
Build fail with incompatible pointer type error
Expected behavior
Should build...
Steps to reproduce the bug
type make after configure
Version/Commit
1.22.0
Bisect Results
No response
Present in the nightly version
I don't know
Platform & operating system
Linux amd64
Affected Cores
No response
Environment information
Debian unstable amd64 and i386```
Relevant log output
``
root@christian:/tmp/buildd/retroarch-dmo-1.22.0# make
CC input/bsv/bsvmovie.c
input/bsv/bsvmovie.c: In function 'bsv_movie_load_checkpoint':
input/bsv/bsvmovie.c:388:42: error: passing argument 2 of 'uncompress' from incompatible pointer type [-Wincompatible-pointer-types]
388 | if (uncompress(encoded_data, &uncompressed_size_zlib, compressed_data, compressed_encoded_size) != Z_OK)
| ^~~~~~~~~~~~~~~~~~~~~~~
| |
| uint32_t * {aka unsigned int *}
In file included from input/bsv/bsvmovie.c:20:
/usr/include/zlib.h:1270:55: note: expected 'uLongf *' {aka 'long unsigned int *'} but argument is of type 'uint32_t *' {aka 'unsigned int *'}
1270 | ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen,
| ~~~~~~~~^~~~~~~
make: *** [Makefile:236: obj-unix/release/input/bsv/bsvmovie.o] Error 1
Hi,
Can you specify the RA commit and compiler version ?
Thank you.
ping @JoeOsborn
Ohhh, system zlib vs vendored zlib header issue maybe. I’ll look today.
@JoeOsborn Debian zlib1g-dev is 1.3.1 and retroarch 1.2.8
I can't reproduce in a 64bit debian-unstable distrobox or a 32-bit debian-unstable lxc container. Clean followed by configure and make compiles without incident.
I got it to reproduce by forcing HAVE_BUILTINZLIB to 0, will have a patch soon
Do the most recent commits help? I've been fixing a bunch of CXX_BUILD/C89_BUILD errors/warnings
Oh sweet, they do as a matter of fact! I see your "fix for conflicting types in uncompress prototype". I was trying to fix it locally in bsvmovie.c by changing the ifdef to HAVE_BUILTINZLIB because I was afraid to change it in deps/, but changing the uncompress prototype is the right move.
@marillat Let us know if current master builds for you now
Still doesn't build in libchdr_flac.c We have flac 1.5.0 in debian unstable
CC libretro-common/formats/libchdr/libchdr_flac.c
libretro-common/formats/libchdr/libchdr_flac.c:28:8: error: unknown type name 'drflac_bool32'
28 | static drflac_bool32 flac_decoder_seek_callback(void *userdata, int offset, drflac_seek_origin origin);
| ^~~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c:28:77: error: unknown type name 'drflac_seek_origin'
28 | static drflac_bool32 flac_decoder_seek_callback(void *userdata, int offset, drflac_seek_origin origin);
| ^~~~~~~~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c:29:60: error: unknown type name 'drflac_metadata'
29 | static void flac_decoder_metadata_callback(void *userdata, drflac_metadata *metadata);
| ^~~~~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c: In function 'flac_decoder_free':
libretro-common/formats/libchdr/libchdr_flac.c:68:17: error: implicit declaration of function 'drflac_close' [-Wimplicit-function-declaration]
68 | drflac_close(decoder->decoder);
| ^~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c: In function 'flac_decoder_internal_reset':
libretro-common/formats/libchdr/libchdr_flac.c:83:28: error: implicit declaration of function 'drflac_open_with_metadata' [-Wimplicit-function-declaration]
83 | decoder->decoder = drflac_open_with_metadata(
| ^~~~~~~~~~~~~~~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c:84:45: error: 'flac_decoder_seek_callback' undeclared (first use in this function); did you mean 'flac_decoder_read_callback'?
84 | flac_decoder_read_callback, flac_decoder_seek_callback,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| flac_decoder_read_callback
libretro-common/formats/libchdr/libchdr_flac.c:84:45: note: each undeclared identifier is reported only once for each function it appears in
libretro-common/formats/libchdr/libchdr_flac.c:85:17: error: 'flac_decoder_metadata_callback' undeclared (first use in this function); did you mean 'flac_decoder_read_callback'?
85 | flac_decoder_metadata_callback, decoder, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| flac_decoder_read_callback
libretro-common/formats/libchdr/libchdr_flac.c: In function 'flac_decoder_decode_interleaved':
libretro-common/formats/libchdr/libchdr_flac.c:151:22: error: implicit declaration of function 'drflac_read_pcm_frames_s16' [-Wimplicit-function-declaration]
151 | if (!drflac_read_pcm_frames_s16(decoder->decoder, frames, buffer))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c: In function 'flac_decoder_finish':
libretro-common/formats/libchdr/libchdr_flac.c:167:9: error: unknown type name 'drflac'
167 | drflac *flac = decoder->decoder;
| ^~~~~~
libretro-common/formats/libchdr/libchdr_flac.c:171:21: error: implicit declaration of function 'DRFLAC_CACHE_L2_LINES_REMAINING' [-Wimplicit-function-declaration]
171 | position -= DRFLAC_CACHE_L2_LINES_REMAINING(&flac->bs) * sizeof(drflac_cache_t);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c:171:58: error: request for member 'bs' in something not a structure or union
171 | position -= DRFLAC_CACHE_L2_LINES_REMAINING(&flac->bs) * sizeof(drflac_cache_t);
| ^~
libretro-common/formats/libchdr/libchdr_flac.c:171:73: error: 'drflac_cache_t' undeclared (first use in this function)
171 | position -= DRFLAC_CACHE_L2_LINES_REMAINING(&flac->bs) * sizeof(drflac_cache_t);
| ^~~~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c:172:21: error: implicit declaration of function 'DRFLAC_CACHE_L1_BITS_REMAINING' [-Wimplicit-function-declaration]
172 | position -= DRFLAC_CACHE_L1_BITS_REMAINING(&flac->bs) / 8;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c:172:57: error: request for member 'bs' in something not a structure or union
172 | position -= DRFLAC_CACHE_L1_BITS_REMAINING(&flac->bs) / 8;
| ^~
libretro-common/formats/libchdr/libchdr_flac.c:173:25: error: request for member 'bs' in something not a structure or union
173 | position -= flac->bs.unalignedByteCount;
| ^~
libretro-common/formats/libchdr/libchdr_flac.c: At top level:
libretro-common/formats/libchdr/libchdr_flac.c:223:60: error: unknown type name 'drflac_metadata'
223 | static void flac_decoder_metadata_callback(void *userdata, drflac_metadata *metadata)
| ^~~~~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c:286:8: error: unknown type name 'drflac_bool32'
286 | static drflac_bool32 flac_decoder_seek_callback(void *userdata, int offset, drflac_seek_origin origin)
| ^~~~~~~~~~~~~
libretro-common/formats/libchdr/libchdr_flac.c:286:77: error: unknown type name 'drflac_seek_origin'
286 | static drflac_bool32 flac_decoder_seek_callback(void *userdata, int offset, drflac_seek_origin origin)
| ^~~~~~~~~~~~~~~~~~
make: *** [Makefile:236: obj-unix/release/./libretro-common/formats/libchdr/libchdr_flac.o] Error 1
@marillat Please rename the issue title to something RA version 1.22.0 fails to build on Debian unstable
Thank you.
Still doesn't build in libchdr_flac.c We have flac 1.5.0 in debian unstable
CC libretro-common/formats/libchdr/libchdr_flac.c libretro-common/formats/libchdr/libchdr_flac.c:28:8: error: unknown type name 'drflac_bool32' 28 | static drflac_bool32 flac_decoder_seek_callback(void *userdata, int offset, drflac_seek_origin origin); | ^~~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c:28:77: error: unknown type name 'drflac_seek_origin' 28 | static drflac_bool32 flac_decoder_seek_callback(void *userdata, int offset, drflac_seek_origin origin); | ^~~~~~~~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c:29:60: error: unknown type name 'drflac_metadata' 29 | static void flac_decoder_metadata_callback(void *userdata, drflac_metadata *metadata); | ^~~~~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c: In function 'flac_decoder_free': libretro-common/formats/libchdr/libchdr_flac.c:68:17: error: implicit declaration of function 'drflac_close' [-Wimplicit-function-declaration] 68 | drflac_close(decoder->decoder); | ^~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c: In function 'flac_decoder_internal_reset': libretro-common/formats/libchdr/libchdr_flac.c:83:28: error: implicit declaration of function 'drflac_open_with_metadata' [-Wimplicit-function-declaration] 83 | decoder->decoder = drflac_open_with_metadata( | ^~~~~~~~~~~~~~~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c:84:45: error: 'flac_decoder_seek_callback' undeclared (first use in this function); did you mean 'flac_decoder_read_callback'? 84 | flac_decoder_read_callback, flac_decoder_seek_callback, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | flac_decoder_read_callback libretro-common/formats/libchdr/libchdr_flac.c:84:45: note: each undeclared identifier is reported only once for each function it appears in libretro-common/formats/libchdr/libchdr_flac.c:85:17: error: 'flac_decoder_metadata_callback' undeclared (first use in this function); did you mean 'flac_decoder_read_callback'? 85 | flac_decoder_metadata_callback, decoder, NULL); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | flac_decoder_read_callback libretro-common/formats/libchdr/libchdr_flac.c: In function 'flac_decoder_decode_interleaved': libretro-common/formats/libchdr/libchdr_flac.c:151:22: error: implicit declaration of function 'drflac_read_pcm_frames_s16' [-Wimplicit-function-declaration] 151 | if (!drflac_read_pcm_frames_s16(decoder->decoder, frames, buffer)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c: In function 'flac_decoder_finish': libretro-common/formats/libchdr/libchdr_flac.c:167:9: error: unknown type name 'drflac' 167 | drflac *flac = decoder->decoder; | ^~~~~~ libretro-common/formats/libchdr/libchdr_flac.c:171:21: error: implicit declaration of function 'DRFLAC_CACHE_L2_LINES_REMAINING' [-Wimplicit-function-declaration] 171 | position -= DRFLAC_CACHE_L2_LINES_REMAINING(&flac->bs) * sizeof(drflac_cache_t); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c:171:58: error: request for member 'bs' in something not a structure or union 171 | position -= DRFLAC_CACHE_L2_LINES_REMAINING(&flac->bs) * sizeof(drflac_cache_t); | ^~ libretro-common/formats/libchdr/libchdr_flac.c:171:73: error: 'drflac_cache_t' undeclared (first use in this function) 171 | position -= DRFLAC_CACHE_L2_LINES_REMAINING(&flac->bs) * sizeof(drflac_cache_t); | ^~~~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c:172:21: error: implicit declaration of function 'DRFLAC_CACHE_L1_BITS_REMAINING' [-Wimplicit-function-declaration] 172 | position -= DRFLAC_CACHE_L1_BITS_REMAINING(&flac->bs) / 8; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c:172:57: error: request for member 'bs' in something not a structure or union 172 | position -= DRFLAC_CACHE_L1_BITS_REMAINING(&flac->bs) / 8; | ^~ libretro-common/formats/libchdr/libchdr_flac.c:173:25: error: request for member 'bs' in something not a structure or union 173 | position -= flac->bs.unalignedByteCount; | ^~ libretro-common/formats/libchdr/libchdr_flac.c: At top level: libretro-common/formats/libchdr/libchdr_flac.c:223:60: error: unknown type name 'drflac_metadata' 223 | static void flac_decoder_metadata_callback(void *userdata, drflac_metadata *metadata) | ^~~~~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c:286:8: error: unknown type name 'drflac_bool32' 286 | static drflac_bool32 flac_decoder_seek_callback(void *userdata, int offset, drflac_seek_origin origin) | ^~~~~~~~~~~~~ libretro-common/formats/libchdr/libchdr_flac.c:286:77: error: unknown type name 'drflac_seek_origin' 286 | static drflac_bool32 flac_decoder_seek_callback(void *userdata, int offset, drflac_seek_origin origin) | ^~~~~~~~~~~~~~~~~~ make: *** [Makefile:236: obj-unix/release/./libretro-common/formats/libchdr/libchdr_flac.o] Error 1
For my build, I added -DHAVE_DR_FLAC=1 to the CFLAGS environment variable to get it to compile with system libFLAC. I hope that that hack won't be necessary in future versions.
For my build, I added -DHAVE_DR_FLAC=1 to the CFLAGS environment variable to get it to compile with system libFLAC. I hope that that hack won't be necessary in future versions.
@keithbowes With this environment variable flac support is disabled.
Same result on Arch Linux, had to build against the builtin flac.