Enable compilation on Fedora 41 on aarch64#526
Enable compilation on Fedora 41 on aarch64#526pstef wants to merge 5 commits intolibretro:developfrom
Conversation
Trying to compile this libretro core on my Fedora aarch64 machine
I was getting this error:
mupen64plus-core/subprojects/minizip/zip.c:1249:28:
error: assignment to
‘const long unsigned int *’ from incompatible pointer type
‘const uint32_t *’ {aka ‘const unsigned int *’}
[-Wincompatible-pointer-types]
1249 | zi->ci.pcrc_32_tab = get_crc_table();
| ^
(redacted for clarity in this commit message)
Curiously, mupen64plus-core having the same minizip code didn't
suffer from this error. This is because there the problematic code
has been disabled by using exclusion defines NOCRYPT and NOUNCRYPT.
This commit tries to do the same for this repository.
Trying to compile this libretro core on my Fedora aarch64 machine I was getting: libretro/libretro.c:722:61: error: passing argument 2 of ‘co_create’ from incompatible pointer type [-Wincompatible-pointer-types] game_thread = co_create(65536 * sizeof(void*) * 16, EmuThreadFunction); (redacted for clarity in this commit message) The problem is that co_create() and pthread_create() are different APIs. While the former expects a void (*)(void), the latter expects a void * (*)(void *). This commit * redefines EmuThreadFunction so that it matches co_create() where it's used, and * creates a new wrapping function EmuThreadWrapper matching the function type expected by pthread_create(), where it's used.
On my system it was missing the inclusion of unistd.h. Mimic what's been done for MacOSX and conditionally add -DHAVE_UNISTD_H for this library.
|
Hi, sorry missed this PR. I will check it out by next week. I could swear i had some of the type missmatch stuff fixed before i cant remember where it went... |
|
I did this for my personal use and I thought I'd share. |
|
This is starting to conflict with other people's commits. |
Well yours already conflicts with my changes too ;) |
| LDFLAGS += $(shell pkg-config --libs zlib) | ||
| else | ||
| ifneq (,$(findstring unix,$(platform))) | ||
| PLATCFLAGS += -DHAVE_UNISTD_H |
There was a problem hiding this comment.
Without it custom/dependencies/libzlib/zconf.h doesn't include unistd.h and compilation fails on unknown functions read(), close(), write().
I don't insist on this solution, but something is needed to remedy this issue.
There was a problem hiding this comment.
Hm how didnt this blow before? Did it link implicitly? Not sure if large file support would be more appropriate.
There was a problem hiding this comment.
No idea. It's not something I have tested previous versions against.
There was a problem hiding this comment.
I just compiled this core on a Debian Trixie, which is a testing release but not as experimental as Fedora Rawhide is. The GCC version here is 13 as opposed to GCC 14 in Rawhide. The implicit declarations are reported by GCC 13 as well, but only as warnings. Most likely this warning has been promoted to an error somewhere on the way to GCC 14.1.
There was a problem hiding this comment.
|
Can you try if fpermissive in cflags also works? |
|
I'm already using this patch and whether you take it or not will have to be your choice and responsibility, not mine. |
|
Btw i have been reproducing this with emscripten so will get that in after my update round |
This gets rid of two compilation errors I was getting with the bundled zlib and minizip libraries, and one compilation error in libretro.c.