ocaml / flexdll

a dlopen-like API for Windows
Other
97 stars 30 forks source link

Use /EMITVOLATILEMETADATA:NO with Microsoft Linker #96

Closed dra27 closed 2 years ago

dra27 commented 2 years ago

Recent Visual Studio 2019 and 2022 are enabling volatile metadata on x64 by default. There don't appear to be many technical details available, but the purpose is to improve emulation of AMD64 on ARM64. Sometimes the .voltbl sections are copying correctly and then seemingly minor code changes can break it, causing an obscure and undocumented error from the Microsoft Linker.

In parallel, OCaml will start to adding /d2VolatileMetadata- to its internal CFLAGS which should suppress the problem from both sides.