-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable compilation on Fedora 41 on aarch64 #526
base: develop
Are you sure you want to change the base?
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 ;) |
@@ -175,6 +176,9 @@ ifeq ($(SYSTEM_ZLIB), 1) | |||
CFLAGS += $(shell pkg-config --cflags zlib) | |||
LDFLAGS += $(shell pkg-config --libs zlib) | |||
else | |||
ifneq (,$(findstring unix,$(platform))) | |||
PLATCFLAGS += -DHAVE_UNISTD_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea. It's not something I have tested previous versions against.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.