Skip to content
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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

pstef
Copy link

@pstef pstef commented Mar 19, 2024

This gets rid of two compilation errors I was getting with the bundled zlib and minizip libraries, and one compilation error in libretro.c.

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.
@m4xw
Copy link
Collaborator

m4xw commented Apr 11, 2024

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...
Is this for you personal or for distribution on the package manager?
I think the zip libs are fair to use the distribution but just for the record i highly recommend using the bundled libpng, historically that caused too much issues.

@pstef
Copy link
Author

pstef commented Apr 11, 2024

I did this for my personal use and I thought I'd share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants