Project

General

Profile

Actions

Emulator Issues #12409

closed

Dolphin emulator fails to build with GCC 11

Added by mystro256 over 3 years ago. Updated about 3 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Current
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
Yes
Regression start:
Fixed in:
5.0-13669

Description

I've trimmed out any non-applicable templates from the description.

MD5 Hash? (right click the game in the game list, Properties, Verify tab, Verify Integrity button)

I most recently tried building a34823df61df65168aa40ef5e82e44defd4a0138, but I've also tested the latest commit about a month ago, and I don't see any related commits to GCC 11 since then.

What's the problem? Describe what went wrong.

When attempting to build dolphin with GCC 11, I used Fedora 34, it seems to fail with this error:

In file included from /usr/include/stdio.h:33,
from /usr/include/c++/11/cstdio:42,
from /usr/include/c++/11/ext/string_conversions.h:43,
from /usr/include/c++/11/bits/basic_string.h:6595,
from /usr/include/c++/11/string:55,
from /builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Common/CommonFuncs.h:8,
from /builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Common/Assert.h:8,
from /builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Common/x64Emitter.h:15,
from /builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.h:9,
from /builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:5:
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp: In function 'Gen::OpArg DSP::JIT::x64::GetRegisterPointer(size_t)':
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:34:66: error: 'reg' is not a constant expression
34 | return MDisp(R15, static_cast(offsetof(SDSP, r.ar[reg - DSP_REG_AR0])));
| ^~~~~~~~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:39:66: error: 'reg' is not a constant expression
39 | return MDisp(R15, static_cast(offsetof(SDSP, r.ix[reg - DSP_REG_IX0])));
| ^~~~~~~~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:44:66: error: 'reg' is not a constant expression
44 | return MDisp(R15, static_cast(offsetof(SDSP, r.wr[reg - DSP_REG_WR0])));
| ^~~~~~~~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:49:66: error: 'reg' is not a constant expression
49 | return MDisp(R15, static_cast(offsetof(SDSP, r.st[reg - DSP_REG_ST0])));
| ^~~~~~~~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:52:66: error: 'reg' is not a constant expression
52 | return MDisp(R15, static_cast(offsetof(SDSP, r.ac[reg - DSP_REG_ACH0].h)));
| ^~~~~~~~~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:67:66: error: 'reg' is not a constant expression
67 | return MDisp(R15, static_cast(offsetof(SDSP, r.ax[reg - DSP_REG_AXL0].l)));
| ^~~~~~~~~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:70:66: error: 'reg' is not a constant expression
70 | return MDisp(R15, static_cast(offsetof(SDSP, r.ax[reg - DSP_REG_AXH0].h)));
| ^~~~~~~~~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:73:66: error: 'reg' is not a constant expression
73 | return MDisp(R15, static_cast(offsetof(SDSP, r.ac[reg - DSP_REG_ACL0].l)));
| ^~~~~~~~~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:76:66: error: 'reg' is not a constant expression
76 | return MDisp(R15, static_cast(offsetof(SDSP, r.ac[reg - DSP_REG_ACM0].m)));
| ^~~~~~~~~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:79:66: error: 'reg' is not a constant expression
79 | return MDisp(R15, static_cast(offsetof(SDSP, r.ax[reg - DSP_REG_AX0_32].val)));
| ^~~~~~~~~~~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp:82:66: error: 'reg' is not a constant expression
82 | return MDisp(R15, static_cast(offsetof(SDSP, r.ac[reg - DSP_REG_ACC0_64].val)));
| ^~~~~~~~~~~~~~~
gmake[2]: *** [Source/Core/Core/CMakeFiles/core.dir/build.make:3257: Source/Core/Core/CMakeFiles/core.dir/DSP/Jit/x64/DSPJitRegCache.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /usr/include/stdio.h:33,
from /usr/include/c++/11/cstdio:42,
from /usr/include/c++/11/ext/string_conversions.h:43,
from /usr/include/c++/11/bits/basic_string.h:6595,
from /usr/include/c++/11/string:55,
from /builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Common/CommonFuncs.h:8,
from /builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Common/Assert.h:8,
from /builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Common/x64Emitter.h:15,
from /builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPEmitter.h:14,
from /builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp:5:
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp: In member function 'Gen::OpArg DSP::JIT::x64::DSPEmitter::M_SDSP_r_st(size_t)':
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp:478:58: error: 'index' is not a constant expression
478 | return MDisp(R15, static_cast(offsetof(SDSP, r.st[index])));
| ^~~~~
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp: In member function 'Gen::OpArg DSP::JIT::x64::DSPEmitter::M_SDSP_reg_stack_ptrs(size_t)':
/builddir/build/BUILD/dolphin-31524288e3b2450eaefff8202c6d26c4ba3f7333/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp:483:68: error: 'index' is not a constant expression
483 | return MDisp(R15, static_cast(offsetof(SDSP, reg_stack_ptrs[index])));
| ^~~~~

What steps will reproduce the problem?

Try to build dolphin using gcc 11. I've also used binutils 2.35, and glibc 2.33 if this affects anything.

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

I believe so, but I don't see any reason why the failure would have already been fixed. It looks like a conflict of constants in x86 jit, which appears to still exist.

Is the issue present in the latest stable version?

Yes

If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

Not a regression

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

Please let me know if you need a full log, but the above should be enough to get the jist.


Files

dolphin-emu-gcc11.patch (1.2 KB) dolphin-emu-gcc11.patch mystro256, 02/09/2021 05:51 PM
Actions

Also available in: Atom PDF