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 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ ifeq ($(SYSTEM_MINIZIP), 1)
CFLAGS += $(shell pkg-config --cflags minizip)
LDFLAGS += $(shell pkg-config --libs minizip)
else
PLATCFLAGS += -DNOCRYPT -DNOUNCRYPT
INCFLAGS += $(MINIZIP_INCFLAGS)
SOURCES_C += $(MINIZIP_SOURCES_C)
endif
Expand All @@ -177,6 +178,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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required?

Copy link
Author

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.

Copy link
Collaborator

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.

Copy link
Author

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.

Copy link
Author

@pstef pstef Jul 28, 2024

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

endif
INCFLAGS += $(ZLIB_INCFLAGS)
SOURCES_C += $(ZLIB_SOURCES_C)
endif
Expand Down
11 changes: 8 additions & 3 deletions libretro/libretro.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ static void emu_step_initialize(void)
plugin_connect_all();
}

static void* EmuThreadFunction(void* param)
static void EmuThreadFunction()
{
uint32_t netplay_port = 0;
uint16_t netplay_player = 1;
Expand Down Expand Up @@ -484,8 +484,13 @@ static void* EmuThreadFunction(void* param)
// Unset
emuThreadRunning = false;
}
}

return NULL;
static void* EmuThreadWrapper(void* param)
{
(void)param;
EmuThreadFunction();
return NULL;
}

static void reinit_gfx_plugin(void)
Expand Down Expand Up @@ -2027,7 +2032,7 @@ void retro_run (void)
{
if(!emuThreadRunning)
{
pthread_create(&emuThread, NULL, &EmuThreadFunction, NULL);
pthread_create(&emuThread, NULL, &EmuThreadWrapper, NULL);
emuThreadRunning = true;
}
}
Expand Down