flyinghead / flycast

Flycast is a multiplatform Sega Dreamcast, Naomi, Naomi 2 and Atomiswave emulator
GNU General Public License v2.0
1.41k stars 170 forks source link

No rule to make target - libbreakpad_client #739

Closed biggestsonicfan closed 1 month ago

biggestsonicfan commented 2 years ago

Platform / OS / Hardware: PC / Linux (OpenSUSE TW) / AMD cpu NVIDIA gpu

Github hash: aa97a6d64fb47d3ce0febaa575b26d975dd916e4

Hardware: Disk: 20T / 32T (63%) PU: AMD Ryzen 7 3800X 8-Core @ 16x 4.56GHz GPU: NVIDIA GeForce GTX 1080 RAM: 9821MiB / 31997MiB

Description of the Issue

Trying to make standalone flycast fails when attempting to make libreakpad_client.

[ 98%] Building CXX object CMakeFiles/flycast.dir/core/deps/ggpo/lib/ggpo/backends/spectator.cpp.o
[ 98%] Building CXX object CMakeFiles/flycast.dir/core/deps/ggpo/lib/ggpo/backends/synctest.cpp.o
[ 98%] Building CXX object CMakeFiles/flycast.dir/core/deps/ggpo/lib/ggpo/network/udp_proto.cpp.o
[ 98%] Building CXX object CMakeFiles/flycast.dir/core/deps/ggpo/lib/ggpo/network/udp.cpp.o
[100%] Building CXX object CMakeFiles/flycast.dir/core/linux-dist/main.cpp.o
make[2]: *** No rule to make target 'core/deps/breakpad/lib/libbreakpad_client.a', needed by 'flycast'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:388: CMakeFiles/flycast.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

EDIT: The above was done with the following instructions:

git submodule update --init --recursive
mkdir build
cd build
cmake ..
make

Doing the following with cmake

cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=artifact -G Ninja
cmake --build build --config Release --target install

results in the following:

/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: cannot find core/deps/breakpad/lib/libbreakpad_client.a: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

EDIT2: Manually following the "getting started from main" section and using fetch breakpad (this may break things because I don't think this is your intended use) and ./configure && make creates a libbreakpad_client.a in the flycast/core/deps/breakpad/src/client/ folder. Copying and pasting this after the build fails into the flycast/build/core/deps/breakpad/lib/ seems to create a useable build. I have my doubts that any breakpad functionality work work, however.

biggestsonicfan commented 1 year ago

Redid my OS with a fresh install. Still getting this error. Gonna investigate a little harder for a real fix.

flyinghead commented 1 year ago

I suppose this has to do with building on OpenSUSE vs ubuntu. (Flycast is developed and built on ubuntu only)

Now breakpad is only useful when distributing binaries (and keeping symbols for each) so that dump files can be analyzed. So if you just plan to run locally and breakpad gets in the way, you can get rid of it.

biggestsonicfan commented 1 year ago

While that is true, I don't think I've ever run into this prior to filing this issue. Always compiling on OpenSUSE. I'm looking though my make log with debug output and it looks like it touches libbreakpad_client.a several times. I've also built it (edit in first post) when integrating Google's own libbreakpad_client.a so even if the breakpad functionality doesn't work, I still want to address the issue of why it's failing in the first place, lol.

biggestsonicfan commented 1 year ago

Now breakpad is only useful when distributing binaries (and keeping symbols for each) so that dump files can be analyzed. So if you just plan to run locally and breakpad gets in the way, you can get rid of it.

Is there a flag to tell cmake not to use it?

vkedwardli commented 1 year ago

There's only a flag to disable Apple's breakpad, if you want to disable it, you need to edit CMakeLists.txt manually

But depends on if you want to help debugging the breakpad in OpenSUSE; Or you want to suggest that we should disable breakpad by default using a flag, and only enable it when using our build system, so that the end-user who prefer to compile themselves won't face this issue

biggestsonicfan commented 1 year ago

Can't we do both, debug why it's not compiling in OpenSUSE and suggest a flag to disable breakpad in local builds? :thinking:

ioamero commented 1 year ago

-DCMAKE_CXX_COMPILER_TARGET=x86_64-pc-linux-gnu or your specific target

core/deps/breakpad/CMakeLists.txt line 24... comment out line 26 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")

assuming c and c++ targets are the same

this one >>>>> #set(BREAKPAD_TARGET --target=${CMAKE_CXX_COMPILER_TARGET}) <<<<< endif()

biggestsonicfan commented 1 year ago

-DCMAKE_CXX_COMPILER_TARGET=x86_64-pc-linux-gnu or your specific target

Added: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_TARGET=x86_64-pc-linux-gnu -DCMAKE_INSTALL_PREFIX=artifact -G Ninja

core/deps/breakpad/CMakeLists.txt line 24... comment out line 26 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # assuming c and c++ targets are the same this one >>>>> #set(BREAKPAD_TARGET --target=${CMAKE_CXX_COMPILER_TARGET}) <<<<< endif()

Still results in the same error for me.

ioamero commented 1 year ago

try removing ~/.ccache folder content. My problem was solved with that. This problem only occurs with clang.

this is in line 29 trying changing the --host to --host=x86_64-pc-linux-gnu remember that this is my target not your. Also remove the ${BREAKPAD_TARGET}.

set(BREAKPAD_CONFIG_CMD ${CMAKE_CURRENT_SOURCE_DIR}/configure --host=${BREAKPAD_HOST} CC=${CMAKE_C_COMPILER} "CFLAGS=${CMAKE_C_FLAGS} ${BREAKPAD_TARGET}" CXX=${CMAKE_CXX_COMPILER} "CXXFLAGS=${CMAKE_CXX_FLAGS} ${BREAKPAD_TARGET}" AR=${CMAKE_AR})

On Sat, Jan 7, 2023 at 5:22 AM biggestsonicfan @.***> wrote:

-DCMAKE_CXX_COMPILER_TARGET=x86_64-pc-linux-gnu or your specific target

Added: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_TARGET=x86_64-pc-linux-gnu -DCMAKE_INSTALL_PREFIX=artifact -G Ninja

core/deps/breakpad/CMakeLists.txt line 24... comment out line 26 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # assuming c and c++ targets are the same this one >>>>> #set(BREAKPAD_TARGET --target=${CMAKE_CXX_COMPILER_TARGET}) <<<<< endif()

Still results in the same error for me.

— Reply to this email directly, view it on GitHub https://github.com/flyinghead/flycast/issues/739#issuecomment-1374445668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEXTCDFLMALTCG756G6NPN3WRFGXPANCNFSM6AAAAAAQI7QDYU . You are receiving this because you commented.Message ID: @.***>

cinnamonmatexfce commented 1 month ago

Here's my workaround on openSUSE Leap 15.6:

Here's the result:

:~> grep -A1 --color=none '"Linux"' CMakeLists.txt
        if((ANDROID AND NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") OR (MINGW AND SH_EXECUTABLE) OR (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux"))
                add_subdirectory(core/deps/breakpad)
ioamero commented 1 month ago

This issue is related to how clang is built.

cinnamonmatexfce commented 1 month ago

This issue is related to how clang is built.

That's also happening with GCC (at least here with openSUSE Leap 15.6):

:~> printenv | grep -E 'CC|CXX|LD'
CC=/usr/bin/gcc-13
CXX=/usr/bin/g++-13
LD=/usr/bin/gcc-13

Here's the command I ran:

:~> cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_SYSTEM_NAME=Linux -Wno-dev
ioamero commented 1 month ago

Flycast flyinghead

cmake -Wno-dev -DXXHASH_BUILD_XXHSUM=ON -DENABLE_RTTI=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/emulators -DCMAKE_CXX_COMPILER_TARGET=x86_64-pc-linux-gnu

flyinghead commented 1 month ago

Fixed on master: the USE_BREAKPAD cmake option can be used to disable building and linking with breakpad.

biggestsonicfan commented 1 month ago

I'm no longer using SUSE as my daily driver, but I believe this is a good resolution to the issue. Closing for now until anyone else reports otherwise.

cinnamonmatexfce commented 1 month ago

Fixed on master: the USE_BREAKPAD cmake option can be used to disable building and linking with breakpad.

-DUSE_BREAKPAD=0 works like a charm!!

Thanks 😉