Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] libretro-flycast build fails with gcc14
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 644
Location: Ásgarðr

PostPosted: Mon May 27, 2024 2:56 am    Post subject: [SOLVED] libretro-flycast build fails with gcc14 Reply with quote

Hello,
After switching to gcc14, https://github.com/flyinghead/flycast compilation fails (no issue if I use gcc12)

Code:
x86_64-pc-linux-gnu-gcc -DTARGET_LINUX_x64 -DHOST_CPU=0x20000004 -DPICO_SUPPORT_UDP -DPICO_SUPPORT_DHCPD -fopenmp -D__LIBRETRO__  -DHAVE_GLSYM_PRIVATE -DNO_VERIFY -fno-builtin-sqrtf -DENABLE_MODEM -DMINIUPNP_STATICLIB -DNDEBUG -DHAVE_GL3 -funroll-loops -DCORE -DHAVE_TEXUPSCALE -DHAVE_OPENGL -DHAVE_VULKAN -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_SYS_PARAM_H -D_7ZIP_ST -DUSE_FLAC -DUSE_LZMA -O3 -c -fno-strict-aliasing -fomit-frame-pointer -fPIC -I./core/libretro -I./core/ -I./core/deps -I./core/deps/libchdr/include -I./core/deps/lzma/C -I./core/libretro-common/include -I./core/deps/vixl -I./core/deps/stb -I./core/deps/picotcp/include -I./core/deps/picotcp/modules -I./core/deps/miniupnpc -I./core/deps/khronos -I./core/deps/glslang -I./core/deps/flac/include -DTARGET_LINUX_x64 -DHOST_CPU=0x20000004 -DPICO_SUPPORT_UDP -DPICO_SUPPORT_DHCPD -fopenmp -D__LIBRETRO__  -DHAVE_GLSYM_PRIVATE -DNO_VERIFY -fno-builtin-sqrtf -DENABLE_MODEM -DMINIUPNP_STATICLIB -DNDEBUG -DHAVE_GL3 -funroll-loops -DCORE -DHAVE_TEXUPSCALE -DHAVE_OPENGL -DHAVE_VULKAN -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_SYS_PARAM_H -D_7ZIP_ST -DUSE_FLAC -DUSE_LZMA -O3 -c -fno-strict-aliasing -fomit-frame-pointer -fPIC  core/deps/libzip/mkstemp.c -o core/deps/libzip/mkstemp.o
core/deps/libzip/mkstemp.c: In function ‘_zip_mkstemp’:
core/deps/libzip/mkstemp.c:70:15: error: implicit declaration of function ‘getpid’ [-Wimplicit-function-declaration]
   70 |         pid = getpid();
      |               ^~~~~~
make: *** [Makefile:1183: core/deps/libzip/mkstemp.o] Error 1
make: *** Waiting for unfinished jobs....
 * ERROR: games-emulation/libretro-flycast-9999::localrepo failed (compile phase):
 *   emake failed


This is a live ebuild. libzip version used by the project is @1.10.1.

Any idea ?
Thanks.


Last edited by sdauth on Mon May 27, 2024 11:20 am; edited 1 time in total
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2849

PostPosted: Mon May 27, 2024 4:35 am    Post subject: Reply with quote

Code:
core/deps/libzip/mkstemp.c
That sounds odd considering this file does not exist in the repo, it was removed when it bumped to 1.7 all the way back in January 2021 (https://github.com/flyinghead/flycast/commit/16dec49e08838). So you probably aren't using 1.10.1 right now.

Is your live ebuild's checkout updating properly? Or is it using a different repo than the one you linked, like a libretro-specific fork?

Either way, that error would be an indicator that the file is missing a #include <unistd.h>, which exists but it guarded it behind a __APPLE__ for some reason:
Code:
#if defined(__APPLE__)
#include <unistd.h>
#endif
(so, just need to remove the if/endif lines, not to say there may not be more problems with that old version -- and gcc14 has new defaults to error out on these blatant code issues so people start fixing them rather than hope they work by accident)
Back to top
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 644
Location: Ásgarðr

PostPosted: Mon May 27, 2024 5:27 am    Post subject: Reply with quote

Sorry Ionen, indeed I linked the wrong url and got confused. The libzip included in the fork is quite old indeed.
I am using indeed a libretro fork : https://github.com/libretro/flycast
Code:
LIBRETRO_REPO_NAME="libretro/flycast"


I'll have a look at your suggestion.
There is this pull request to update some deps : https://github.com/libretro/flycast/pull/952
but it's been almost 4 years already... And libzip is not even in the list.

Otherwise, is it possible to checkout a different commit for libzip submodule while using libretro eclass with LIBRETRO_REPO_NAME="libretro/flycast" ?
Back to top
View user's profile Send private message
Ionen
Developer
Developer


Joined: 06 Dec 2018
Posts: 2849

PostPosted: Mon May 27, 2024 5:38 am    Post subject: Reply with quote

libzip is not a submodule in either repo, it's hard-included as part of the repo -- newer versions could potentially be incompatible with the rest of the code that hasn't been updated in the libretro fork (likewise for other bundled deps).
Back to top
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 644
Location: Ásgarðr

PostPosted: Mon May 27, 2024 5:43 am    Post subject: Reply with quote

You're right :wink:
Well, I opened a bug : https://github.com/libretro/flycast/issues/1194
I think that's better this way so it can benefit others too. I have 4 other libretro cores build failure with gcc14 to report too :o Not so bad... I'll keep gcc12 around meanwhile.
Back to top
View user's profile Send private message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 644
Location: Ásgarðr

PostPosted: Mon May 27, 2024 11:20 am    Post subject: Reply with quote

As mentioned by the flycast dev on github :
Quote:
This repository is no longer used or maintained. Use https://github.com/flyinghead/flycast instead.


I didn't realize there was a flycast libretro project in CMakeLists.txt of the official repo now.
Found a working ebuild for live version : https://data.gpo.zugaina.org/menelkir/games-emulation/flycast-libretro/flycast-libretro-9999-r5.ebuild (thanks menelkir !)
It compiles fine with gcc14 now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum