You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to compile this from a linux host, using clang with the x86_64-pc-windows-msvc target (and manually pointing it at the msvc headers/libs). When clang's compiling for windows, it also defines _MSC_VER, which means trampoline.c will try use __movsb instead of memcpy. Unfortunately, it seems msvc implicitly defines intrinsics, so it's header only has forward declarations, while clang normally defines inline assembly functions it's their headers, so I get a linker error. When compiling for windows, clang's intrinsics header just redirects to msvc's, so there's no way for me to be clever with includes, I need to modify code somewhere.
#51 would fix this, though it isn't the most comprehensive solution. I haven't debugged why, but I know from experience that clang on a windows host does link properly. Additionally, you can run mingw through clang, in which case _MSC_VER, __clang__ and __MINGW32__ are all defined at once, and under which once again it links properly. You could try something messing around with __has_builtin to be more accurate - though honestly I think it's a bit overkill, imo better to just keep the simple _MSC_VER check and just add a MINHOOK_NO_INTRINSICS override. I'm happy to contribute the code, just figured I'd post the issue first to get guidance on what solution's preferred.
For replication, download the msvc files using xwin, then here's a cmake toolchain file (may need to use absolute paths).
I am trying to compile this from a linux host, using clang with the
x86_64-pc-windows-msvc
target (and manually pointing it at the msvc headers/libs). When clang's compiling for windows, it also defines_MSC_VER
, which meanstrampoline.c
will try use__movsb
instead ofmemcpy
. Unfortunately, it seems msvc implicitly defines intrinsics, so it's header only has forward declarations, while clang normally defines inline assembly functions it's their headers, so I get a linker error. When compiling for windows, clang's intrinsics header just redirects to msvc's, so there's no way for me to be clever with includes, I need to modify code somewhere.#51 would fix this, though it isn't the most comprehensive solution. I haven't debugged why, but I know from experience that clang on a windows host does link properly. Additionally, you can run mingw through clang, in which case
_MSC_VER
,__clang__
and__MINGW32__
are all defined at once, and under which once again it links properly. You could try something messing around with__has_builtin
to be more accurate - though honestly I think it's a bit overkill, imo better to just keep the simple_MSC_VER
check and just add aMINHOOK_NO_INTRINSICS
override. I'm happy to contribute the code, just figured I'd post the issue first to get guidance on what solution's preferred.For replication, download the msvc files using xwin, then here's a cmake toolchain file (may need to use absolute paths).
Expand
The text was updated successfully, but these errors were encountered: