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

Fail to compile new build on raspberry pi 4 #1791

Open
BiobaTiry opened this issue Dec 29, 2024 · 7 comments
Open

Fail to compile new build on raspberry pi 4 #1791

BiobaTiry opened this issue Dec 29, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@BiobaTiry
Copy link

Please Note: This form is the minimum required information for submitting bugs.
Removing this form may lead to your issue being closed until it is completed.

Platform / OS / Hardware: Raspberry Pi 4

Flycast version: 2.4

Hardware:

Description of the Issue
I've installed the required packages:

sudo apt install git libao-dev libasound2-dev libevdev-dev libgl1-mesa-dev liblua5.3-dev libminiupnpc-dev libpulse-dev libsdl2-dev libudev-dev libzip-dev cmake libcurl4-openssl-dev libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxkbcommon-dev libdrm-dev libgbm-dev libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev

i've try to compile with this command:

git clone --recursive https://github.com/flyinghead/flycast.git
cd flycast
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release

After few minutes i've got some errors..

Logs Gathered


Determining if the __ARM64__ exist failed with the following output:
Change Dir: /home/pi/flycast/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_6b3bc/fast && /usr/bin/make -f CMakeFiles/cmTC_6b3bc.dir/build.make CMakeFiles/cmTC_6b3bc.dir/build
make[1]: Entering directory '/home/pi/flycast/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_6b3bc.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_6b3bc.dir/CheckSymbolExists.c.o   -c /home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c: In function ‘main’:
/home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:7:19: error: ‘__ARM64__’ undeclared (first use in this function); did you mean ‘__TIME__’?
   return ((int*)(&__ARM64__))[argc];
                   ^~~~~~~~~
                   __TIME__
/home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:7:19: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [CMakeFiles/cmTC_6b3bc.dir/build.make:66: CMakeFiles/cmTC_6b3bc.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/home/pi/flycast/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_6b3bc/fast] Error 2


File /home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */

int main(int argc, char** argv)
{
  (void)argv;
#ifndef __ARM64__
  return ((int*)(&__ARM64__))[argc];
#else
  (void)argc;
  return 0;
#endif
}
Determining if the __aarch64__ exist failed with the following output:
Change Dir: /home/pi/flycast/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_40cea/fast && /usr/bin/make -f CMakeFiles/cmTC_40cea.dir/build.make CMakeFiles/cmTC_40cea.dir/build
make[1]: Entering directory '/home/pi/flycast/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_40cea.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_40cea.dir/CheckSymbolExists.c.o   -c /home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c: In function ‘main’:
/home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:7:19: error: ‘__aarch64__’ undeclared (first use in this function)
   return ((int*)(&__aarch64__))[argc];
                   ^~~~~~~~~~~
/home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:7:19: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [CMakeFiles/cmTC_40cea.dir/build.make:66: CMakeFiles/cmTC_40cea.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/home/pi/flycast/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_40cea/fast] Error 2


File /home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */

int main(int argc, char** argv)
{
  (void)argv;
#ifndef __aarch64__
  return ((int*)(&__aarch64__))[argc];
#else
  (void)argc;
  return 0;
#endif
}
Determining if the _M_ARM64 exist failed with the following output:
Change Dir: /home/pi/flycast/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_cb3d7/fast && /usr/bin/make -f CMakeFiles/cmTC_cb3d7.dir/build.make CMakeFiles/cmTC_cb3d7.dir/build
make[1]: Entering directory '/home/pi/flycast/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_cb3d7.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_cb3d7.dir/CheckSymbolExists.c.o   -c /home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c: In function ‘main’:
/home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:7:19: error: ‘_M_ARM64’ undeclared (first use in this function)
   return ((int*)(&_M_ARM64))[argc];
                   ^~~~~~~~
/home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:7:19: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [CMakeFiles/cmTC_cb3d7.dir/build.make:66: CMakeFiles/cmTC_cb3d7.dir/CheckSymbolExists.c.o] Error 1
make[1]: Leaving directory '/home/pi/flycast/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_cb3d7/fast] Error 2


File /home/pi/flycast/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */

int main(int argc, char** argv)
{
  (void)argv;
#ifndef _M_ARM64
  return ((int*)(&_M_ARM64))[argc];
#else
  (void)argc;
  return 0;
#endif
}
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/pi/flycast/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_4d556/fast && /usr/bin/make -f CMakeFiles/cmTC_4d556.dir/build.make CMakeFiles/cmTC_4d556.dir/build
make[1]: Entering directory '/home/pi/flycast/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_4d556.dir/src.c.o
/usr/bin/cc   -DCMAKE_HAVE_LIBC_PTHREAD   -o CMakeFiles/cmTC_4d556.dir/src.c.o   -c /home/pi/flycast/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_4d556
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4d556.dir/link.txt --verbose=1
/usr/bin/cc  -DCMAKE_HAVE_LIBC_PTHREAD    -rdynamic CMakeFiles/cmTC_4d556.dir/src.c.o  -o cmTC_4d556 
/usr/bin/ld: CMakeFiles/cmTC_4d556.dir/src.c.o: in function `main':
src.c:(.text+0x40): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x4c): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x5c): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_4d556.dir/build.make:87: cmTC_4d556] Error 1
make[1]: Leaving directory '/home/pi/flycast/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_4d556/fast] Error 2


Source file was:
#include <pthread.h>

void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/pi/flycast/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_2f831/fast && /usr/bin/make -f CMakeFiles/cmTC_2f831.dir/build.make CMakeFiles/cmTC_2f831.dir/build
make[1]: Entering directory '/home/pi/flycast/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_2f831.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_2f831.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_2f831
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2f831.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_2f831.dir/CheckFunctionExists.c.o  -o cmTC_2f831  -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_2f831.dir/build.make:87: cmTC_2f831] Error 1
make[1]: Leaving directory '/home/pi/flycast/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_2f831/fast] Error 2





Screenshots

(Replace this line with any issue screenshots)

@BiobaTiry BiobaTiry added the bug Something isn't working label Dec 29, 2024
@flyinghead
Copy link
Owner

These are not build errors. Look at other errors happening earlier, or attach the full log.

@BiobaTiry
Copy link
Author

There is way to get last flycast_libretro.so ?? my compiler on retropie still get same error any time...

rps_2024-12-30_194257.log

@flyinghead
Copy link
Owner

This looks like a compiler bug:

/home/pi/RetroPie-Setup/tmp/build/lr-flycast-flyinghead/core/hw/sh4/sh4_interrupts.cpp:264:1: internal compiler error: in gen_reg_rtx, at emit-rtl.c:1187

Same problem as in #1608

@flyinghead
Copy link
Owner

Have you tried to use a more recent RetroPie version if any is available?

@BiobaTiry
Copy link
Author

I've tried on last version available...
i use a 32bit version of RetroPie, would be the problem?

@flyinghead
Copy link
Owner

Using a 32-bit environment isn't a problem in itself since flycast supports both 32 and 64 bits on ARM.
But using a 64-bit release could help you get around this issue.

@BiobaTiry
Copy link
Author

I will try...thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants