[GR-52567] FFM API support for windows-amd64. #10788
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brings back FFM API support for
windows-amd64
.There are two main changes to make that happen:
Linker.nativeLinker().defaultLookup()
). The problem on Windows is that if the runtime library isucrtbase.dll
, functions likefprintf
,fscanf
, and all variants of it, are defined as inline functions. In order to make those symbols available for symbol lookups via the FFM API, we need to reference them in C code such that we force the compiler to generate those functions. I've therefore added an array tolibchelper
(filesyslookup.c
) which contains function pointers to those inline functions just like JDK does.ReadRegisterNode
s accessing all registers with word kind. This lead to the problem that a reg2reg move was emitted, that would move a value between registers of a different register category which triggered an assertion. For some reason, this happened only on Windows but is a potential problem on all other platforms as well.