Fix GCInfo library used by ARM/ARM64 protononjit builds
authorBruce Forstall <brucefo@microsoft.com>
Tue, 25 Apr 2017 16:43:38 +0000 (09:43 -0700)
committerBruce Forstall <brucefo@microsoft.com>
Tue, 25 Apr 2017 21:50:24 +0000 (14:50 -0700)
Otherwise, using the normal GCInfo library, the altjits will
assert creating GC info.

Create new "cross-target" builds of the GCInfo library.

Commit migrated from https://github.com/dotnet/coreclr/commit/35bd37d89e53411ef09cd0a509e6ffaaf1ab3b8a

src/coreclr/src/gcinfo/CMakeLists.txt
src/coreclr/src/gcinfo/gcinfo_arm/CMakeLists.txt [new file with mode: 0644]
src/coreclr/src/gcinfo/gcinfo_arm64/CMakeLists.txt [new file with mode: 0644]
src/coreclr/src/jit/protononjit/CMakeLists.txt

index e4730c6..ab7e48d 100644 (file)
@@ -23,5 +23,15 @@ endif(CLR_CMAKE_PLATFORM_UNIX)
 add_subdirectory(lib)
 add_subdirectory(crossgen)
 
+if (CLR_CMAKE_PLATFORM_ARCH_I386)
+    # On x86, build RyuJIT/ARM32 cross-compiling altjit.
+    add_subdirectory(gcinfo_arm)
+endif ()
+
+if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
+    # On amd64, build RyuJIT/ARM64 cross-compiling altjit.
+    add_subdirectory(gcinfo_arm64)
+endif ()
+
 _install (FILES gcinfoencoder.cpp
                DESTINATION gcinfo)
diff --git a/src/coreclr/src/gcinfo/gcinfo_arm/CMakeLists.txt b/src/coreclr/src/gcinfo/gcinfo_arm/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3617c97
--- /dev/null
@@ -0,0 +1,7 @@
+remove_definitions(-D_TARGET_X86_=1)
+add_definitions(-D_TARGET_ARM_)
+
+add_library_clr(gcinfo_arm
+    STATIC
+    ${GCINFO_SOURCES}
+)
diff --git a/src/coreclr/src/gcinfo/gcinfo_arm64/CMakeLists.txt b/src/coreclr/src/gcinfo/gcinfo_arm64/CMakeLists.txt
new file mode 100644 (file)
index 0000000..116ed7c
--- /dev/null
@@ -0,0 +1,7 @@
+remove_definitions(-D_TARGET_AMD64_=1)
+add_definitions(-D_TARGET_ARM64_)
+
+add_library_clr(gcinfo_arm64
+    STATIC
+    ${GCINFO_SOURCES}
+)
index e209e4c..6adf4b1 100644 (file)
@@ -13,10 +13,12 @@ if (CLR_CMAKE_PLATFORM_ARCH_I386)
     remove_definitions(-D_TARGET_X86_=1)
     add_definitions(-D_TARGET_ARM_)
     set(JIT_ARCH_ALTJIT_SOURCES ${JIT_ARM_SOURCES})
+    set(JIT_ARCH_LINK_LIBRARIES gcinfo_arm)
 elseif(CLR_CMAKE_PLATFORM_ARCH_AMD64)
     remove_definitions(-D_TARGET_AMD64_=1)
     add_definitions(-D_TARGET_ARM64_)
     set(JIT_ARCH_ALTJIT_SOURCES ${JIT_ARM64_SOURCES})
+    set(JIT_ARCH_LINK_LIBRARIES gcinfo_arm64)
 else()
     clr_unknown_arch()
 endif()
@@ -49,7 +51,7 @@ set_property(TARGET protononjit APPEND_STRING PROPERTY LINK_DEPENDS ${JIT_EXPORT
 
 set(RYUJIT_LINK_LIBRARIES
    utilcodestaticnohost
-   gcinfo
+   ${JIT_ARCH_LINK_LIBRARIES}
 )
 
 if(CLR_CMAKE_PLATFORM_UNIX)