yuzu
yuzu copied to clipboard
Issues compiling with LTO
Is there an existing issue for this?
- [X] I have searched the existing issues
Affected Build(s)
Git Master
Description of Issue
With Clang 16 compiling with thin LTO enabled works but yuzu fails to load:
[ 14.499888] Core.ARM <Critical> core/arm/dynarmic/arm_dynarmic_64.cpp:ExceptionRaised:150: Cannot execute instruction at unmapped address 0x00000000000000
[ 14.499901] Core.ARM <Error> core/arm/arm_interface.cpp:LogBacktrace:82: Backtrace, sp=0000000000000000, pc=0000000000000004
[ 14.499908] Core.ARM <Error> core/arm/arm_interface.cpp:LogBacktrace:84: Module Name Address Original Address Offset Symbol
[ 14.499911] Core.ARM <Error> core/arm/arm_interface.cpp:LogBacktrace:85:
[ 14.659770] Core.ARM <Error> core/arm/arm_interface.cpp:LogBacktrace:90: unknown 0000007100000004 0000000000000004 0000000000000004
[ 14.659785] Core.ARM <Error> core/arm/arm_interface.cpp:LogBacktrace:90: unknown 0000007100000000 0000000000000000 0000000000000000
Compiling with LTO enabled with GCC fails:
FAILED: bin/yuzu-room
: && /usr/bin/g++ -O3 -march=native -pipe -flto=16 -fpermissive -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-flto=16 -fuse-ld=lld src/dedicated_room/CMakeFiles/yuzu-room.dir/yuzu_room.cpp.o -o bin/yuzu-room -Wl,-rpath,/usr/lib/llvm/16/lib64: src/common/libcommon.a src/network/libnetwork.a src/web_service/libweb_service.a -lmbedtls -lmbedcrypto -lmbedx509 -lmbedcrypto -lrt src/network/libnetwork.a src/web_service/libweb_service.a /usr/lib64/libenet.so src/common/libcommon.a /usr/lib64/libboost_context.so.1.82.0 /usr/lib64/libfmt.so.9.1.0 -llz4 /usr/lib64/libzstd.so /usr/lib/llvm/16/lib64/libLLVM-16.so /usr/lib64/libhttplib.so.0.12.4 /usr/lib64/libz.so /usr/lib64/libssl.so /usr/lib64/libcrypto.so -lmbedx509 -lrt && :
ld.lld: error: undefined symbol: main
>>> referenced by /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../lib64/Scrt1.o:(_start)
collect2: error: ld returned 1 exit status
If I set -DYUZU_USE_FASTER_LD=OFF then it compiles successfully and runs but does have the following warnings:
[1316/1318] /usr/bin/g++ -DARCHITECTURE_x86_64=1 -DBOOST_ASIO_DISABLE_CONCEPTS -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DENABLE_WEB_SERVICE -DFMT_SHARED -DHAS_OPENGL -DHAVE_SDL2 -DNDEBUG -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_PROCESS_COMBINED_ARGUMENT_START -DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER -DQT_WIDGETS_LIB -DYUZU_UNIX=1 -DYUZU_USE_QT_MULTIMEDIA -D_FILE_OFFSET_BITS=64 -I/var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999_build/src/yuzu -I/var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/src/yuzu -I/var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999_build/src/yuzu/yuzu_autogen/include -I/var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/src/. -I/usr/include/qt5/QtGui/5.15.9 -I/usr/include/qt5/QtGui/5.15.9/QtGui -I/usr/include/qt5/QtCore/5.15.9 -I/usr/include/qt5/QtCore/5.15.9/QtCore -I/var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/externals/./microprofile -I/var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/externals/glad/include -I/var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/externals/sirit/src/../include -I/var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/externals/./stb -I/var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/externals/xbyak -I/var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/externals/dynarmic/src/dynarmic/.. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-g++ -isystem /usr/include/qt5/QtDBus -isystem /usr/include/qt5/QtMultimedia -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/SDL2 -O3 -march=native -pipe -flto=16 -fpermissive -std=gnu++20 -Wno-attributes -Wno-invalid-offsetof -Wno-unused-parameter -mcx16 -fwrapv -Wno-array-bounds -Wno-stringop-overread -Wno-stringop-overflow -fPIC -Winvalid-pch -include /var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999_build/src/yuzu/CMakeFiles/yuzu.dir/cmake_pch.hxx -MD -MT src/yuzu/CMakeFiles/yuzu.dir/main.cpp.o -MF src/yuzu/CMakeFiles/yuzu.dir/main.cpp.o.d -o src/yuzu/CMakeFiles/yuzu.dir/main.cpp.o -c /var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/src/yuzu/main.cpp
[1317/1318] : && /usr/bin/g++ -O3 -march=native -pipe -flto=16 -fpermissive -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-flto=16 src/yuzu_cmd/CMakeFiles/yuzu-cmd.dir/config.cpp.o src/yuzu_cmd/CMakeFiles/yuzu-cmd.dir/emu_window/emu_window_sdl2.cpp.o src/yuzu_cmd/CMakeFiles/yuzu-cmd.dir/emu_window/emu_window_sdl2_gl.cpp.o src/yuzu_cmd/CMakeFiles/yuzu-cmd.dir/emu_window/emu_window_sdl2_null.cpp.o src/yuzu_cmd/CMakeFiles/yuzu-cmd.dir/emu_window/emu_window_sdl2_vk.cpp.o src/yuzu_cmd/CMakeFiles/yuzu-cmd.dir/yuzu.cpp.o -o bin/yuzu-cmd -Wl,-rpath,/usr/lib/llvm/16/lib64: src/common/libcommon.a src/core/libcore.a src/input_common/libinput_common.a externals/glad/libglad.a -lrt src/core/libcore.a src/audio_core/libaudio_core.a src/video_core/libvideo_core.a src/core/libcore.a src/audio_core/libaudio_core.a src/video_core/libvideo_core.a -lmbedtls -lmbedcrypto -lmbedx509 /usr/lib64/libopus.so src/network/libnetwork.a src/web_service/libweb_service.a src/network/libnetwork.a src/web_service/libweb_service.a /usr/lib64/libenet.so /usr/lib64/libhttplib.so.0.12.4 /usr/lib64/libz.so /usr/lib64/libssl.so /usr/lib64/libcrypto.so /usr/lib64/libcubeb.so.0.0.0 externals/glad/libglad.a -ldl externals/dynarmic/src/dynarmic/libdynarmic.a -lrt externals/dynarmic/externals/zydis/libZydis.a externals/dynarmic/externals/zydis/zycore/libZycore.a externals/dynarmic/externals/mcl/src/libmcl.a src/shader_recompiler/libshader_recompiler.a src/common/libcommon.a /usr/lib64/libboost_context.so.1.82.0 -llz4 /usr/lib64/libzstd.so /usr/lib/llvm/16/lib64/libLLVM-16.so /usr/lib64/libfmt.so.9.1.0 externals/libstb.a /usr/lib64/libavcodec.so /usr/lib64/libavdevice.so /usr/lib64/libavfilter.so /usr/lib64/libavformat.so /usr/lib64/libavutil.so /usr/lib64/libswresample.so /usr/lib64/libswscale.so -lva externals/sirit/src/libsirit.a /usr/lib64/libSDL2.so /usr/lib64/libusb-1.0.so /usr/lib64/libINIReader.so && :
In function ‘copy’,
inlined from ‘_S_copy’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:420:0,
inlined from ‘_S_copy_chars’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:474:0,
inlined from ‘_M_construct’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.tcc:243:0,
inlined from ‘__ct ’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:639:14,
inlined from ‘__ct ’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:631:7,
inlined from ‘ShowNormalKeyboard’ at /var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/src/core/frontend/applets/software_keyboard.cpp:68:21:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/char_traits.h:850: warning: ‘__builtin_memcpy’ reading between 15 and 9223372036854775804 bytes from a region of size 10 [-Wstringop-overread]
850 | (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
|
[1318/1318] : && /usr/bin/g++ -O3 -march=native -pipe -flto=16 -fpermissive -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-flto=16 src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/mocs_compilation.cpp.o src/yuzu/CMakeFiles/yuzu.dir/about_dialog.cpp.o src/yuzu/CMakeFiles/yuzu.dir/applets/qt_amiibo_settings.cpp.o src/yuzu/CMakeFiles/yuzu.dir/applets/qt_controller.cpp.o src/yuzu/CMakeFiles/yuzu.dir/applets/qt_error.cpp.o src/yuzu/CMakeFiles/yuzu.dir/applets/qt_profile_select.cpp.o src/yuzu/CMakeFiles/yuzu.dir/applets/qt_software_keyboard.cpp.o src/yuzu/CMakeFiles/yuzu.dir/applets/qt_web_browser.cpp.o src/yuzu/CMakeFiles/yuzu.dir/bootmanager.cpp.o src/yuzu/CMakeFiles/yuzu.dir/compatibility_list.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/config.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configuration_shared.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_audio.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_camera.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_cpu.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_cpu_debug.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_debug.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_debug_controller.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_debug_tab.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_dialog.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_filesystem.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_general.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_graphics.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_graphics_advanced.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_hotkeys.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_input.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_input_advanced.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_input_per_game.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_input_player.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_input_player_widget.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_input_profile_dialog.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_motion_touch.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_per_game.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_per_game_addons.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_profile_manager.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_ringcon.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_network.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_system.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_tas.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_touch_from_button.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_touchscreen_advanced.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_ui.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_vibration.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/configure_web.cpp.o src/yuzu/CMakeFiles/yuzu.dir/configuration/input_profiles.cpp.o src/yuzu/CMakeFiles/yuzu.dir/debugger/console.cpp.o src/yuzu/CMakeFiles/yuzu.dir/debugger/controller.cpp.o src/yuzu/CMakeFiles/yuzu.dir/debugger/profiler.cpp.o src/yuzu/CMakeFiles/yuzu.dir/debugger/wait_tree.cpp.o src/yuzu/CMakeFiles/yuzu.dir/game_list.cpp.o src/yuzu/CMakeFiles/yuzu.dir/game_list_worker.cpp.o src/yuzu/CMakeFiles/yuzu.dir/hotkeys.cpp.o src/yuzu/CMakeFiles/yuzu.dir/install_dialog.cpp.o src/yuzu/CMakeFiles/yuzu.dir/loading_screen.cpp.o src/yuzu/CMakeFiles/yuzu.dir/main.cpp.o src/yuzu/CMakeFiles/yuzu.dir/multiplayer/chat_room.cpp.o src/yuzu/CMakeFiles/yuzu.dir/multiplayer/client_room.cpp.o src/yuzu/CMakeFiles/yuzu.dir/multiplayer/direct_connect.cpp.o src/yuzu/CMakeFiles/yuzu.dir/multiplayer/host_room.cpp.o src/yuzu/CMakeFiles/yuzu.dir/multiplayer/lobby.cpp.o src/yuzu/CMakeFiles/yuzu.dir/multiplayer/message.cpp.o src/yuzu/CMakeFiles/yuzu.dir/multiplayer/moderation_dialog.cpp.o src/yuzu/CMakeFiles/yuzu.dir/multiplayer/state.cpp.o src/yuzu/CMakeFiles/yuzu.dir/qt_common.cpp.o src/yuzu/CMakeFiles/yuzu.dir/startup_checks.cpp.o src/yuzu/CMakeFiles/yuzu.dir/uisettings.cpp.o src/yuzu/CMakeFiles/yuzu.dir/util/clickable_label.cpp.o src/yuzu/CMakeFiles/yuzu.dir/util/controller_navigation.cpp.o src/yuzu/CMakeFiles/yuzu.dir/util/limitable_input_dialog.cpp.o src/yuzu/CMakeFiles/yuzu.dir/util/overlay_dialog.cpp.o src/yuzu/CMakeFiles/yuzu.dir/util/sequence_dialog/sequence_dialog.cpp.o src/yuzu/CMakeFiles/yuzu.dir/util/url_request_interceptor.cpp.o src/yuzu/CMakeFiles/yuzu.dir/util/util.cpp.o src/yuzu/CMakeFiles/yuzu.dir/compatdb.cpp.o src/yuzu/CMakeFiles/yuzu.dir/qrc_languages.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/EWIEGA46WW/qrc_yuzu.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/IEX2ANJCOF/qrc_compatibility_list.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/JQYOR47KWS/qrc_controller.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/FPLSJTADT4/qrc_overlay.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/JJST62K4FD/qrc_style.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/QWG25RC7ZP/qrc_style.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/4OYJP4GYF3/qrc_style.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/L6763PLDTS/qrc_default.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/FCKMUTAFBG/qrc_style.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/3JV3SOUGRX/qrc_style.cpp.o src/yuzu/CMakeFiles/yuzu.dir/yuzu_autogen/37D3MJFPTG/qrc_style.cpp.o -o bin/yuzu -Wl,-rpath,/usr/lib/llvm/16/lib64: src/common/libcommon.a src/core/libcore.a src/input_common/libinput_common.a src/network/libnetwork.a src/video_core/libvideo_core.a externals/glad/libglad.a /usr/lib64/libQt5Widgets.so.5.15.9 -lrt /usr/lib64/libQt5DBus.so.5.15.9 /usr/lib64/libQt5Multimedia.so.5.15.9 externals/dynarmic/src/dynarmic/libdynarmic.a src/core/libcore.a src/audio_core/libaudio_core.a src/core/libcore.a src/video_core/libvideo_core.a src/audio_core/libaudio_core.a -lmbedtls -lmbedcrypto -lmbedx509 /usr/lib64/libopus.so src/network/libnetwork.a src/web_service/libweb_service.a src/network/libnetwork.a src/web_service/libweb_service.a /usr/lib64/libenet.so /usr/lib64/libhttplib.so.0.12.4 /usr/lib64/libz.so /usr/lib64/libssl.so /usr/lib64/libcrypto.so externals/glad/libglad.a -ldl src/shader_recompiler/libshader_recompiler.a externals/libstb.a /usr/lib64/libavcodec.so /usr/lib64/libavdevice.so /usr/lib64/libavfilter.so /usr/lib64/libavformat.so /usr/lib64/libavutil.so /usr/lib64/libswresample.so /usr/lib64/libswscale.so -lva externals/sirit/src/libsirit.a src/common/libcommon.a /usr/lib64/libboost_context.so.1.82.0 -llz4 /usr/lib64/libzstd.so /usr/lib/llvm/16/lib64/libLLVM-16.so externals/dynarmic/src/dynarmic/libdynarmic.a -lrt externals/dynarmic/externals/zydis/libZydis.a externals/dynarmic/externals/zydis/zycore/libZycore.a externals/dynarmic/externals/mcl/src/libmcl.a /usr/lib64/libfmt.so.9.1.0 /usr/lib64/libcubeb.so.0.0.0 /usr/lib64/libSDL2.so /usr/lib64/libusb-1.0.so /usr/lib64/libQt5Gui.so.5.15.9 /usr/lib64/libQt5Network.so.5.15.9 /usr/lib64/libQt5Core.so.5.15.9 && :
In function ‘copy’,
inlined from ‘_S_copy’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:420:0,
inlined from ‘_S_copy_chars’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:468:0,
inlined from ‘_M_construct’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.tcc:243:0,
inlined from ‘__ct ’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:639:14,
inlined from ‘__ct ’ at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:631:7,
inlined from ‘ShowNormalKeyboard’ at /var/tmp/portage/games-emulation/yuzu-9999/work/yuzu-9999/src/core/frontend/applets/software_keyboard.cpp:68:21:
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/char_traits.h:850: warning: ‘__builtin_memcpy’ reading between 15 and 9223372036854775804 bytes from a region of size 10 [-Wstringop-overread]
850 | (__builtin_memcpy(__s1, __s2, __n * sizeof(char_type))));
|
Lastly I tested with mold, this works with GCC with faster linking times, Clang completes compilation but yuzu startup fails with the same error
Expected Behavior
Yuzu to start
Reproduction Steps
As above
Log File
Included above
System Configuration
CPU: AMD Ryzen 9 5900HX GPU/Driver: AMD 6800M RADV Git RAM: 64GB OS: Linux