libretro / dolphin

Dolphin is a GameCube / Wii emulator, allowing you to play games for these two platforms on PC with improvements.
https://dolphin-emu.org/
GNU General Public License v2.0
85 stars 67 forks source link

build failure with gcc14 : PPCDebugInterface.cpp:196:8: error: ‘reverse’ is not a member of ‘std’ #328

Open jeandestouches opened 4 months ago

jeandestouches commented 4 months ago

Hello, Build failure with gcc14 on my gentoo system. (No issues with gcc12)

Log:

FAILED: Source/Core/Core/CMakeFiles/core.dir/Debugger/PPCDebugInterface.cpp.o /usr/bin/x86_64-pc-linux-gnu-g++ -DDATA_DIR=\"/usr/share/dolphin-emu/\" -DFMT_SHARED -DHAVE_EGL=1 -DHAVE_HIDAPI=1 -DHAVE_LIBEVDEV=1 -DHAVE_LIBUDEV=1 -DHAVE_X11=1 -DHAVE_XRANDR=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86=1 -D_M_X86_64=1 -DLIBRETRO -DLIBUSB -DSTDC_CONSTANT_MACROS -DSTDC_LIMIT_MACROS -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/curl/include -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/External/minizip -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/soundtouch -I/usr/include/libusb-1.0 -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/picojson -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999_build/Source/Core -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/minizip/. -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/Bochs_disasm -isystem /usr/include/hidapi -march=bdver2 -O2 -pipe -std=c++17 -msse2 -fdiagnostics-color -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Wmissing-declarations -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -fpic -MD -MT Source/Core/Core/CMakeFiles/core.dir/Debugger/PPCDebugInterface.cpp.o -MF Source/Core/Core/CMakeFiles/core.dir/Debugger/PPCDebugInterface.cpp.o.d -o Source/Core/Core/CMakeFiles/core.dir/Debugger/PPCDebugInterface.cpp.o -c /var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core/Core/Debugger/PPCDebugInterface.cpp /var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core/Core/Debugger/PPCDebugInterface.cpp: In member function ‘virtual Common::Debug::Threads PPCDebugInterface::GetThreads() const’: /var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core/Core/Debugger/PPCDebugInterface.cpp:196:8: error: ‘reverse’ is not a member of ‘std’ 196 | std::reverse(threads.begin(), threads.end()); | ^~~ [335/776] /usr/bin/x86_64-pc-linux-gnu-g++ -DDATA_DIR=\"/usr/share/dolphin-emu/\" -DFMT_SHARED -DHAVE_EGL=1 -DHAVE_HIDAPI=1 -DHAVE_LIBEVDEV=1 -DHAVE_LIBUDEV=1 -DHAVE_X11=1 -DHAVE_XRANDR=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86=1 -D_M_X86_64=1 -DLIBRETRO -DLIBUSB -DSTDC_CONSTANT_MACROS -DSTDC_LIMIT_MACROS -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/curl/include -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/External/minizip -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/soundtouch -I/usr/include/libusb-1.0 -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/picojson -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999_build/Source/Core -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/minizip/. -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/Bochs_disasm -isystem /usr/include/hidapi -march=bdver2 -O2 -pipe -std=c++17 -msse2 -fdiagnostics-color -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Wmissing-declarations -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -fpic -MD -MT Source/Core/Core/CMakeFiles/core.dir/DSP/DSPCaptureLogger.cpp.o -MF Source/Core/Core/CMakeFiles/core.dir/DSP/DSPCaptureLogger.cpp.o.d -o Source/Core/Core/CMakeFiles/core.dir/DSP/DSPCaptureLogger.cpp.o -c /var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core/Core/DSP/DSPCaptureLogger.cpp [336/776] /usr/bin/x86_64-pc-linux-gnu-g++ -DDATA_DIR=\"/usr/share/dolphin-emu/\" -DFMT_SHARED -DHAVE_EGL=1 -DHAVE_HIDAPI=1 -DHAVE_LIBEVDEV=1 -DHAVE_LIBUDEV=1 -DHAVE_X11=1 -DHAVE_XRANDR=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86=1 -D_M_X86_64=1 -DLIBRETRO -DLIBUSB -DSTDC_CONSTANT_MACROS -DSTDC_LIMIT_MACROS -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/curl/include -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/External/minizip -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/soundtouch -I/usr/include/libusb-1.0 -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/picojson -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999_build/Source/Core -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/minizip/. -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/Bochs_disasm -isystem /usr/include/hidapi -march=bdver2 -O2 -pipe -std=c++17 -msse2 -fdiagnostics-color -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Wmissing-declarations -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -fpic -MD -MT Source/Core/Core/CMakeFiles/core.dir/Debugger/RSO.cpp.o -MF Source/Core/Core/CMakeFiles/core.dir/Debugger/RSO.cpp.o.d -o Source/Core/Core/CMakeFiles/core.dir/Debugger/RSO.cpp.o -c /var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core/Core/Debugger/RSO.cpp [337/776] /usr/bin/x86_64-pc-linux-gnu-g++ -DDATA_DIR=\"/usr/share/dolphin-emu/\" -DFMT_SHARED -DHAVE_EGL=1 -DHAVE_HIDAPI=1 -DHAVE_LIBEVDEV=1 -DHAVE_LIBUDEV=1 -DHAVE_X11=1 -DHAVE_XRANDR=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86=1 -D_M_X86_64=1 -DLIBRETRO -DLIBUSB -DSTDC_CONSTANT_MACROS -DSTDC_LIMIT_MACROS -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/curl/include -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/External/minizip -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/soundtouch -I/usr/include/libusb-1.0 -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/picojson -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999_build/Source/Core -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/minizip/. -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/Bochs_disasm -isystem /usr/include/hidapi -march=bdver2 -O2 -pipe -std=c++17 -msse2 -fdiagnostics-color -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Wmissing-declarations -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -fpic -MD -MT Source/Core/Core/CMakeFiles/core.dir/DSP/DSPCodeUtil.cpp.o -MF Source/Core/Core/CMakeFiles/core.dir/DSP/DSPCodeUtil.cpp.o.d -o Source/Core/Core/CMakeFiles/core.dir/DSP/DSPCodeUtil.cpp.o -c /var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core/Core/DSP/DSPCodeUtil.cpp [338/776] /usr/bin/x86_64-pc-linux-gnu-g++ -DDATA_DIR=\"/usr/share/dolphin-emu/\" -DFMT_SHARED -DHAVE_EGL=1 -DHAVE_HIDAPI=1 -DHAVE_LIBEVDEV=1 -DHAVE_LIBUDEV=1 -DHAVE_X11=1 -DHAVE_XRANDR=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86=1 -D_M_X86_64=1 -DLIBRETRO -DLIBUSB -DSTDC_CONSTANT_MACROS -DSTDC_LIMIT_MACROS -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/curl/include -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/External/minizip -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/soundtouch -I/usr/include/libusb-1.0 -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/picojson -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999_build/Source/Core -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/minizip/. -I/var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Externals/Bochs_disasm -isystem /usr/include/hidapi -march=bdver2 -O2 -pipe -std=c++17 -msse2 -fdiagnostics-color -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wlogical-op -Wshadow -Winit-self -Wmissing-declarations -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -fpic -MD -MT Source/Core/Core/CMakeFiles/core.dir/DSP/DSPAssembler.cpp.o -MF Source/Core/Core/CMakeFiles/core.dir/DSP/DSPAssembler.cpp.o.d -o Source/Core/Core/CMakeFiles/core.dir/DSP/DSPAssembler.cpp.o -c /var/tmp/portage/games-emulation/libretro-dolphin-9999-r2/work/libretro-dolphin-9999/Source/Core/Core/DSP/DSPAssembler.cpp ninja: build stopped: subcommand failed.

Shoegzer commented 2 months ago

Encountered here too, using gcc-14 on linux Mint 22. No issues with gcc-13.

@hunterk any thoughts on this? You usually have a good handle on the cause of these kinds of issues.

hizzlekizzle commented 2 months ago

from Porting to GCC-14 doc:

C++ language issues Header dependency changes

Some C++ Standard Library headers have been changed to no longer include other headers that were being used internally by the library. As such, C++ programs that used standard library components without including the right headers will no longer compile.

The following headers are used less widely in libstdc++ and may need to be included explicitly when compiling with GCC 14:

<algorithm> (for std::copy_n, std::find_if, std::lower_bound, std::remove, std::reverse, std::sort etc.)
<cstdint> (for std::int8_t, std::int32_t etc.)

So, looks like it needs to be explicitly included now.