From a559ca14ca541035ce2239815d8a511bdaa522ce Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Tue, 25 Apr 2017 09:43:38 -0700 Subject: [PATCH] Fix GCInfo library used by ARM/ARM64 protononjit builds 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 | 10 ++++++++++ src/coreclr/src/gcinfo/gcinfo_arm/CMakeLists.txt | 7 +++++++ src/coreclr/src/gcinfo/gcinfo_arm64/CMakeLists.txt | 7 +++++++ src/coreclr/src/jit/protononjit/CMakeLists.txt | 4 +++- 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/coreclr/src/gcinfo/gcinfo_arm/CMakeLists.txt create mode 100644 src/coreclr/src/gcinfo/gcinfo_arm64/CMakeLists.txt diff --git a/src/coreclr/src/gcinfo/CMakeLists.txt b/src/coreclr/src/gcinfo/CMakeLists.txt index e4730c6..ab7e48d 100644 --- a/src/coreclr/src/gcinfo/CMakeLists.txt +++ b/src/coreclr/src/gcinfo/CMakeLists.txt @@ -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 index 0000000..3617c97 --- /dev/null +++ b/src/coreclr/src/gcinfo/gcinfo_arm/CMakeLists.txt @@ -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 index 0000000..116ed7c --- /dev/null +++ b/src/coreclr/src/gcinfo/gcinfo_arm64/CMakeLists.txt @@ -0,0 +1,7 @@ +remove_definitions(-D_TARGET_AMD64_=1) +add_definitions(-D_TARGET_ARM64_) + +add_library_clr(gcinfo_arm64 + STATIC + ${GCINFO_SOURCES} +) diff --git a/src/coreclr/src/jit/protononjit/CMakeLists.txt b/src/coreclr/src/jit/protononjit/CMakeLists.txt index e209e4c..6adf4b1 100644 --- a/src/coreclr/src/jit/protononjit/CMakeLists.txt +++ b/src/coreclr/src/jit/protononjit/CMakeLists.txt @@ -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) -- 2.7.4