Build the legacy jit for x86 and arm.
authorJarret Shook <jarret_shook@outlook.com>
Wed, 2 Dec 2015 23:48:45 +0000 (15:48 -0800)
committerjashook <jashoo@microsoft.com>
Tue, 15 Dec 2015 20:51:38 +0000 (12:51 -0800)
Small changes to cmake to allow us to build the legacy jit as the fallback
jit for both x86 and arm.

src/jit/CMakeLists.txt
src/jit/crossgen/CMakeLists.txt
src/jit/dll/CMakeLists.txt
src/jit/protojit/CMakeLists.txt [new file with mode: 0644]

index b46adec..9576195 100644 (file)
@@ -88,6 +88,8 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
     targetx86.cpp
     lowerxarch.cpp
     codegenxarch.cpp
+    codegenlegacy.cpp
+    stackfp.cpp
   )
 elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
   set( ARCH_SOURCES
@@ -137,3 +139,7 @@ set(CLR_EXPORTED_SYMBOL_FILE ${CLRJIT_EXPORTS_DEF})
 add_subdirectory(dll)
 add_subdirectory(crossgen)
 add_subdirectory(standalone)
+
+if (CLR_CMAKE_PLATFORM_ARCH_I386 OR CLR_CMAKE_PLATFORM_ARCH_ARM)
+    add_subdirectory(protojit)
+endif (CLR_CMAKE_PLATFORM_ARCH_I386 OR CLR_CMAKE_PLATFORM_ARCH_ARM)
index 8b9c3a3..5bbd30c 100644 (file)
@@ -1,3 +1,7 @@
 include(${CLR_DIR}/crossgen.cmake)
 
+if(CLR_CMAKE_PLATFORM_ARCH_I386 OR CLR_CMAKE_PLATFORM_ARCH_ARM)
+  add_definitions(-DLEGACY_BACKEND)
+endif(CLR_CMAKE_PLATFORM_ARCH_I386 OR CLR_CMAKE_PLATFORM_ARCH_ARM)
+
 add_library(jit_crossgen ${SOURCES})
index 00e343d..8ab4027 100644 (file)
@@ -1,5 +1,9 @@
 project(ClrJit)
 
+if(CLR_CMAKE_PLATFORM_ARCH_I386 OR CLR_CMAKE_PLATFORM_ARCH_ARM)
+    add_definitions(-DLEGACY_BACKEND)
+endif(CLR_CMAKE_PLATFORM_ARCH_I386 OR CLR_CMAKE_PLATFORM_ARCH_ARM)
+
 # Disable the following for UNIX altjit on Windows
 if(CLR_CMAKE_PLATFORM_UNIX)
     add_compile_options(-fPIC)
diff --git a/src/jit/protojit/CMakeLists.txt b/src/jit/protojit/CMakeLists.txt
new file mode 100644 (file)
index 0000000..cc74b43
--- /dev/null
@@ -0,0 +1,46 @@
+project(protojit)
+
+remove_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)
+
+add_library(protojit
+   SHARED
+   ${SHARED_LIB_SOURCES}
+)
+
+set(RYUJIT_LINK_LIBRARIES
+   utilcodestaticnohost
+   gcinfo
+)
+
+if(CLR_CMAKE_PLATFORM_UNIX)
+    list(APPEND RYUJIT_LINK_LIBRARIES
+       mscorrc_debug
+       coreclrpal
+       palrt
+    )
+else()
+    list(APPEND RYUJIT_LINK_LIBRARIES
+       msvcrt.lib
+       kernel32.lib
+       advapi32.lib
+       ole32.lib
+       oleaut32.lib
+       uuid.lib
+       user32.lib
+       version.lib
+       shlwapi.lib
+       bcrypt.lib
+       crypt32.lib
+       RuntimeObject.lib
+    )
+endif(CLR_CMAKE_PLATFORM_UNIX)
+
+target_link_libraries(protojit
+   ${RYUJIT_LINK_LIBRARIES}
+)
+
+# add the install targets
+install (TARGETS protojit DESTINATION .)
+if(WIN32)
+    install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/protojit.pdb DESTINATION PDB)
+endif(WIN32)