protonscr

[wiki] Add i686-w64-mingw32-gcc and i686-w64-mingw32-g++ to use posix

dxvkclosed
doitsujin/dxvk#1891 · opened 2021-01-09 by braiam · updated 2023-06-20 · 4 comments · github
Bbraiam 2021-01-09 github

Build instructions for x86_64 works while changing mingw-w64 to the posix version, sadly, the simple option to build dxvk (./package-release.sh master /your/target/directory --no-package) will try to build both, x86_64 and i686 versions. See log:

Installing src/d3d9/d3d9.dll to /home/braiam/src/dxvk/build/dxvk-master/x64
Stripping target 'src/d3d9/d3d9.dll' using x86_64-w64-mingw32-strip.
Installing src/d3d9/d3d9.dll.a to /home/braiam/src/dxvk/build/dxvk-master/x64
The Meson build system
Version: 0.56.1
Source dir: /home/braiam/src/dxvk
Build dir: /home/braiam/src/dxvk/build/dxvk-master/build.32
Build type: cross build
Project name: dxvk
Project version: v1.7.3
C compiler for the host machine: i686-w64-mingw32-gcc (gcc 10.0.0 "i686-w64-mingw32-gcc (GCC) 10-win32 20201125")
C linker for the host machine: i686-w64-mingw32-gcc ld.bfd 2.35
C++ compiler for the host machine: i686-w64-mingw32-g++ (gcc 10.0.0 "i686-w64-mingw32-g++ (GCC) 10-win32 20201125")
C++ linker for the host machine: i686-w64-mingw32-g++ ld.bfd 2.35
C compiler for the build machine: cc (gcc 10.2.1 "cc (Debian 10.2.1-3) 10.2.1 20201224")
C linker for the build machine: cc ld.bfd 2.35.1
C++ compiler for the build machine: c++ (gcc 10.2.1 "c++ (Debian 10.2.1-3) 10.2.1 20201224")
C++ linker for the build machine: c++ ld.bfd 2.35.1
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86
Target machine cpu: x86
Program i686-w64-mingw32-windres found: YES (/usr/bin/i686-w64-mingw32-windres)
Compiler for C++ supports link arguments -Wl,--add-stdcall-alias: YES 
Compiler for C++ supports link arguments -Wl,--enable-stdcall-fixup: YES 
Compiler for C++ supports arguments -msse: YES 
Compiler for C++ supports arguments -msse2: YES 
Library vulkan-1 found: YES
Library d3d9 found: YES
Library d3d11 found: YES
Library dxgi found: YES
Library d3dcompiler_43 found: YES
Library d3dcompiler_47 found: YES
Program glslangValidator found: YES (/usr/bin/glslangValidator)
Run-time dependency threads found: YES
Dependency threads found: YES unknown (cached)
Build targets in project: 13

Found ninja-1.10.1 at /usr/bin/ninja
[4/266] Compiling C++ object src/util/libutil.a.p/log_log_debug.cpp.obj
FAILED: src/util/libutil.a.p/log_log_debug.cpp.obj 
i686-w64-mingw32-g++ -Isrc/util/libutil.a.p -Isrc/util -I../../../src/util -I../../../include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -O3 -DNOMINMAX -msse -msse2 -MD -MQ src/util/libutil.a.p/log_log_debug.cpp.obj -MF src/util/libutil.a.p/log_log_debug.cpp.obj.d -o src/util/libutil.a.p/log_log_debug.cpp.obj -c ../../../src/util/log/log_debug.cpp
In file included from ../../../src/util/log/log_debug.h:5,
                 from ../../../src/util/log/log_debug.cpp:1:
../../../src/util/log/log.h:50:10: error: ‘mutex’ in namespace ‘std’ does not name a type
   50 |     std::mutex    m_mutex;
      |          ^~~~~
../../../src/util/log/log.h:7:1: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
    6 | #include <mutex>
  +++ |+#include <mutex>
    7 | #include <string>
[7/266] Compiling C++ object src/util/libutil.a.p/util_monitor.cpp.obj
FAILED: src/util/libutil.a.p/util_monitor.cpp.obj 
i686-w64-mingw32-g++ -Isrc/util/libutil.a.p -Isrc/util -I../../../src/util -I../../../include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -O3 -DNOMINMAX -msse -msse2 -MD -MQ src/util/libutil.a.p/util_monitor.cpp.obj -MF src/util/libutil.a.p/util_monitor.cpp.obj.d -o src/util/libutil.a.p/util_monitor.cpp.obj -c ../../../src/util/util_monitor.cpp
In file included from ../../../src/util/util_monitor.cpp:4:
../../../src/util/./log/log.h:50:10: error: ‘mutex’ in namespace ‘std’ does not name a type
   50 |     std::mutex    m_mutex;
      |          ^~~~~
../../../src/util/./log/log.h:7:1: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
    6 | #include <mutex>
  +++ |+#include <mutex>
    7 | #include <string>
[9/266] Compiling C++ object src/util/libutil.a.p/util_luid.cpp.obj
FAILED: src/util/libutil.a.p/util_luid.cpp.obj 
i686-w64-mingw32-g++ -Isrc/util/libutil.a.p -Isrc/util -I../../../src/util -I../../../include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -O3 -DNOMINMAX -msse -msse2 -MD -MQ src/util/libutil.a.p/util_luid.cpp.obj -MF src/util/libutil.a.p/util_luid.cpp.obj.d -o src/util/libutil.a.p/util_luid.cpp.obj -c ../../../src/util/util_luid.cpp
In file included from ../../../src/util/util_luid.cpp:4:
../../../src/util/./log/log.h:50:10: error: ‘mutex’ in namespace ‘std’ does not name a type
   50 |     std::mutex    m_mutex;
      |          ^~~~~
../../../src/util/./log/log.h:7:1: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
    6 | #include <mutex>
  +++ |+#include <mutex>
    7 | #include <string>
../../../src/util/util_luid.cpp: In function ‘LUID dxvk::GetAdapterLUID(UINT)’:
../../../src/util/util_luid.cpp:12:17: error: ‘mutex’ in namespace ‘std’ does not name a type
   12 |     static std::mutex        s_mutex;
      |                 ^~~~~
../../../src/util/util_luid.cpp:5:1: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
    4 | #include "./log/log.h"
  +++ |+#include <mutex>
    5 | 
../../../src/util/util_luid.cpp:15:26: error: ‘mutex’ is not a member of ‘std’
   15 |     std::lock_guard<std::mutex> lock(s_mutex);
      |                          ^~~~~
../../../src/util/util_luid.cpp:15:26: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
../../../src/util/util_luid.cpp:15:31: error: template argument 1 is invalid
   15 |     std::lock_guard<std::mutex> lock(s_mutex);
      |                               ^
../../../src/util/util_luid.cpp:15:38: error: ‘s_mutex’ was not declared in this scope

(the log continues, but it's the same-ish output as the failure with the x86_64)

Since Debian systems with added architecture i386 seems to install both, changing both version of the binary to use posix would prevent issues.

update-alternatives --config i686-w64-mingw32-g++
update-alternatives --config i686-w64-mingw32-gcc
IIglu47 2021-01-09 · hidden on GitHub github

@braiam, I guess, will be helpful if the information about the used Distribution and version of package will be specify,
because changes like this exist:
https://salsa.debian.org/mingw-w64-team/gcc-mingw-w64/-/commit/8da432fefb792fbe2f9fec2f15278d02e86e6281
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=540782#79

Bbraiam 2021-01-09 github

@Iglu47 It's Debian testing, gcc-mingw-w64=10.2.0-19+24+b1. I expect downstream to have at some point the same version. Installing mingw-w64 would install both gcc-mingw-w64-i686-posix and gcc-mingw-w64-x86-64-posix as dependencies.

Ddoitsujin maintainer 2021-01-10 github

I mean the wiki literally says this:

(use i686 for 32-bit)

Could be highlighted arguably, but it's there.

Bbraiam 2021-01-10 github

@doitsujin yes, but the build script builds autodetects both and it gets confusing since searching for that only shows 64bit solutions and only those:

Those are the first links that appear on a google search with the relevant keywords.

I'm sure that issues about this would be prevented if it was explicit, rather than implicit. Users are trained to look for <code> blocks for commands to run. Including it wouldn't be too much of a effort, compared to the several comments that gets posted.

I figured it out after reading carefully the output log, but I'm sure users are not that patient reading the logs.

BTW, I didn't specify this explicitly on the issue, but users that just install gcc-mingw-w64-x86-64, only need the x86_64 variant, which makes more fun diagnosing localized differences in build environment.