protonscr

Compile issues with GCC 13 / mingw-11 Toolchain

dxvkclosed
doitsujin/dxvk#3399 · opened 2023-05-06 by ms178 · updated 2023-05-12 · 5 comments · github
1 matching comments, n / p to jump
Mms178 2023-05-06 github

Compiling dxvk (b08665c8082f44f6243d00351896edab6c41eb6e) via the proton-cachyos PKGBUILD with GCC 13.1.1 and the corresponding new mingw-11 toolchain (which is not yet released on Arch) reveals the following build issues:

[71/288] i686-w64-mingw32-g++ -Isrc/util/libutil.a.p -Isrc/util -I../src-dxvk/src/util -I../src-dxvk/include -I.. /src-dxvk/include/vulkan/include -I../src-dxvk/include/spirv/include -I/tmp/makepkg/proton-cachyos/src/build/dst-glslang32/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -msse -msse2 -g0 -O3 -march=native -mtune=native -maes -fno-semantic-interposition -falign-functions=32 - fipa-pta -flive-range-shrinkage -fno-math-errno -fno-trapping-math -mtls-dialect=gnu2 -feliminate-unused-debug-types -floop-nest-optimize -fgraphite-identity -fcf-protection= none -pipe -fdevirtualize-at-ltrans -mharden-sls=none -funroll-loops -malign-data=cacheline -fomit-frame-pointer -std=gnu18 -mfpmath=both -fwrapv -fno-strict-aliasing -ffile- prefix-map=/tmp/makepkg/proton-cachyos/src/build/src-dxvk=. -mstackrealign -mno-avx -std=c++17 -MD -MQ src/util/libutil.a.p/util_matrix.cpp.obj -MF src/util/libutil.a.p/util_matrix.cpp.obj.d -o src /util/libutil.a.p/util_matrix.cpp.obj -c ../src-dxvk/src/util/util_matrix.cpp
FAILED: src/util/libutil.a.p/util_matrix.cpp.obj
i686-w64-mingw32-g++ -Isrc/util/libutil.a.p -Isrc/util -I../src-dxvk/src/util -I../src-dxvk/include -I../src-dxvk/ include/vulkan/include -I../src-dxvk/include/spirv/include -I/tmp/makepkg/proton-cachyos/src/build/dst-glslang32/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 - Wall -Winvalid-pch -Wextra -std=c++17 -msse -msse2 -g0 -O3 -march=native -mtune=native -maes -fno-semantic-interposition -falign-functions=32 -fipa-pta -flive -range-shrinkage -fno-math-errno -fno-trapping-math -mtls-dialect=gnu2 -feliminate-unused-debug-types -floop-nest-optimize -fgraphite-identity -fcf-protection=none -pipe -fdevirtualize -at-ltrans -mharden-sls=none -funroll-loops -malign-data=cacheline -fomit-frame-pointer -std=gnu18 -mfpmath=both -fwrapv -fno-strict-aliasing -ffile-prefix-map=/ tmp/makepkg/proton-cachyos/src/build/src-dxvk=. -mstackrealign -mno-avx -std=c++17 -MD -MQ src/util/libutil.a.p/util_matrix.cpp.obj -MF src/util/libutil.a.p/util_matrix.cpp.obj.d -o src /util/libutil.a.p/util_matrix.cpp.obj -c ../src-dxvk/src/util/util_matrix.cpp
In file included from ../src-dxvk/src/util/util_vector.h:5,
                  from ../src-dxvk/src/util/util_matrix.h:3,
                  from ../src-dxvk/src/util/util_matrix.cpp:1:
../src-dxvk/src/util/util_bit.h:50:22: error: 'uint32_t' was not declared
    50 | T extract(T value, uint32_t fst, uint32_t lst) {
       | ^~~~~~~~
../src-dxvk/src/util/util_bit.h:50:36: error: 'uint32_t' was not declared
    50 | T extract(T value, uint32_t fst, uint32_t lst) {
       | ^~~~~~~~
../src-dxvk/src/util/util_bit.h:54:10: error: 'uint32_t' does not denote a type
    54 | inline uint32_t popcntStep(uint32_t n, uint32_t mask, uint32_t shift) {
       | ^~~~~~~~
../src-dxvk/src/util/util_bit.h:36:1: Note: uint32_t is defined in header <cstdint>; did you forget to write "#include <cstdint>"?
    35 | #include <vector>
   +++ |+#include <cstdint>
    36 |
../src-dxvk/src/util/util_bit.h:58:10: error: 'uint32_t' does not denote a type
    58 | inline uint32_t popcnt(uint32_t n) {
       | ^~~~~~~~
../src-dxvk/src/util/util_bit.h:58:10: Note: "uint32_t" is defined in the "<cstdint>" header; did you forget to write "#include <cstdint>"?
../src-dxvk/src/util/util_bit.h:67:10: error: 'uint32_t' does not denote a type
    67 | inline uint32_t tzcnt(uint32_t n) {
       | ^~~~~~~~
../src-dxvk/src/util/util_bit.h:67:10: Note: "uint32_t" is defined in the "<cstdint>" header; did you forget to write "#include <cstdint>"?
../src-dxvk/src/util/util_bit.h:103:10: error: 'uint32_t' does not denote a type
   103 | inline uint32_t tzcnt(uint64_t n) {
       | ^~~~~~~~
../src-dxvk/src/util/util_bit.h:103:10: Note: "uint32_t" is defined in the "<cstdint>" header; did you forget to write "#include <cstdint>"?
../src-dxvk/src/util/util_bit.h:133:10: error: 'uint32_t' does not denote a type
   133 | inline uint32_t lzcnt(uint32_t n) {
       | ^~~~~~~~
../src-dxvk/src/util/util_bit.h:133:10: Note: "uint32_t" is defined in the "<cstdint>" header; did you forget to write "#include <cstdint>"?
../src-dxvk/src/util/util_bit.h:154:3: error: 'uint32_t' does not denote a type
   154 | uint32_t pack(T& dst, uint32_t& shift, T src, uint32_t count) {
       | ^~~~~~~~
../src-dxvk/src/util/util_bit.h:154:3: Note: "uint32_t" is defined in the "<cstdint>" header; did you forget to write "#include <cstdint>"?
../src-dxvk/src/util/util_bit.h:163:3: error: 'uint32_t' does not denote a type
   163 | uint32_t unpack(T& dst, T src, uint32_t& shift, uint32_t count) {
       | ^~~~~~~~
../src-dxvk/src/util/util_bit.h:163:3: Note: »uint

also:

[81/288] i686-w64-mingw32-g++ -Isrc/vulkan/libvkcommon.a.p -Isrc/vulkan -I../src-dxvk/src/vulkan -I../src-dxvk/include -I.. /src-dxvk/include/vulkan/include -I../src-dxvk/include/spirv/include -I/tmp/makepkg/proton-cachyos/src/build/dst-glslang32/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c++17 -msse -msse2 -g0 -O3 -march=native -mtune=native -maes -fno-semantic-interposition -falign-functions=32 - fipa-pta -flive-range-shrinkage -fno-math-errno -fno-trapping-math -mtls-dialect=gnu2 -feliminate-unused-debug-types -floop-nest-optimize -fgraphite-identity -fcf-protection= none -pipe -fdevirtualize-at-ltrans -mharden-sls=none -funroll-loops -malign-data=cacheline -fomit-frame-pointer -std=gnu18 -mfpmath=both -fwrapv -fno-strict-aliasing -ffile- prefix-map=/tmp/makepkg/proton-cachyos/src/build/src-dxvk=. -mstackrealign -mno-avx -std=c++17 -pthread -MD -MQ src/vulkan/libvkcommon.a.p/vulkan_presenter.cpp.obj -MF src/vulkan/libvkcommon.a.p/vulkan_presenter.cpp.obj.d - o src/vulkan/libvkcommon.a.p/vulkan_presenter.cpp.obj -c ../src-dxvk/src/vulkan/vulkan_presenter.cpp
FAILED: src/vulkan/libvkcommon.a.p/vulkan_presenter.cpp.obj
i686-w64-mingw32-g++ -Isrc/vulkan/libvkcommon.a.p -Isrc/vulkan -I../src-dxvk/src/vulkan -I../src-dxvk/include -I../src-dxvk/ include/vulkan/include -I../src-dxvk/include/spirv/include -I/tmp/makepkg/proton-cachyos/src/build/dst-glslang32/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 - Wall -Winvalid-pch -Wextra -std=c++17 -msse -msse2 -g0 -O3 -march=native -mtune=native -maes -fno-semantic-interposition -falign-functions=32 -fipa-pta -flive -range-shrinkage -fno-math-errno -fno-trapping-math -mtls-dialect=gnu2 -feliminate-unused-debug-types -floop-nest-optimize -fgraphite-identity -fcf-protection=none -pipe -fdevirtualize -at-ltrans -mharden-sls=none -funroll-loops -malign-data=cacheline -fomit-frame-pointer -std=gnu18 -mfpmath=both -fwrapv -fno-strict-aliasing -ffile-prefix-map=/ tmp/makepkg/proton-cachyos/src/build/src-dxvk=. -mstackrealign -mno-avx -std=c++17 -pthread -MD -MQ src/vulkan/libvkcommon.a.p/vulkan_presenter.cpp.obj -MF src/vulkan/libvkcommon.a.p/vulkan_presenter.cpp.obj.d - o src/vulkan/libvkcommon.a.p/vulkan_presenter.cpp.obj -c ../src-dxvk/src/vulkan/vulkan_presenter.cpp
In file included by ../src-dxvk/src/vulkan/../dxvk/dxvk_include.h:4,
                  from ../src-dxvk/src/vulkan/../dxvk/dxvk_format.h:3,
                  from ../src-dxvk/src/vulkan/vulkan_presenter.cpp:3:
../src-dxvk/src/vulkan/../dxvk/../util/log/log_debug.h: In the void dxvk::debug::traceArgs(std::stringstream&) function:
../src-dxvk/src/vulkan/../dxvk/../util/log/log_debug.h:27:44: warning: unused parameter 'stream' [-Wunused-parameter]
    27 | inline void traceArgs(std::stringstream& stream) { }
       | ~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from ../src-dxvk/src/vulkan/vulkan_presenter.cpp:5:
../src-dxvk/src/vulkan/../wsi/wsi_window.h: In the global scope:
../src-dxvk/src/vulkan/../wsi/wsi_window.h:34:11: error: 'DxvkWindowState' was not declared
    34 | DxvkWindowState* pState,
       | ^~~~~~~~~~~~~~~
../src-dxvk/src/vulkan/../wsi/wsi_window.h:63:11: error: 'DxvkWindowState' was not declared
    63 | DxvkWindowState* pState,
       | ^~~~~~~~~~~~~~~
../src-dxvk/src/vulkan/../wsi/wsi_window.h:76:11: error: 'DxvkWindowState' was not declared
    76 | DxvkWindowState* pState,
       | ^~~~~~~~~~~~~~~

There might be more lurking underneath. This is on the latest CachyOS with gcc-Version 13.1.1 20230505 (GCC). Another CachyOS user who used the older GCC 12.2 mingw-toolchain had no problems compiling that package though. I guess a breaking change in behavior in GCC 13 could be the culprit here (or the older dxvk revision used in that package).

Ppchome 2023-05-06 github

https://gcc.gnu.org/gcc-13/porting_to.html

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 13:

  • <string> (for std::string, std::to_string, std::stoi etc.)
  • <system_error> (for std::error_code, std::error_category, std::system_error).
  • <cstdint> (for std::int8_t, std::int32_t etc.)
  • <cstdio> (for std::printf, std::fopen etc.)
  • <cstdlib> (for std::strtol, std::malloc etc.)
Mms178 2023-05-06 github

I should add that I cannot replicate these issues when using my standalone dxvk-mingw-git PKGBUILD which uses more aggressive compiler flags and a different set of c/cxx-std-flags.

However, I see a different issue there with only the 32-bit build when using LTO (the 64-bit build is fine) which I haven't seen before with the older mingw-toolchain and the same flags:

[285/288] Linking target src/d3d11/d3d11.dll
FAILED: src/d3d11/d3d11.dll
i686-w64-mingw32-g++ -o src/d3d11/d3d11.dll src/d3d11/d3d11.dll.p/version.o src/d3d11/d3d11.dll.p/.._dxgi_dxgi_format.cpp.obj src/d3d11/ d3d11.dll.p/d3d11_annotation.cpp.obj src/d3d11/d3d11.dll.p/d3d11_blend.cpp.obj src/d3d11/d3d11.dll.p/d3d11_buffer.cpp.obj src/d3d11/d3d11.dll.p /d3d11_class_linkage.cpp.obj src/d3d11/d3d11.dll.p/d3d11_cmdlist.cpp.obj src/d3d11/d3d11.dll.p/d3d11_context.cpp.obj src/d3d11/d3d11.dll.p/d3d11_context_def.cpp. obj src/d3d11/d3d11.dll.p/d3d11_context_ext.cpp.obj src/d3d11/d3d11.dll.p/d3d11_context_imm.cpp.obj src/d3d11/d3d11.dll.p/d3d11_cuda.cpp.obj src/d3d11/ d3d11.dll.p/d3d11_depth_stencil.cpp.obj src/d3d11/d3d11.dll.p/d3d11_device.cpp.obj src/d3d11/d3d11.dll.p/d3d11_enums.cpp.obj src/d3d11/d3d11.dll.p /d3d11_features.cpp.obj src/d3d11/d3d11.dll.p/d3d11_fence.cpp.obj src/d3d11/d3d11.dll.p/d3d11_gdi.cpp.obj src/d3d11/d3d11.dll.p/d3d11_initializer.cpp. obj src/d3d11/d3d11.dll.p/d3d11_input_layout.cpp.obj src/d3d11/d3d11.dll.p/d3d11_interop.cpp.obj src/d3d11/d3d11.dll.p/d3d11_main.cpp.obj src/d3d11/ d3d11.dll.p/d3d11_on_12.cpp.obj src/d3d11/d3d11.dll.p/d3d11_options.cpp.obj src/d3d11/d3d11.dll.p/d3d11_query.cpp.obj src/d3d11/d3d11.dll.p /d3d11_rasterizer.cpp.obj src/d3d11/d3d11.dll.p/d3d11_resource.cpp.obj src/d3d11/d3d11.dll.p/d3d11_sampler.cpp.obj src/d3d11/d3d11.dll.p/d3d11_shader.cpp. obj src/d3d11/d3d11.dll.p/d3d11_state.cpp.obj src/d3d11/d3d11.dll.p/d3d11_state_object.cpp.obj src/d3d11/d3d11.dll.p/d3d11_swapchain.cpp.obj src/d3d11/ d3d11.dll.p/d3d11_texture.cpp.obj src/d3d11/d3d11.dll.p/d3d11_util.cpp.obj src/d3d11/d3d11.dll.p/d3d11_video.cpp.obj src/d3d11/d3d11.dll.p /d3d11_view_dsv.cpp.obj src/d3d11/d3d11.dll.p/d3d11_view_rtv.cpp.obj src/d3d11/d3d11.dll.p/d3d11_view_srv.cpp.obj src/d3d11/d3d11.dll.p/d3d11_view_uav. cpp. obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_blend.cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_buffer.cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_ depth_stencil.cpp .obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_device.cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_input_layout.cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_ d3d10_multithread. cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_query.cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_rasterizer.cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_d 3d10_sampler .cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_texture.cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_util.cpp.obj src/d3d11/d3d11.dll.p/.. _d3d10_d3d10_view_dsv.cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_view_rtv.cpp.obj src/d3d11/d3d11.dll.p/.._d3d10_d3d10_view_srv.cpp.obj -Wl,-- allow-shlib-undefined - Wl,-O1 -shared ../../dxvk/src/d3d11/d3d11.def -Wl,--start-group -Wl,--out-implib=src/d3d11/d3d11.dll.a -static - static-libgcc -static-libstdc++ -Wl,--file-alignment=4096 -Wl,--enable-stdcall-fixup -Wl,--add-stdcall-alias -Wl,-O3,--as-needed,- Bsymbolic-functions,-flto=auto -march=native -mtune=native -maes src/dxgi/dxgi.dll.a src/dxbc/libdxbc.a src/dxvk/libdxvk.a src/util/libutil.a src/ spirv/libspirv.a src/wsi/libwsi.a subprojects/libdisplay-info/libdisplay-info.a src/vulkan/libvkcommon.a -pthread -lm -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -Wl,--end-group
../../dxvk/src/d3d11/d3d11_buffer.cpp: In "CheckViewCompatibility" member function:
../../dxvk/src/d3d11/d3d11_buffer.cpp:206:3: Error: No register found to swap out
   206 | }
       | ^
../../dxvk/src/d3d11/d3d11_buffer.cpp:206:3: error: this is the command:
(insn 202 221 222 17 (parallel [
             (set (reg:DI 154 [141])
                 (and:DI (not:DI (reg:DI 153))
                     (reg/v:DI 152 [orig:96 features ] [96])))
             (clobber (reg:CC 17 flags))
         ]) "../../dxvk/src/d3d11/d3d11_buffer.cpp":294:40 467 {*andndi3_doubleword_bmi}
      (expr_list:REG_DEAD (reg:DI 153)
         (expr_list:REG_DEAD (reg/v:DI 152 [orig:96 features ] [96])
             (expr_list:REG_UNUSED (reg:CC 17 flags)
                 (nil)))))
Tturol 2023-05-06 github

That last one is a GCC internal compiler error (ICE). Update your GCC or report it to GCC maintainers.

Mms178 2023-05-06 github

@turol Yeah, probably a compiler bug. That was already with a very recent mingw-w64-gcc snapshot from May 5th.

Mms178 2023-05-12 github

Further experimentation shows that the newest proton-ge-custom from the AUR compiles just fine with GCC13/mingw-11. The issue I was seeing seems to be proton-cachyos specific, maybe due to an older committ they are targeting.

DLLs