1. Update arm64 toolset to latest.
2. Link against ucrt.
3. Fix tls offsets which have changed due to updated toolset
4. Fix source code in decimal.cpp to avoid integer overflow. Result of signed integer overlfow is undefined in C++.
5. Enable build of sos which can be loaded in arm64 windbg
6. Add nop to empty assembly marker methods as new toolset generates invalid .pdata for them.
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")
- else()
- # Force uCRT to be dynamically linked for Release build
- set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
- set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
- set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
- set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
endif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ # Force uCRT to be dynamically linked for Release build
+ set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
+ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
+ set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
+ set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
+
elseif (CLR_CMAKE_PLATFORM_UNIX)
# Set the values to display when interactively configuring CMAKE_BUILD_TYPE
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "DEBUG;CHECKED;RELEASE;RELWITHDEBINFO")
endif(CLR_CMAKE_PLATFORM_UNIX)
if (WIN32)
-
- # ARM64_TODO: Enable this for Windows Arm64
- if (NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
- # Define the CRT lib references that link into Desktop imports
- set(STATIC_MT_CRT_LIB "libcmt$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
- set(STATIC_MT_VCRT_LIB "libvcruntime$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
- set(STATIC_MT_CPP_LIB "libcpmt$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
-
- # Define the uCRT lib reference
- set(STATIC_UCRT_LIB "libucrt$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
- set(DYNAMIC_UCRT_LIB "ucrt$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
- else()
- # On Arm64, we will still use the legacy libraries for linking.
- set(STATIC_MT_CRT_LIB "msvcrt.lib")
- set(STATIC_MT_CPP_LIB "libcpmt$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
- endif()
-
+ # Define the CRT lib references that link into Desktop imports
+ set(STATIC_MT_CRT_LIB "libcmt$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
+ set(STATIC_MT_VCRT_LIB "libvcruntime$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
+ set(STATIC_MT_CPP_LIB "libcpmt$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
+
+ # Define the uCRT lib reference
+ set(STATIC_UCRT_LIB "libucrt$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
+ set(DYNAMIC_UCRT_LIB "ucrt$<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:d>.lib")
endif(WIN32)
# Architecture specific files folder name
exit /b 1
)
-set PATH=%__ToolsetDir%\cpp\bin;%PATH%
-set LIB=%__ToolsetDir%\cpp\libWin9CoreSystem;%__ToolsetDir%\OS\lib;%__ToolsetDir%\cpp\lib
+set PATH=%__ToolsetDir%\VC_sdk\bin;%PATH%
+set LIB=%__ToolsetDir%\VC_sdk\lib\arm64;%__ToolsetDir%\sdpublic\sdk\lib\arm64
set INCLUDE=^
-%__ToolsetDir%\cpp\inc;^
-%__ToolsetDir%\OS\inc\Windows;^
-%__ToolsetDir%\OS\inc\Windows\crt;^
-%__ToolsetDir%\cpp\inc\vc;^
-%__ToolsetDir%\OS\inc\win8
+%__ToolsetDir%\VC_sdk\inc;^
+%__ToolsetDir%\sdpublic\sdk\inc;^
+%__ToolsetDir%\sdpublic\shared\inc;^
+%__ToolsetDir%\sdpublic\shared\inc\minwin;^
+%__ToolsetDir%\sdpublic\sdk\inc\ucrt;^
+%__ToolsetDir%\sdpublic\sdk\inc\minwin;^
+%__ToolsetDir%\sdpublic\sdk\inc\mincore;^
+%__ToolsetDir%\sdpublic\sdk\inc\abi;^
+%__ToolsetDir%\sdpublic\sdk\inc\clientcore;^
+%__ToolsetDir%\diasdk\include
exit /b 0
add_compile_options($<$<CONFIG:Debug>:/homeparams>) # Force parameters passed in registers to be written to the stack
endif (CLR_CMAKE_PLATFORM_ARCH_AMD64)
- if(NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
- # enable control-flow-guard support for native components for non-Arm64 builds
- add_compile_options(/guard:cf)
-
- # Statically linked CRT (libcmt[d].lib, libvcruntime[d].lib and libucrt[d].lib) by default. This is done to avoid
- # linking in VCRUNTIME140.DLL for a simplified xcopy experience by reducing the dependency on VC REDIST.
- #
- # For Release builds, we shall dynamically link into uCRT [ucrtbase.dll] (which is pushed down as a Windows Update on downlevel OS) but
- # wont do the same for debug/checked builds since ucrtbased.dll is not redistributable and Debug/Checked builds are not
- # production-time scenarios.
- add_compile_options($<$<OR:$<CONFIG:Release>,$<CONFIG:Relwithdebinfo>>:/MT>)
- add_compile_options($<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:/MTd>)
- endif (NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ # enable control-flow-guard support for native components for non-Arm64 builds
+ add_compile_options(/guard:cf)
+
+ # Statically linked CRT (libcmt[d].lib, libvcruntime[d].lib and libucrt[d].lib) by default. This is done to avoid
+ # linking in VCRUNTIME140.DLL for a simplified xcopy experience by reducing the dependency on VC REDIST.
+ #
+ # For Release builds, we shall dynamically link into uCRT [ucrtbase.dll] (which is pushed down as a Windows Update on downlevel OS) but
+ # wont do the same for debug/checked builds since ucrtbased.dll is not redistributable and Debug/Checked builds are not
+ # production-time scenarios.
+ add_compile_options($<$<OR:$<CONFIG:Release>,$<CONFIG:Relwithdebinfo>>:/MT>)
+ add_compile_options($<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:/MTd>)
+
endif (WIN32)
if(CMAKE_ENABLE_CODE_COVERAGE)
// Debug runs take too long to run. So build job only.
if (lowerConfiguration == "debug") {
- buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} /toolset_dir C:\\ats"
+ buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} /toolset_dir C:\\ats2"
}
else {
- buildCommands += "set __TestIntermediateDir=int&&build.cmd skiptests ${lowerConfiguration} ${architecture} /toolset_dir C:\\ats"
+ buildCommands += "set __TestIntermediateDir=int&&build.cmd skiptests ${lowerConfiguration} ${architecture} /toolset_dir C:\\ats2"
// Test build and run are launched together.
buildCommands += "Z:\\arm64\\common\\scripts\\arm64PostLauncher.cmd %WORKSPACE% ${architecture} ${lowerConfiguration}"
Utilities.addXUnitDotNETResults(newJob, 'bin/tests/testResults.xml')
if(WIN32)
-if(NOT DEFINED CLR_CMAKE_PLATFORM_ARCH_ARM64)
add_subdirectory(Strike)
-endif(NOT DEFINED CLR_CMAKE_PLATFORM_ARCH_ARM64)
endif(WIN32)
dbgutil
${STATIC_MT_CRT_LIB}
${STATIC_MT_CPP_LIB}
+ ${STATIC_MT_VCRT_LIB}
kernel32.lib
user32.lib
ole32.lib
psapi.lib
ntdll.lib
)
-
- # ARM64_TODO: Enable this for Windows Arm64
- if (NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
- list(APPEND SOS_LIBRARY
- ${STATIC_MT_VCRT_LIB}
- )
- endif()
-
else(WIN32)
add_definitions(-DFEATURE_ENABLE_HARDWARE_EXCEPTIONS)
add_definitions(-DPAL_STDCPP_COMPAT=1)
if (i >= 0) return i;
}
else {
+ // Int32.MinValue is represented as sign being negative
+ // and Lo32 being 0x80000000 (-ve number). Return that as is without
+ // reversing the sign of the number.
+ if(i == 0x80000000) return i;
i = -i;
if (i <= 0) return i;
}
list(APPEND DBGSHIM_LIBRARIES
kernel32.lib
${STATIC_MT_CRT_LIB}
+ ${STATIC_MT_VCRT_LIB}
uuid.lib
user32.lib
advapi32.lib
version.lib
psapi.lib
)
-
- # ARM64_TODO: Enable this for Windows Arm64
- if (NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
- list(APPEND DBGSHIM_LIBRARIES
- ${STATIC_MT_VCRT_LIB}
- )
- endif()
-
else()
list(APPEND DBGSHIM_LIBRARIES
coreclrpal
uuid.lib
user32.lib
${STATIC_MT_CRT_LIB}
+ ${STATIC_MT_VCRT_LIB}
)
-
- # ARM64_TODO: Enable this for Windows Arm64
- if (NOT CLR_CMAKE_TARGET_ARCH_ARM64)
- list(APPEND COREDAC_LIBRARIES
- ${STATIC_MT_VCRT_LIB}
- )
- endif()
-
else(WIN32)
list(APPEND COREDAC_LIBRARIES
mscorrc_debug
user32.lib
version.lib
${STATIC_MT_CRT_LIB}
+ ${STATIC_MT_VCRT_LIB}
)
- # ARM64_TODO: Enable this for Windows Arm64
- if (NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
- list(APPEND COREDBI_LIBRARIES
- ${STATIC_MT_VCRT_LIB}
- )
- endif()
-
target_link_libraries(mscordbi ${COREDBI_LIBRARIES})
elseif(CLR_CMAKE_PLATFORM_UNIX)
#ifdef FEATURE_IMPLICIT_TLS
#ifdef _WIN64
-#define OFFSETOF__TLS__tls_CurrentThread 0x08
-#define OFFSETOF__TLS__tls_EETlsData 0x18
-#else
-#define OFFSETOF__TLS__tls_CurrentThread 0x04
-#define OFFSETOF__TLS__tls_EETlsData 0x0c
+#ifndef _DEBUG
+#define OFFSETOF__TLS__tls_ThreadLocalInfo 0x10
+#else // _DEBUG
+#define OFFSETOF__TLS__tls_ThreadLocalInfo 0x08
+#endif // _DEBUG
+#else // _WIN64
+#define OFFSETOF__TLS__tls_ThreadLocalInfo 0x04
#endif // _WIN64
+#define OFFSETOF__TLS__tls_CurrentThread (OFFSETOF__TLS__tls_ThreadLocalInfo+0x0)
+#define OFFSETOF__TLS__tls_EETlsData (OFFSETOF__TLS__tls_CurrentThread+2*sizeof(void*))
+
+
#ifdef _TARGET_WIN64_
#define WINNT_OFFSETOF__TEB__ThreadLocalStoragePointer 0x58
#else
target_link_libraries(GenClrDebugResource
${STATIC_MT_CRT_LIB}
+ ${STATIC_MT_VCRT_LIB}
)
-
-# ARM64_TODO: Enable this for Windows Arm64
-if (NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
- target_link_libraries(GenClrDebugResource ${STATIC_MT_VCRT_LIB})
-endif()
\ No newline at end of file
target_link_libraries(InjectResource
${STATIC_MT_CRT_LIB}
-)
-
-# ARM64_TODO: Enable this for Windows Arm64
-if (NOT CLR_CMAKE_PLATFORM_ARCH_ARM64)
- target_link_libraries(InjectResource ${STATIC_MT_VCRT_LIB})
-endif()
\ No newline at end of file
+ ${STATIC_MT_VCRT_LIB}
+)
\ No newline at end of file
LEAF_END
LEAF_ENTRY JIT_MemSet_End
+ nop
LEAF_END
LEAF_END
LEAF_ENTRY JIT_MemCpy_End
+ nop
LEAF_END
; Must be at very end of file
exit /b 1
)
-set PATH=%__ToolsetDir%\cpp\bin;%PATH%
-set LIB=%__ToolsetDir%\cpp\libWin9CoreSystem;%__ToolsetDir%\OS\lib;%__ToolsetDir%\cpp\lib
+set PATH=%__ToolsetDir%\VC_sdk\bin;%PATH%
+set LIB=%__ToolsetDir%\VC_sdk\lib\arm64;%__ToolsetDir%\sdpublic\sdk\lib\arm64
set INCLUDE=^
-%__ToolsetDir%\cpp\inc;^
-%__ToolsetDir%\OS\inc\Windows;^
-%__ToolsetDir%\OS\inc\Windows\crt;^
-%__ToolsetDir%\cpp\inc\vc;^
-%__ToolsetDir%\OS\inc\win8
+%__ToolsetDir%\VC_sdk\inc;^
+%__ToolsetDir%\sdpublic\sdk\inc;^
+%__ToolsetDir%\sdpublic\shared\inc;^
+%__ToolsetDir%\sdpublic\shared\inc\minwin;^
+%__ToolsetDir%\sdpublic\sdk\inc\ucrt;^
+%__ToolsetDir%\sdpublic\sdk\inc\minwin;^
+%__ToolsetDir%\sdpublic\sdk\inc\mincore;^
+%__ToolsetDir%\sdpublic\sdk\inc\abi;^
+%__ToolsetDir%\sdpublic\sdk\inc\clientcore;^
+%__ToolsetDir%\diasdk\include
exit /b 0