Stuck on Detecting C ABI
philmb3487 opened this issue · 9 comments
Whenever I use this project on my Gentoo install I get stuck waiting at this line:
-- The C compiler identification is MSVC 19.39.33523.0
-- The CXX compiler identification is MSVC 19.39.33523.0
-- Detecting C compiler ABI info
The wine version is the same as my testing Ubuntu environment, where this works: 7.0.2 and it also does the same thing on 9.
Is this a known issue and what can I do about this?
This sounds like the issue described at https://github.com/mstorsjo/msvc-wine?tab=readme-ov-file#fatal-error-c1902-program-database-manager-mismatch-please-check-your-installation and #6; if you install winbind
, this should usually work, if you have the latest versions of all scripts (since #65).
Otherwise, if you have a new enough CMake (3.25 iirc), you can configure with -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
which also should make the issue go away, without dealing with winbind and the mspdbsrv.exe
background process.
I do have winbind (well samba with winbindd if I understand right) installed, do I have to start a systemd unit or something?
With the embedded format thing enabled, I get the following:
$ cmake --preset=msvc-wine -B build -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
Preset CMake variables:
CMAKE_BUILD_TYPE="RelWithDebInfo"
CMAKE_CROSSCOMPILING_EMULATOR="env;WINEDEBUG=-all;wine64"
CMAKE_CXX_COMPILER="/opt/msvc/bin/x64/cl.exe"
CMAKE_C_COMPILER="/opt/msvc/bin/x64/cl.exe"
CMAKE_RC_COMPILER="/opt/msvc/bin/x64/rc.exe"
CMAKE_SYSTEM_NAME="Windows"
CMAKE_SYSTEM_VERSION="10"
-- The C compiler identification is MSVC 19.39.33523.0
-- The CXX compiler identification is MSVC 19.39.33523.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /opt/msvc/bin/x64/cl.exe
-- Check for working C compiler: /opt/msvc/bin/x64/cl.exe - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"/opt/msvc/bin/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: '/data/modix/modixslicer/deps/build/CMakeFiles/CMakeScratch/TryCompile-zdODBv'
Run Build Command(s): /usr/bin/ninja -v cmTC_6f2a0
[1/2] /opt/msvc/bin/x64/cl.exe /nologo /DWIN32 /D_WINDOWS /Ob0 /Od /RTC1 -MDd -Z7 /showIncludes /FoCMakeFiles/cmTC_6f2a0.dir/testCCompiler.c.obj /FdCMakeFiles/cmTC_6f2a0.dir/ /FS -c /data/modix/modixslicer/deps/build/CMakeFiles/CMakeScratch/TryCompile-zdODBv/testCCompiler.c
[2/2] : && /usr/bin/cmake -E vs_link_exe --intdir=CMakeFiles/cmTC_6f2a0.dir --rc=/opt/msvc/bin/x64/rc.exe --mt=/opt/msvc/bin/x64/mt --manifests -- /opt/msvc/bin/x64/link /nologo CMakeFiles/cmTC_6f2a0.dir/testCCompiler.c.obj /out:cmTC_6f2a0.exe /implib:cmTC_6f2a0.lib /pdb:cmTC_6f2a0.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && :
FAILED: cmTC_6f2a0.exe
: && /usr/bin/cmake -E vs_link_exe --intdir=CMakeFiles/cmTC_6f2a0.dir --rc=/opt/msvc/bin/x64/rc.exe --mt=/opt/msvc/bin/x64/mt --manifests -- /opt/msvc/bin/x64/link /nologo CMakeFiles/cmTC_6f2a0.dir/testCCompiler.c.obj /out:cmTC_6f2a0.exe /implib:cmTC_6f2a0.lib /pdb:cmTC_6f2a0.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && :
MT: command "/opt/msvc/bin/x64/mt /nologo /manifest CMakeFiles/cmTC_6f2a0.dir/intermediate.manifest /out:CMakeFiles/cmTC_6f2a0.dir/embed.manifest /notify_update" failed (exit code 0x1) with the following output:
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:27 (project)
-- Configuring incomplete, errors occurred!
Cmake is version 3.29, wine is version 7.0.2
I do have winbind (well samba with winbindd if I understand right) installed, do I have to start a systemd unit or something?
Sorry, no idea...
If you're interested in digging into this, try looking at either the cmake log, to see exactly what command it tried to execute - but maybe it isn't printed until the command completes? Or just try strace. Anyway, with the problematic command known, try executing it manually outside of cmake, to see what it does... There's been a lot of fixes in this area thanks to @huangqinjin.
With the embedded format thing enabled, I get the following:
$ cmake --preset=msvc-wine -B build -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded Preset CMake variables: CMAKE_BUILD_TYPE="RelWithDebInfo" CMAKE_CROSSCOMPILING_EMULATOR="env;WINEDEBUG=-all;wine64" CMAKE_CXX_COMPILER="/opt/msvc/bin/x64/cl.exe" CMAKE_C_COMPILER="/opt/msvc/bin/x64/cl.exe" CMAKE_RC_COMPILER="/opt/msvc/bin/x64/rc.exe" CMAKE_SYSTEM_NAME="Windows" CMAKE_SYSTEM_VERSION="10" -- The C compiler identification is MSVC 19.39.33523.0 -- The CXX compiler identification is MSVC 19.39.33523.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: /opt/msvc/bin/x64/cl.exe -- Check for working C compiler: /opt/msvc/bin/x64/cl.exe - broken CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "/opt/msvc/bin/x64/cl.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: '/data/modix/modixslicer/deps/build/CMakeFiles/CMakeScratch/TryCompile-zdODBv' Run Build Command(s): /usr/bin/ninja -v cmTC_6f2a0 [1/2] /opt/msvc/bin/x64/cl.exe /nologo /DWIN32 /D_WINDOWS /Ob0 /Od /RTC1 -MDd -Z7 /showIncludes /FoCMakeFiles/cmTC_6f2a0.dir/testCCompiler.c.obj /FdCMakeFiles/cmTC_6f2a0.dir/ /FS -c /data/modix/modixslicer/deps/build/CMakeFiles/CMakeScratch/TryCompile-zdODBv/testCCompiler.c [2/2] : && /usr/bin/cmake -E vs_link_exe --intdir=CMakeFiles/cmTC_6f2a0.dir --rc=/opt/msvc/bin/x64/rc.exe --mt=/opt/msvc/bin/x64/mt --manifests -- /opt/msvc/bin/x64/link /nologo CMakeFiles/cmTC_6f2a0.dir/testCCompiler.c.obj /out:cmTC_6f2a0.exe /implib:cmTC_6f2a0.lib /pdb:cmTC_6f2a0.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && : FAILED: cmTC_6f2a0.exe : && /usr/bin/cmake -E vs_link_exe --intdir=CMakeFiles/cmTC_6f2a0.dir --rc=/opt/msvc/bin/x64/rc.exe --mt=/opt/msvc/bin/x64/mt --manifests -- /opt/msvc/bin/x64/link /nologo CMakeFiles/cmTC_6f2a0.dir/testCCompiler.c.obj /out:cmTC_6f2a0.exe /implib:cmTC_6f2a0.lib /pdb:cmTC_6f2a0.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && : MT: command "/opt/msvc/bin/x64/mt /nologo /manifest CMakeFiles/cmTC_6f2a0.dir/intermediate.manifest /out:CMakeFiles/cmTC_6f2a0.dir/embed.manifest /notify_update" failed (exit code 0x1) with the following output: ninja: build stopped: subcommand failed. CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:27 (project) -- Configuring incomplete, errors occurred!
Ok, so then it does proceed further, but gets stuck on an issue around mt.exe. This is also supposed to work, since #63. You may be able to sidestep it by passing -DCMAKE_EXE_LINKER_FLAGS=/MANIFEST:NO
and -DCMAKE_SHARED_LINKER_FLAGS=/MANIFEST:NO
to CMake.
Ohhh I had a build folder already configured, changing the name to something new fixed the issue, but I still need to set the linker flags to /MANIFEST:NO
otherwise it does not work.
here is a toolchain file that works:
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR AMD64)
set(CMAKE_C_COMPILER /opt/msvc/bin/x64/cl.exe)
set(CMAKE_CXX_COMPILER /opt/msvc/bin/x64/cl.exe)
set(CMAKE_RC_COMPILER /opt/msvc/bin/x64/rc.exe)
set(CMAKE_HOST_WIN32 true)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
set(CMAKE_EXE_LINKER_FLAGS /MANIFEST:NO)
set(CMAKE_SHARED_LINKER_FLAGS /MANIFEST:NO)
Now I'm getting a file path issue, should I open a new bug report for this?
LINK : fatal error LNK1104: cannot open file 'z:\opt\msvc\kits\10\lib\10.0.22621.0\ucrt\x64\ucrtd.lib'
Now I'm getting a file path issue, should I open a new bug report for this?
LINK : fatal error LNK1104: cannot open file 'z:\opt\msvc\kits\10\lib\10.0.22621.0\ucrt\x64\ucrtd.lib'
Sure, that sounds like a different issue as well, so perhaps good to make a separate issue. But it's odd, as if I understand you correctly, this works for you on Ubuntu, but fails on Gentoo? So it sounds like there's something differing in the environment between these two distros, that makes all these details fail in this way.
The stuck issue and mt
issue are typical issues of missing msvctricks.exe
. Please check if it is in /opt/msvc/bin
.
msvctricks.exe
.
where should i copy it from?
The stuck issue and
mt
issue are typical issues of missingmsvctricks.exe
. Please check if it is in/opt/msvc/bin
.
Yes I think that fixed it. I had to build it manually like cl.exe /EHsc /O2 msvctricks.cpp
and then copy it there.
I don't understand the install.sh script. it seems to check for wine, which I have, and then it decides to not build msvctricks.
Did you install wine before running install.h
, there should not be problems if yes.