summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt86
-rw-r--r--build.cmd21
-rw-r--r--crossgen.cmake4
-rw-r--r--src/ToolBox/SOS/CMakeLists.txt2
-rw-r--r--src/debug/daccess/CMakeLists.txt19
-rw-r--r--src/debug/ee/CMakeLists.txt2
-rw-r--r--src/debug/ee/wks/CMakeLists.txt11
-rw-r--r--src/dlls/mscoree/coreclr/CMakeLists.txt46
-rw-r--r--src/jit/utils.h2
-rw-r--r--src/pal/tools/gen-buildsys-win.bat9
-rw-r--r--src/unwinder/CMakeLists.txt23
-rw-r--r--src/utilcode/CMakeLists.txt16
-rw-r--r--src/vm/CMakeLists.txt16
-rw-r--r--src/vm/crossgen/CMakeLists.txt7
-rw-r--r--src/vm/interpreter.cpp2
-rw-r--r--src/vm/wks/CMakeLists.txt12
-rw-r--r--src/zap/crossgen/CMakeLists.txt4
17 files changed, 183 insertions, 99 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1792020..0c56b58 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ set(GENERATED_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/inc)
function(clr_unknown_arch)
if (WIN32)
- message(FATAL_ERROR "Only AMD64 and I386 are supported")
+ message(FATAL_ERROR "Only AMD64, ARM64 and I386 are supported")
else()
message(FATAL_ERROR "Only AMD64, ARM64 and ARM are supported")
endif()
@@ -80,6 +80,19 @@ elseif(WIN32)
elseif(CLR_CMAKE_TARGET_ARCH STREQUAL x86)
set(CLR_CMAKE_PLATFORM_ARCH_I386 1)
set(IS_64BIT_BUILD 0)
+ elseif(CLR_CMAKE_TARGET_ARCH STREQUAL arm64)
+ set(CLR_CMAKE_PLATFORM_ARCH_ARM64 1)
+ set(IS_64BIT_BUILD 1)
+
+ # CMAKE_CXX_COMPILER will default to the compiler installed with
+ # Visual studio. Overwrite it to the compiler on the path.
+ # TODO, remove when cmake generator supports Arm64 as a target.
+
+ find_program(PATH_CXX_COMPILER cl)
+ set(CMAKE_CXX_COMPILER ${PATH_CXX_COMPILER})
+
+ message("Overwriting the CMAKE_CXX_COMPILER.")
+ message(CMAKE_CXX_COMPILER found:${CMAKE_CXX_COMPILER})
else()
clr_unknown_arch()
endif()
@@ -145,6 +158,7 @@ function(preprocess_def_file inputFilename outputFilename)
DEPENDS ${inputFilename}
COMMENT "Preprocessing ${inputFilename}"
)
+
set_source_files_properties(${outputFilename}
PROPERTIES GENERATED TRUE)
endfunction()
@@ -324,8 +338,6 @@ elseif (CLR_CMAKE_PLATFORM_UNIX)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL amd64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
set(IS_64BIT_BUILD 1)
endif (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL amd64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
-
- add_definitions(-DFEATURE_IMPLICIT_TLS)
endif(WIN32)
if (OVERRIDE_CMAKE_CXX_FLAGS)
@@ -408,6 +420,13 @@ set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWIT
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /LTCG /OPT:REF /OPT:ICF")
+# Temporary until cmake has VS generators for arm64
+if(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /machine:arm64")
+ set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /machine:arm64")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /machine:arm64")
+endif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+
endif (WIN32)
endif (OVERRIDE_CMAKE_CXX_FLAGS)
@@ -517,20 +536,18 @@ add_definitions(-DNT_INST=0)
add_definitions(-DCONDITION_HANDLING=1)
add_definitions(-DNTDDI_VERSION=NTDDI_WIN8)
-if (IS_64BIT_BUILD EQUAL 1)
+if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
if (CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64)
add_definitions(-DDBG_TARGET_AMD64_UNIX)
- add_definitions(-D_TARGET_AMD64_=1)
- add_definitions(-DDBG_TARGET_AMD64)
- elseif (CLR_CMAKE_PLATFORM_UNIX_TARGET_ARM64)
+ endif()
+ add_definitions(-D_TARGET_AMD64_=1)
+ add_definitions(-DDBG_TARGET_AMD64)
+elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ if (CLR_CMAKE_PLATFORM_UNIX_TARGET_ARM64)
add_definitions(-DDBG_TARGET_ARM64_UNIX)
- add_definitions(-D_TARGET_ARM64_=1)
- add_definitions(-DDBG_TARGET_ARM64)
- else ()
- # Windows is assumed in this path -- fix this
- add_definitions(-DDBG_TARGET_AMD64)
- add_definitions(-D_TARGET_AMD64_=1)
- endif (CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64)
+ endif()
+ add_definitions(-D_TARGET_ARM64_=1)
+ add_definitions(-DDBG_TARGET_ARM64)
elseif (CLR_CMAKE_PLATFORM_ARCH_ARM)
if (CLR_CMAKE_PLATFORM_UNIX_TARGET_ARM)
add_definitions(-DDBG_TARGET_ARM_UNIX)
@@ -542,7 +559,7 @@ elseif (CLR_CMAKE_PLATFORM_ARCH_I386)
add_definitions(-DDBG_TARGET_X86)
else ()
clr_unknown_arch()
-endif (IS_64BIT_BUILD EQUAL 1)
+endif (CLR_CMAKE_PLATFORM_ARCH_AMD64)
if(WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
@@ -553,15 +570,24 @@ add_definitions(-DWINVER=0x0602)
add_definitions(-DWIN32_LEAN_AND_MEAN=1)
add_definitions(-DDEBUGGING_SUPPORTED)
if(WIN32)
- # Disable edit and continue on Linux
- add_definitions(-DEnC_SUPPORTED)
+ if(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_I386)
+ # Only enable edit and continue on windows x86 and x64
+ # exclude Linux, arm & arm64
+ add_definitions(-DEnC_SUPPORTED)
+ endif(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_I386)
endif(WIN32)
add_definitions(-DFEATURE_APPDOMAIN_RESOURCE_MONITORING)
if(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
add_definitions(-DFEATURE_ARRAYSTUB_AS_IL)
endif()
-if (CLR_CMAKE_PLATFORM_UNIX)
+
+if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
add_definitions(-DFEATURE_STUBS_AS_IL)
+ add_definitions(-DFEATURE_IMPLICIT_TLS)
+ set(FEATURE_IMPLICIT_TLS 1)
+endif()
+
+if (CLR_CMAKE_PLATFORM_UNIX)
if (CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64)
add_definitions(-DUNIX_AMD64_ABI)
elseif (CLR_CMAKE_PLATFORM_UNIX_TARGET_ARM)
@@ -622,7 +648,10 @@ endif(WIN32)
add_definitions(-DFEATURE_NORM_IDNA_ONLY)
add_definitions(-DFEATURE_PREJIT)
add_definitions(-DFEATURE_RANDOMIZED_STRING_HASHING)
-add_definitions(-DFEATURE_READYTORUN)
+if(NOT DEFINED CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ add_definitions(-DFEATURE_READYTORUN)
+ set(FEATURE_READYTORUN 1)
+endif(NOT DEFINED CLR_CMAKE_PLATFORM_ARCH_ARM64)
add_definitions(-DFEATURE_STANDALONE_SN)
add_definitions(-DFEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED)
add_definitions(-DFEATURE_STRONGNAME_MIGRATION)
@@ -693,21 +722,16 @@ add_definitions(-DFX_BRANCH_SYNC_COUNTER_VALUE=0)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
-if (IS_64BIT_BUILD EQUAL 1)
- if (CLR_CMAKE_PLATFORM_UNIX_TARGET_AMD64 EQUAL 1)
+if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
set(ARCH_SOURCES_DIR amd64)
- elseif (CLR_CMAKE_PLATFORM_UNIX_TARGET_ARM64 EQUAL 1)
+elseif (CLR_CMAKE_PLATFORM_ARCH_ARM64)
set(ARCH_SOURCES_DIR arm64)
- else ()
- # Windows is assumed in this path -- fix this
- set(ARCH_SOURCES_DIR amd64)
- endif ()
-else ()
- if (CLR_CMAKE_PLATFORM_ARCH_ARM)
+elseif (CLR_CMAKE_PLATFORM_ARCH_ARM)
set(ARCH_SOURCES_DIR arm)
- else ()
+elseif (CLR_CMAKE_PLATFORM_ARCH_I386)
set(ARCH_SOURCES_DIR i386)
- endif ()
-endif (IS_64BIT_BUILD EQUAL 1)
+else ()
+ clr_unknown_arch()
+endif ()
add_subdirectory(src)
diff --git a/build.cmd b/build.cmd
index 046970e..648da6d 100644
--- a/build.cmd
+++ b/build.cmd
@@ -31,6 +31,7 @@ if /i "%1" == "/?" goto Usage
if /i "%1" == "x64" (set __BuildArch=x64&&shift&goto Arg_Loop)
if /i "%1" == "x86" (set __BuildArch=x86&&shift&goto Arg_Loop)
if /i "%1" == "arm" (set __BuildArch=arm&&shift&goto Arg_Loop)
+if /i "%1" == "arm64" (set __BuildArch=arm64&&shift&goto Arg_Loop)
if /i "%1" == "debug" (set __BuildType=Debug&shift&goto Arg_Loop)
if /i "%1" == "release" (set __BuildType=Release&shift&goto Arg_Loop)
@@ -144,6 +145,9 @@ if defined __MscorlibOnly goto PerformMScorlibBuild
echo Commencing build of native components for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
+rem arm64 builds currently use private toolset which has not been released yet
+if /i "%__BuildArch%" =="arm64" goto GenVSSolution
+
:: Set the environment for the native build
set __VCBuildArch=x86_amd64
if /i "%__BuildArch%" == "x86" (set __VCBuildArch=x86)
@@ -174,7 +178,13 @@ exit /b 1
REM Build CoreCLR
:BuildCoreCLR
set "__CoreCLRBuildLog=%__LogsDir%\CoreCLR_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
-%_msbuildexe% "%__IntermediatesDir%\install.vcxproj" %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=normal;LogFile="%__CoreCLRBuildLog%"
+if /i "%__BuildArch%" == "arm64" (
+ REM TODO, remove once we have msbuild support for this platform.
+
+ %_msbuildexe% "%__IntermediatesDir%\install.vcxproj" %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:UseEnv=true /fileloggerparameters:Verbosity=normal;LogFile="%__CoreCLRBuildLog%"
+) else (
+ %_msbuildexe% "%__IntermediatesDir%\install.vcxproj" %__MSBCleanBuildArgs% /nologo /maxcpucount /nodeReuse:false /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% /fileloggerparameters:Verbosity=normal;LogFile="%__CoreCLRBuildLog%"
+)
IF NOT ERRORLEVEL 1 goto PerformMScorlibBuild
echo Native component build failed. Refer !__CoreCLRBuildLog! for details.
exit /b 1
@@ -192,6 +202,8 @@ set Platform=
if defined __MscorlibOnly set __AdditionalMSBuildArgs=/p:BuildNugetPackage=false
+if /i "%__BuildArch%" =="arm64" set __AdditionalMSBuildArgs=/p:BuildNugetPackage=false
+
:: Set the environment for the managed build
call "!VS%__VSProductVersion%COMNTOOLS!\VsDevCmd.bat"
echo Commencing build of mscorlib for %__BuildOS%.%__BuildArch%.%__BuildType%
@@ -214,6 +226,13 @@ if /i "%__BuildArch%" == "x86" (
)
)
+if /i "%__BuildArch%" == "arm64" (
+ if not defined __DoCrossgen (
+ echo Skipping Crossgen
+ goto PerformTestBuild
+ )
+)
+
echo Generating native image of mscorlib for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
set "__CrossGenMScorlibLog=%__LogsDir%\CrossgenMScorlib_%__BuildOS%__%__BuildArch%__%__BuildType%.log"
diff --git a/crossgen.cmake b/crossgen.cmake
index 8845bb5..476e000 100644
--- a/crossgen.cmake
+++ b/crossgen.cmake
@@ -19,7 +19,9 @@ remove_definitions(
if(WIN32)
add_definitions(-MT)
- add_definitions(-DFEATURE_READYTORUN_COMPILER)
+ if(FEATURE_READYTORUN)
+ add_definitions(-DFEATURE_READYTORUN_COMPILER)
+ endif(FEATURE_READYTORUN)
endif(WIN32)
if(CLR_CMAKE_PLATFORM_LINUX)
diff --git a/src/ToolBox/SOS/CMakeLists.txt b/src/ToolBox/SOS/CMakeLists.txt
index a0c7a24..8cc9757 100644
--- a/src/ToolBox/SOS/CMakeLists.txt
+++ b/src/ToolBox/SOS/CMakeLists.txt
@@ -1,5 +1,7 @@
if(WIN32)
+if(NOT DEFINED CLR_CMAKE_PLATFORM_ARCH_ARM64)
add_subdirectory(Strike)
add_subdirectory(DacTableGen)
add_subdirectory(diasdk)
+endif(NOT DEFINED CLR_CMAKE_PLATFORM_ARCH_ARM64)
endif(WIN32)
diff --git a/src/debug/daccess/CMakeLists.txt b/src/debug/daccess/CMakeLists.txt
index f5dbbef..6b459b8 100644
--- a/src/debug/daccess/CMakeLists.txt
+++ b/src/debug/daccess/CMakeLists.txt
@@ -60,25 +60,10 @@ set(DACCESS_SOURCES
datatargetadapter.cpp
)
-if(CLR_CMAKE_PLATFORM_ARCH_AMD64)
- include_directories(amd64)
-
- list(APPEND DACCESS_SOURCES
- amd64/primitives.cpp
- )
-elseif(CLR_CMAKE_PLATFORM_ARCH_ARM)
- include_directories(arm)
-
+include_directories(${ARCH_SOURCES_DIR})
list(APPEND DACCESS_SOURCES
- arm/primitives.cpp
+ ${ARCH_SOURCES_DIR}/primitives.cpp
)
-elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
- include_directories(i386)
-
- list(APPEND DACCESS_SOURCES
- i386/primitives.cpp
- )
-endif()
convert_to_absolute_path(DACCESS_SOURCES ${DACCESS_SOURCES})
diff --git a/src/debug/ee/CMakeLists.txt b/src/debug/ee/CMakeLists.txt
index 1f27403..007b0ff 100644
--- a/src/debug/ee/CMakeLists.txt
+++ b/src/debug/ee/CMakeLists.txt
@@ -74,6 +74,8 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
list(APPEND CORDBEE_SOURCES_WKS i386/x86walker.cpp)
elseif(CLR_CMAKE_PLATFORM_ARCH_ARM)
list(APPEND CORDBEE_SOURCES_WKS arm/armwalker.cpp)
+elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ list(APPEND CORDBEE_SOURCES_WKS arm64/arm64walker.cpp)
endif()
convert_to_absolute_path(CORDBEE_SOURCES_DAC ${CORDBEE_SOURCES_DAC})
diff --git a/src/debug/ee/wks/CMakeLists.txt b/src/debug/ee/wks/CMakeLists.txt
index 2eea459..77fe998 100644
--- a/src/debug/ee/wks/CMakeLists.txt
+++ b/src/debug/ee/wks/CMakeLists.txt
@@ -17,10 +17,13 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj
DEPENDS ${CORDBEE_DIR}/${ARCH_SOURCES_DIR}/dbghelpers.asm
COMMENT "Compiling dbghelpers.asm")
-#mark obj as source that does not require compile
-set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj PROPERTIES EXTERNAL_OBJECT TRUE)
-
-add_library(cordbee_wks ${CORDBEE_SOURCES_WKS} ${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj)
+if(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ #mark obj as source that does not require compile
+ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj PROPERTIES EXTERNAL_OBJECT TRUE)
+ add_library(cordbee_wks ${CORDBEE_SOURCES_WKS})
+else()
+ add_library(cordbee_wks ${CORDBEE_SOURCES_WKS} ${CMAKE_CURRENT_BINARY_DIR}/dbghelpers.obj)
+endif()
else ()
diff --git a/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/dlls/mscoree/coreclr/CMakeLists.txt
index 297a411..98af591 100644
--- a/src/dlls/mscoree/coreclr/CMakeLists.txt
+++ b/src/dlls/mscoree/coreclr/CMakeLists.txt
@@ -124,22 +124,44 @@ endif(CLR_CMAKE_PLATFORM_LINUX)
target_link_libraries(coreclr ${CORECLR_LIBRARIES})
if(WIN32)
- add_dependencies(coreclr dactablegen)
-
# Add dac table & debug resource to coreclr
get_include_directories(INC_DIR)
get_compile_definitions(PREPROCESS_DEFINITIONS)
list(APPEND INC_DIR -I${CLR_DIR}/src/vm -I${CLR_DIR}/src/vm/${ARCH_SOURCES_DIR} -I${CLR_DIR}/src/debug/ee -I${CLR_DIR}/src/gc)
- list(APPEND PREPROCESS_DEFINITIONS -DDACCESS_COMPILE -DDBG_TARGET_64BIT=1 -DDBG_TARGET_WIN64=1 -DDBG_TARGET_AMD64=1)
- add_custom_command(TARGET coreclr
- POST_BUILD
- COMMAND ${CMAKE_CXX_COMPILER} /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp
- COMMAND $<TARGET_FILE:dactablegen_exe> /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/coreclr.pdb /dll:$<TARGET_FILE:coreclr> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin
- COMMAND $<TARGET_FILE:InjectResource> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$<TARGET_FILE:coreclr>
- COMMAND $<TARGET_FILE:GenClrDebugResource> /dac:$<TARGET_FILE:mscordaccore> /dbi:$<TARGET_FILE:mscordbi> /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin
- COMMAND $<TARGET_FILE:InjectResource> /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$<TARGET_FILE:coreclr> /name:CLRDEBUGINFO
- COMMENT Add dactable & debug resources to coreclr
- )
+ list(APPEND PREPROCESS_DEFINITIONS -DDACCESS_COMPILE -DDBG_TARGET_64BIT=1 -DDBG_TARGET_WIN64=1)
+
+
+ if(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ # TODO package these tools into a new buildtool nuget package to get cross compilation support.
+
+ #list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_ARM64=1)
+ #add_custom_command(TARGET coreclr
+ # POST_BUILD
+ # COMMAND cl.exe /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp
+ # COMMAND dactablegen.exe /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/coreclr.pdb /dll:$<TARGET_FILE:coreclr> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin
+ # COMMAND InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$<TARGET_FILE:coreclr>
+ # COMMAND GenClrDebugResource.exe /dac:$<TARGET_FILE:mscordaccore> /dbi:$<TARGET_FILE:mscordbi> /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin
+ # COMMAND InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$<TARGET_FILE:coreclr> /name:CLRDEBUGINFO
+ # COMMENT Add dactable & debug resources to coreclr
+ #)
+
+ else()
+ list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_AMD64=1)
+
+ add_dependencies(coreclr dactablegen)
+
+ add_custom_command(TARGET coreclr
+ POST_BUILD
+ COMMAND ${CMAKE_CXX_COMPILER} /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp
+ COMMAND $<TARGET_FILE:dactablegen_exe> /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/coreclr.pdb /dll:$<TARGET_FILE:coreclr> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin
+ COMMAND $<TARGET_FILE:InjectResource> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$<TARGET_FILE:coreclr>
+ COMMAND $<TARGET_FILE:GenClrDebugResource> /dac:$<TARGET_FILE:mscordaccore> /dbi:$<TARGET_FILE:mscordbi> /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin
+ COMMAND $<TARGET_FILE:InjectResource> /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$<TARGET_FILE:coreclr> /name:CLRDEBUGINFO
+ COMMENT Add dactable & debug resources to coreclr
+ )
+
+ endif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+
else()
add_custom_command(
TARGET coreclr
diff --git a/src/jit/utils.h b/src/jit/utils.h
index 951c874..5a0a3a0 100644
--- a/src/jit/utils.h
+++ b/src/jit/utils.h
@@ -47,7 +47,6 @@ inline const char* dspBool(bool b)
}
#ifdef FEATURE_CORECLR
-#ifndef CROSSGEN_COMPILE
#ifdef _CRT_ABS_DEFINED
// we don't have the full standard library
inline int64_t abs(int64_t t)
@@ -55,7 +54,6 @@ inline int64_t abs(int64_t t)
return t > 0 ? t : -t;
}
#endif
-#endif // !CROSSGEN_COMPILE
#endif // FEATURE_CORECLR
template <typename T> int signum(T val)
diff --git a/src/pal/tools/gen-buildsys-win.bat b/src/pal/tools/gen-buildsys-win.bat
index 2d0057e..0836268 100644
--- a/src/pal/tools/gen-buildsys-win.bat
+++ b/src/pal/tools/gen-buildsys-win.bat
@@ -18,6 +18,9 @@ if %basePath:~-1%==\ set "basePath=%basePath:~0,-1%"
set __VSString=12 2013
if /i "%2" == "vs2015" (set __VSString=14 2015)
if /i "%3" == "x64" (set __VSString=%__VSString% Win64)
+if /i "%3" == "arm64" (
+ set USE_VS=0
+)
if defined CMakePath goto DoGen
@@ -25,7 +28,11 @@ if defined CMakePath goto DoGen
for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy RemoteSigned "& .\probe-win.ps1"') do %%a
:DoGen
-"%CMakePath%" "-DCMAKE_USER_MAKE_RULES_OVERRIDE=%basePath%\windows-compiler-override.txt" "-DCLR_CMAKE_TARGET_ARCH=%3" -G "Visual Studio %__VSString%" %1
+if "%USE_VS%" == "0" (
+ "%CMakePath%" "-DCMAKE_USER_MAKE_RULES_OVERRIDE=%basePath%\windows-compiler-override.txt" "-DCLR_CMAKE_TARGET_ARCH=%3" -G "Visual Studio %__VSString% Win64" %1
+) else (
+ "%CMakePath%" "-DCMAKE_USER_MAKE_RULES_OVERRIDE=%basePath%\windows-compiler-override.txt" "-DCLR_CMAKE_TARGET_ARCH=%3" -G "Visual Studio %__VSString%" %1
+)
endlocal
GOTO :DONE
diff --git a/src/unwinder/CMakeLists.txt b/src/unwinder/CMakeLists.txt
index 3f81ebc..5ddbf42 100644
--- a/src/unwinder/CMakeLists.txt
+++ b/src/unwinder/CMakeLists.txt
@@ -11,28 +11,11 @@ set(UNWINDER_SOURCES
unwinder.cpp
)
-if(CLR_CMAKE_PLATFORM_ARCH_AMD64)
- include_directories(amd64)
-
+if(NOT DEFINED CLR_CMAKE_PLATFORM_ARCH_I386)
+ include_directories(${ARCH_SOURCES_DIR})
list(APPEND UNWINDER_SOURCES
- amd64/unwinder_amd64.cpp
+ ${ARCH_SOURCES_DIR}/unwinder_${ARCH_SOURCES_DIR}.cpp
)
-elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
-# nothing needed for x86
-elseif(CLR_CMAKE_PLATFORM_ARCH_ARM)
- include_directories(arm)
-
- list(APPEND UNWINDER_SOURCES
- arm/unwinder_arm.cpp
- )
-elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
- include_directories(arm64)
-
- list(APPEND UNWINDER_SOURCES
- arm64/unwinder_arm64.cpp
- )
-else()
- clr_unknown_arch()
endif()
convert_to_absolute_path(UNWINDER_SOURCES ${UNWINDER_SOURCES})
diff --git a/src/utilcode/CMakeLists.txt b/src/utilcode/CMakeLists.txt
index e452da8..117d479 100644
--- a/src/utilcode/CMakeLists.txt
+++ b/src/utilcode/CMakeLists.txt
@@ -82,17 +82,25 @@ if(WIN32)
lazycow.cpp
)
endif()
+
+ if(NOT DEFINED FEATURE_IMPLICIT_TLS)
+ list(APPEND UTILCODE_SOURCES
+ tls.cpp
+ )
+ endif(NOT DEFINED FEATURE_IMPLICIT_TLS)
endif(WIN32)
-
+
set(UTILCODE_SOURCES
${UTILCODE_COMMON_SOURCES}
perflog.cpp
)
if(WIN32)
- list(APPEND UTILCODE_SOURCES
- tls.cpp
- )
+ if(NOT DEFINED FEATURE_IMPLICIT_TLS)
+ list(APPEND UTILCODE_SOURCES
+ tls.cpp
+ )
+ endif(NOT DEFINED FEATURE_IMPLICIT_TLS)
endif()
set(UTILCODE_DAC_SOURCES
diff --git a/src/vm/CMakeLists.txt b/src/vm/CMakeLists.txt
index 9a5d878..9e9dd68 100644
--- a/src/vm/CMakeLists.txt
+++ b/src/vm/CMakeLists.txt
@@ -108,7 +108,6 @@ set(VM_SOURCES_DAC_AND_WKS_COMMON
perfmap.cpp
precode.cpp
prestub.cpp
- readytoruninfo.cpp
rejit.cpp
securitydescriptor.cpp
securitydescriptorassembly.cpp
@@ -133,6 +132,12 @@ set(VM_SOURCES_DAC_AND_WKS_COMMON
zapsig.cpp
)
+if(FEATURE_READYTORUN)
+ list(APPEND VM_SOURCES_DAC_AND_WKS_COMMON
+ readytoruninfo.cpp
+ )
+endif(FEATURE_READYTORUN)
+
set(VM_SOURCES_DAC
${VM_SOURCES_DAC_AND_WKS_COMMON}
contexts.cpp
@@ -338,9 +343,16 @@ elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
${ARCH_SOURCES_DIR}/gmsasm.asm
${ARCH_SOURCES_DIR}/jithelp.asm
)
+elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ set(VM_SOURCES_WKS_ARCH_ASM
+ ${ARCH_SOURCES_DIR}/AsmHelpers.asm
+ ${ARCH_SOURCES_DIR}/CallDescrWorkerARM64.asm
+ ${ARCH_SOURCES_DIR}/CrtHelpers.asm
+ ${ARCH_SOURCES_DIR}/PInvokeStubs.asm
+ )
endif()
-else()
+else(WIN32)
if(CLR_CMAKE_PLATFORM_ARCH_AMD64)
set(VM_SOURCES_WKS_ARCH_ASM
diff --git a/src/vm/crossgen/CMakeLists.txt b/src/vm/crossgen/CMakeLists.txt
index c112698..5bed679 100644
--- a/src/vm/crossgen/CMakeLists.txt
+++ b/src/vm/crossgen/CMakeLists.txt
@@ -65,7 +65,6 @@ set(VM_CROSSGEN_SOURCES
../pendingload.cpp
../precode.cpp
../olevariant.cpp
- ../readytoruninfo.cpp
../security.cpp
../securitypolicy.cpp
../securityattributes.cpp
@@ -98,6 +97,12 @@ set(VM_CROSSGEN_SOURCES
../crossgencompile.cpp
)
+if(FEATURE_READYTORUN)
+ list(APPEND VM_CROSSGEN_SOURCES
+ ../readytoruninfo.cpp
+ )
+endif(FEATURE_READYTORUN)
+
include_directories(BEFORE ..)
include_directories(${CLR_DIR}/src/gc)
diff --git a/src/vm/interpreter.cpp b/src/vm/interpreter.cpp
index 5ee4c7a..c93b377 100644
--- a/src/vm/interpreter.cpp
+++ b/src/vm/interpreter.cpp
@@ -11817,7 +11817,7 @@ void Interpreter::PrintValue(InterpreterType it, BYTE* valAddr)
{
fprintf(GetLogFile(), " ");
}
- fprintf(GetLogFile(), "0x%p", valAddr[i]);
+ fprintf(GetLogFile(), "0x%02x", valAddr[i]);
}
fprintf(GetLogFile(), "]");
}
diff --git a/src/vm/wks/CMakeLists.txt b/src/vm/wks/CMakeLists.txt
index 1b232b7..b0af9a6 100644
--- a/src/vm/wks/CMakeLists.txt
+++ b/src/vm/wks/CMakeLists.txt
@@ -4,6 +4,18 @@ if (WIN32)
set_source_files_properties(../mscorlib.cpp PROPERTIES COMPILE_FLAGS "/Y-")
# .c file cannot use cpp precompiled header
set_source_files_properties(../microsoft.comservices_i.c PROPERTIES COMPILE_FLAGS "/Y-")
+
+ # asm files require preprocessing using cl.exe on arm64
+ if(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ foreach(ASM_FILE ${VM_SOURCES_WKS_ARCH_ASM})
+ get_filename_component(name ${ASM_FILE} NAME_WE)
+ set(ASM_PREPROCESSED_FILE ${CMAKE_CURRENT_BINARY_DIR}/${name}.asm)
+ preprocess_def_file(${ASM_FILE} ${ASM_PREPROCESSED_FILE})
+ set(VM_SOURCES_WKS_ARM64_PREPROCESSED_ASM ${VM_SOURCES_WKS_ARM64_PREPROCESSED_ASM} ${ASM_PREPROCESSED_FILE})
+ endforeach()
+
+ set(VM_SOURCES_WKS_ARCH_ASM ${VM_SOURCES_WKS_ARM64_PREPROCESSED_ASM})
+ endif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
endif (WIN32)
add_library(cee_wks ${VM_SOURCES_WKS} ${VM_SOURCES_WKS_ARCH_ASM})
diff --git a/src/zap/crossgen/CMakeLists.txt b/src/zap/crossgen/CMakeLists.txt
index cebcd8c..edbf19e 100644
--- a/src/zap/crossgen/CMakeLists.txt
+++ b/src/zap/crossgen/CMakeLists.txt
@@ -17,12 +17,12 @@ set(ZAP_SOURCES
../nativeformatwriter.cpp
)
-if (WIN32)
+if (WIN32 AND FEATURE_READYTORUN)
list(APPEND ZAP_SOURCES
../zapreadytorun.cpp
../nativeformatwriter.cpp
)
-endif (WIN32)
+endif (WIN32 AND FEATURE_READYTORUN)
add_precompiled_header(common.h ../common.cpp ZAP_SOURCES)
add_library(corzap_crossgen STATIC ${ZAP_SOURCES})