summaryrefslogtreecommitdiff
path: root/clrdefinitions.cmake
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2017-03-13 16:32:15 -0700
committerGitHub <noreply@github.com>2017-03-13 16:32:15 -0700
commitad8afe4f8c9537e8652ae35b301366d737bc1e04 (patch)
tree44fd7501fd93f2618b1ef0e4f8da38820b4715e6 /clrdefinitions.cmake
parent814a105864c35ca992ed1b332d72d9e6869519df (diff)
downloadcoreclr-ad8afe4f8c9537e8652ae35b301366d737bc1e04.tar.gz
coreclr-ad8afe4f8c9537e8652ae35b301366d737bc1e04.tar.bz2
coreclr-ad8afe4f8c9537e8652ae35b301366d737bc1e04.zip
Build Linux altjit for x86 and amd64 (#10120)
Enable Windows hosted, Linux target amd64 altjit With this change, we build a JIT that runs on Windows amd64 and targets Linux amd64, as an altjit named linuxnonjit.dll. This is useful for debugging, or generating asm code or diffs. You can even easily create Windows/non-Windows asm diffs (either to compare the asm, or compare the generated code size). For this to work, the JIT-EE interface method getSystemVAmd64PassStructInRegisterDescriptor() was changed to always be built in, by defining `FEATURE_UNIX_AMD64_STRUCT_PASSING_ITF` in all AMD64 builds. The `_ITF` suffix indicates that this is functionality specific to implementing the JIT-EE interface contract. There were many places in the VM that used this interchangeably with `FEATURE_UNIX_AMD64_STRUCT_PASSING`. Now, `FEATURE_UNIX_AMD64_STRUCT_PASSING` means code in the VM needed to implement this feature, but not required to implement the JIT-EE interface contract. In particular, MethodTables compute and cache the "eightbyte" info of structs when loading a type. This is not done when only `FEATURE_UNIX_AMD64_STRUCT_PASSING_ITF` is set, to avoid altering MethodTable behavior on non-Unix AMD64 builds. Instead, if `getSystemVAmd64PassStructInRegisterDescriptor()` is called on a non-Unix build (by the altjit), the `ClassifyEightBytes()` function is called, and nothing is cached. Hopefully (though it was hard for me to guarantee by observation), calling `ClassifyEightBytes()` does not have any side effects on MethodTables. It doesn't really matter, since if called for altjit, we don't care too much about running. The previously used `PLATFORM_UNIX` define is now insufficient. I introduced the `#define` macros `_HOST_UNIX_` to indicate the JIT being built will run on Unix, and `_TARGET_UNIX_` to indicate the JIT is generating code targeting Unix. Some things were converted to use the `UNIX_AMD64_ABI` define, which makes more sense.
Diffstat (limited to 'clrdefinitions.cmake')
-rw-r--r--clrdefinitions.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/clrdefinitions.cmake b/clrdefinitions.cmake
index 05f41401c2..49db1fd3ed 100644
--- a/clrdefinitions.cmake
+++ b/clrdefinitions.cmake
@@ -145,7 +145,6 @@ endif(NOT CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DFEATURE_MANAGED_ETW_CHANNELS)
if(FEATURE_MERGE_JIT_AND_ENGINE)
- # Disable the following for UNIX altjit on Windows
add_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)
endif(FEATURE_MERGE_JIT_AND_ENGINE)
add_definitions(-DFEATURE_MULTICOREJIT)
@@ -175,10 +174,13 @@ if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
endif ()
add_definitions(-DFEATURE_SVR_GC)
add_definitions(-DFEATURE_SYMDIFF)
+if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
+ # Enable the AMD64 Unix struct passing JIT-EE interface for all AMD64 platforms, to enable altjit.
+ add_definitions(-DFEATURE_UNIX_AMD64_STRUCT_PASSING_ITF)
+endif (CLR_CMAKE_PLATFORM_ARCH_AMD64)
if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
add_definitions(-DFEATURE_MULTIREG_RETURN)
add_definitions(-DFEATURE_UNIX_AMD64_STRUCT_PASSING)
- add_definitions(-DFEATURE_UNIX_AMD64_STRUCT_PASSING_ITF)
endif (CLR_CMAKE_PLATFORM_UNIX_AMD64)
add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS)
if(CLR_CMAKE_PLATFORM_ARCH_AMD64 AND NOT WIN32)