Open h4nsbr1x opened 4 years ago
modify the interrupt_t private constructor like below
constexpr
interrupt_t(
vmx::interrupt_type interrupt_type,
exception_vector exception_vector,
exception_error_code_t exception_code,
bool exception_code_valid,
int rip_adjust
) noexcept
: info_{
.vector = static_cast<uint32_t>(exception_vector),
.type = static_cast<uint32_t>(interrupt_type),
//
// Final sanitization of the following fields takes place
// in vcpu::interrupt_inject_force().
//
.error_code_valid = exception_code_valid,
.nmi_unblocking = 0,
.reserved = 0,
.valid = true,
}
, error_code_{exception_code}
, rip_adjust_{rip_adjust}
{
}
After update Visual Studio to 16.10.0, this LNK4210 issue should be fixed.
After update Visual Studio to 16.10.0, this LNK4210 issue should be fixed.
It's still there
After update Visual Studio to 16.10.0, this LNK4210 issue should be fixed.
It's still there
Hi,Do you solve tis problem about LNK4210
The problem still seems to be present with latest 16.10.4. Some header is including chrono which is pulling in dynamic initializer that is incompatible with kernel.
<snip>
Dump of file hvpp.lib
File Type: LIBRARY
Summary
10 .CRT$XCU <--- hvpp.lib includes these CRT sections.
2B74 .bss
A048 .chks64
</snip>
Using the showIncludes option during compilation we can see that
<snip>
bin\x64\Debug\hdrs.txt
69891: COMDAT; sym= "public: __cdecl std::locale::id::id(unsigned __int64)" (??0id@locale@std@@QEAA@_K@Z)
70155: COMDAT; sym= "void __cdecl `dynamic initializer for 'public: static class std::locale::id std::numpunct<char>::id''(void)" (??__E?id@?$numpunct@D@std@@2V0locale@2@A@@YAXXZ)
70188: COMDAT; sym= "void __cdecl `dynamic initializer for 'public: static class std::locale::id std::numpunct<unsigned short>::id''(void)" (??__E?id@?$numpunct@G@std@@2V0locale@2@A@@YAXXZ)
</snip>
1>Note: including file: J:\dev\hypervisor\hvpp\src\hvpp\hvpp\ia32\arch/**xsave.h** <--- one such instance
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\cinttypes
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\inttypes.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\numeric
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\mutex
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\chrono <--- This is where chrono is getting included
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\ratio
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\__msvc_tzdb.hpp
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\cmath
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\forward_list
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\istream
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\ostream
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\ios
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\xlocnum
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\iterator
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\streambuf
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\xiosbase
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\share.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\xlocale
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\memory
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\typeinfo
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vcruntime_typeinfo.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vcruntime_exception.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\eh.h
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_terminate.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\xfacet
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\xlocinfo
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\xlocinfo.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\cctype
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\ctype.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\clocale
1>Note: including file: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\locale.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\optional
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\xsmf_control.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\sstream
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\string
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\vector
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\xloctime
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include\format
@manurautela you build it success ?
@manurautela you build it success ?
No, it fails with the above mentioned LNK4210.
But if you disable the linker warning "4210" it links properly and generates .sys file. Although disabling this warning might not be desirable, as it allows devs to introduce such code unintentionally.
I was able to load and run the test binary hvppctrl.exe after loading the driver.
some references regarding the .CRT link warning http://www.zer0mem.sk/?p=517 https://github.com/jxy-s/stlkrn https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/using-the-microsoft-c-runtime-with-user-mode-drivers-and-apps
I've tried cloning and building this in vs2019 and I'm getting the following errors:
The first error seems to be here:
This looks related: https://stackoverflow.com/questions/63558400/vs2019-latest-update-constexpr-expression-did-not-evaluate-to-a-constant-for and if I apply the fix it seems to solve the problem.
As for the second fault, no idea what's causing this (LNK4210)