Skip to content

Use /EMITVOLATILEMETADATA:NO with Microsoft Linker - #96

Merged
dra27 merged 1 commit into
ocaml:masterfrom
dra27:suppress-volatile
Jan 4, 2022
Merged

dra27 merged 1 commit into
ocaml:masterfrom
dra27:suppress-volatile

Conversation

@dra27

@dra27 dra27 commented Nov 29, 2021

Copy link
Copy Markdown
Member

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.

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.

OCaml is starting to add the flag to the compiler to disable its
generation, this patch also stops the linker from attempting to use the
section if it's there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant