Skip to content

Commit 09d436a

Browse files
committed
Merge branch 'master' into merge_master
2 parents be5e1a1 + c8a49ac commit 09d436a

File tree

629 files changed

+19961
-14322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

629 files changed

+19961
-14322
lines changed

.gitattributes

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt text eol=lf
6969

7070
tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna-input25.txt text eol=lf
7171
tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna-input25000.txt text eol=lf
72-
tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp-input25.txt text eol=lf
73-
tests/src/JIT/Performance/CodeQuality/BenchmarksGame/revcomp/revcomp-input25000.txt text eol=lf
72+
tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regex-redux/regexdna-input25.txt text eol=lf
73+
tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regex-redux/regexdna-input25000.txt text eol=lf
74+
tests/src/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/revcomp-input25.txt text eol=lf
75+
tests/src/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/revcomp-input25000.txt text eol=lf
7476
tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/knucleotide-input.txt text eol=lf
7577
tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/knucleotide-input-big.txt text eol=lf
7678

CMakeLists.txt

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ endif()
4343
# Ensure other tools are present
4444
if (WIN32)
4545
if(CLR_CMAKE_HOST_ARCH STREQUAL arm)
46-
46+
4747
# Confirm that Windows SDK is present
4848
if(NOT DEFINED CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION OR CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION STREQUAL "" )
4949
message(FATAL_ERROR "Windows SDK is required for the Arm32 build.")
@@ -57,9 +57,9 @@ if (WIN32)
5757
else()
5858
file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\HostX86\\arm\\armasm.exe" CMAKE_ASM_COMPILER)
5959
endif()
60-
60+
6161
set(CMAKE_ASM_MASM_COMPILER ${CMAKE_ASM_COMPILER})
62-
message("CMAKE_ASM_MASM_COMPILER explicitly set to: ${CMAKE_ASM_MASM_COMPILER}")
62+
message("CMAKE_ASM_MASM_COMPILER explicitly set to: ${CMAKE_ASM_MASM_COMPILER}")
6363

6464
# Enable generic assembly compilation to avoid CMake generate VS proj files that explicitly
6565
# use ml[64].exe as the assembler.
@@ -75,13 +75,13 @@ if (WIN32)
7575
endif()
7676

7777
if (CLR_CMAKE_HOST_ARCH STREQUAL arm64)
78-
# CMAKE_CXX_COMPILER will default to the compiler installed with
79-
# Visual studio. Overwrite it to the compiler on the path.
80-
# TODO, remove when cmake generator supports Arm64 as a target.
81-
find_program(PATH_CXX_COMPILER cl)
82-
set(CMAKE_CXX_COMPILER ${PATH_CXX_COMPILER})
83-
message("Overwriting the CMAKE_CXX_COMPILER.")
84-
message(CMAKE_CXX_COMPILER found:${CMAKE_CXX_COMPILER})
78+
# CMAKE_CXX_COMPILER will default to the compiler installed with
79+
# Visual studio. Overwrite it to the compiler on the path.
80+
# TODO, remove when cmake generator supports Arm64 as a target.
81+
find_program(PATH_CXX_COMPILER cl)
82+
set(CMAKE_CXX_COMPILER ${PATH_CXX_COMPILER})
83+
message("Overwriting the CMAKE_CXX_COMPILER.")
84+
message(CMAKE_CXX_COMPILER found:${CMAKE_CXX_COMPILER})
8585
endif()
8686

8787
else (WIN32)
@@ -97,7 +97,7 @@ else (WIN32)
9797
# but the generated executables won't work on a system where PAX is set
9898
# to prevent applications to create executable memory mappings.
9999
find_program(PAXCTL paxctl)
100-
100+
101101
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
102102

103103
# Ensure that dsymutil and strip are present
@@ -155,7 +155,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
155155
endif()
156156
else()
157157
# CMAKE_SYSTEM_PROCESSOR returns the value of `uname -p` on target.
158-
# For the AMD/Intel 64bit architecure two different strings are common.
158+
# For the AMD/Intel 64bit architecture two different strings are common.
159159
# Linux and Darwin identify it as "x86_64" while FreeBSD and netbsd uses the
160160
# "amd64" string. Accept either of the two here.
161161
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL amd64)
@@ -330,13 +330,13 @@ if (WIN32)
330330
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO") #Do not create Side-by-Side Assembly Manifest
331331

332332
if (CLR_CMAKE_PLATFORM_ARCH_ARM)
333-
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.02") #windows subsystem - arm minimum is 6.02
333+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.02") #windows subsystem - arm minimum is 6.02
334334
elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
335-
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.03") #windows subsystem - arm64 minimum is 6.03
335+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.03") #windows subsystem - arm64 minimum is 6.03
336336
else ()
337337
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.01") #windows subsystem
338338
endif ()
339-
339+
340340
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE") # can handle addresses larger than 2 gigabytes
341341
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NXCOMPAT") #Compatible with Data Execution Prevention
342342
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DYNAMICBASE") #Use address space layout randomization
@@ -379,11 +379,11 @@ if (WIN32)
379379
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /machine:arm64")
380380
endif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
381381

382-
# Force uCRT to be dynamically linked for Release build
383-
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
384-
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
385-
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
386-
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
382+
# Force uCRT to be dynamically linked for Release build
383+
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
384+
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
385+
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
386+
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
387387

388388
elseif (CLR_CMAKE_PLATFORM_UNIX)
389389
# Set the values to display when interactively configuring CMAKE_BUILD_TYPE
@@ -446,11 +446,11 @@ elseif (CLR_CMAKE_PLATFORM_UNIX)
446446
endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
447447
endif(WIN32)
448448

449-
if(CLR_CMAKE_PLATFORM_LINUX)
449+
if(CLR_CMAKE_PLATFORM_LINUX)
450450
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,--noexecstack")
451451
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id=sha1")
452452
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id=sha1")
453-
endif(CLR_CMAKE_PLATFORM_LINUX)
453+
endif(CLR_CMAKE_PLATFORM_LINUX)
454454

455455
#------------------------------------
456456
# Definitions (for platform)
@@ -505,9 +505,9 @@ if (CLR_CMAKE_PLATFORM_UNIX)
505505
message("Detected FreeBSD amd64")
506506
endif(CLR_CMAKE_PLATFORM_FREEBSD)
507507

508-
if(CLR_CMAKE_PLATFORM_NETBSD)
509-
message("Detected NetBSD amd64")
510-
endif(CLR_CMAKE_PLATFORM_NETBSD)
508+
if(CLR_CMAKE_PLATFORM_NETBSD)
509+
message("Detected NetBSD amd64")
510+
endif(CLR_CMAKE_PLATFORM_NETBSD)
511511
endif(CLR_CMAKE_PLATFORM_UNIX)
512512

513513
if (WIN32)
@@ -578,7 +578,7 @@ endif()
578578

579579
# Above projects do not build with these compile options
580580
# All of the compiler options are specified in file compileoptions.cmake
581-
# Do not add any new options here. They shoul be added in compileoptions.cmake
581+
# Do not add any new options here. They should be added in compileoptions.cmake
582582
if(WIN32)
583583
add_compile_options(/FIWarningControl.h) # force include of WarningControl.h
584584
add_compile_options(/Zl) # omit default library name in .OBJ

Documentation/botr/clr-abi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ NOTE: This optimization is now disabled for all platforms (`IsStructRequiringSta
7575

7676
## Hidden parameters
7777

78-
*Stub dispatch* - when a virtual call uses a VSD stub, rather than back-patching the calling code (or disassembling it), the JIT must place the address of the stub used to load the call target, the "stub indirection cell", in (x86) `EAX` / (AMD64) `R11` / (ARM) `R4` / (ARM64) `R11`. In the JIT, this is `REG_VIRTUAL_STUB_PARAM`.
78+
*Stub dispatch* - when a virtual call uses a VSD stub, rather than back-patching the calling code (or disassembling it), the JIT must place the address of the stub used to load the call target, the "stub indirection cell", in (x86) `EAX` / (AMD64) `R11` / (AMD64 CoreRT ABI) `R10` / (ARM) `R4` / (ARM CoreRT ABI) `R12` / (ARM64) `R11`. In the JIT, this is encapsulated in the `VirtualStubParamInfo` class.
7979

8080
AMD64-only: Fast Pinvoke - The VM wants a conservative estimate of the size of the stack arguments placed in `R11`. (This is consumed by callout stubs used in SQL hosting).
8181

@@ -119,7 +119,7 @@ For IL stubs only, the per-frame initialization includes setting `Thread->m_pFra
119119
2. For JIT64/AMD64 only: Next for non-IL stubs, the InlinedCallFrame is 'pushed' by setting `Thread->m_pFrame` to point to the InlinedCallFrame (recall that the per-frame initialization already set `InlinedCallFrame->m_pNext` to point to the previous top). For IL stubs this step is accomplished in the per-frame initialization.
120120
3. The Frame is made active by setting `InlinedCallFrame->m_pCallerReturnAddress`.
121121
4. The code then toggles the GC mode by setting `Thread->m_fPreemptiveGCDisabled = 0`.
122-
5. Starting now, no GC pointers may be live in registers.
122+
5. Starting now, no GC pointers may be live in registers. RyuJit LSRA meets this requirement by adding special refPositon `RefTypeKillGCRefs` before unmanaged calls and special helpers.
123123
6. Then comes the actual call/PInvoke.
124124
7. The GC mode is set back by setting `Thread->m_fPreemptiveGCDisabled = 1`.
125125
8. Then we check to see if `g_TrapReturningThreads` is set (non-zero). If it is, we call `CORINFO_HELP_STOP_FOR_GC`.

Documentation/building/cross-building.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
Cross Compilation for ARM on Windows
2+
==================================
3+
4+
Building ARM for Windows can be done using cross compilation.
5+
6+
Requirements
7+
------------
8+
9+
Install the ARM tools and Windows SDK, as described [here](https://github.com/dotnet/coreclr/blob/master/Documentation/building/windows-instructions.md).
10+
11+
Cross compiling CoreCLR
12+
-----------------------
13+
14+
Build using "-arm" as the architecture. For example:
15+
16+
C:\coreclr> build.cmd -arm -debug
17+
18+
119
Cross Compilation for ARM on Linux
220
==================================
321

Documentation/building/windows-instructions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ For Visual Studio 2017:
4545
* Visual Studio C++ core features
4646
* Under "SDKs, libraries, and frameworks":
4747
* Windows 10 SDK or Windows 8.1 SDK
48-
* To build for Arm32, Make sure that you have the Windows 10 SDK installed (or selected to be installed as part of VS installation). To explicitly install Windows SDK, download it from here: [Windows SDK for Windows 10](https://developer.microsoft.com/en-us/windows/downloads)
48+
* To build for Arm32, Make sure that you have the Windows 10 SDK installed (or selected to be installed as part of VS installation). To explicitly install Windows SDK, download it from here: [Windows SDK for Windows 10](https://developer.microsoft.com/en-us/windows/downloads).
49+
* In addition, ensure you install the ARM tools. In the "Individual components" window, in the "Compilers, build tools, and runtimes" section, check the box for "Visual C++ compilers and libraries for ARM".
4950
* **Important:** You must have the `msdia120.dll` COM Library registered in order to build the repository.
5051
* This binary is registered by default when installing the "VC++ Tools" with Visual Studio 2015
5152
* You can also manually register the binary by launching the "Developer Command Prompt for VS2017" with Administrative privileges and running `regsvr32.exe "%VSINSTALLDIR%\Common7\IDE\msdia120.dll"`

Documentation/project-docs/linux-performance-tracing.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Performance Tracing on Linux
1+
Performance Tracing on Linux
22
============================
33

44
When a performance problem is encountered on Linux, these instructions can be used to gather detailed information about what was happening on the machine at the time of the performance problem.
@@ -81,6 +81,26 @@ Follow these steps to prepare your machine to collect a performance trace.
8181

8282
The compressed trace file is now stored in the current working directory.
8383

84+
# Resolving Framework Symbols #
85+
Framework symbols need to be manually generated at the time the trace is collected. They are different than app-level symbols because the framework is pre-compiled while apps are just-in-time-compiled.
86+
87+
The easiest way to generate framework symbols is to have perfcollect do it for you automatically when the trace is collected. To do this, crossgen must be present on the collection machine and located next to libcoreclr.so. This can be done manually using the following steps:
88+
89+
1. Download the CoreCLR nuget package. A simple way to do this is to create a self-contained version of your application using the dotnet CLI:
90+
> ```bash
91+
> dotnet publish --self-contained -r linux-x64
92+
> ```
93+
94+
This will create a bin/*/netcoreapp2.0/Linux-x64/publish directory which contains all of the files required to run your app including the .NET runtime and framework. As a side-effect, the dotnet CLI downloads and extracts the CoreCLR nuget package. You should be able to find crossgen at:
95+
96+
> ```bash
97+
> ~/packages/runtime.linux-x64.microsoft.netcore.app/2.0.0/tools/crossgen
98+
> ```
99+
100+
2. Copy crossgen next to libcoreclr.so. If you run your application out of the publish directory, you can copy it into the directory that you just created during step # 1. If you run your application using the dotnet CLI, then you likely need to copy it to /usr/share/dotnet/shared/Microsoft.NETCore.App/<Version> where <Version> is the version number of CoreCLR. This should match the version number in the path to crossgen from step # 1.
101+
102+
Now, traces containing apps that were run on the updated runtime should contain framework-level symbols. To view the trace with framework-level symbols, you will need to use PerfView. Details on using PerfView to view a trace are available below in this document.
103+
84104
# Collecting in a Docker Container #
85105
Perfcollect can be used to collect data for an application running inside a Docker container. The main thing to know is that collecting a trace requires elevated privileges because the [default seccomp profile](https://docs.docker.com/engine/security/seccomp/) blocks a required syscall - perf_events_open.
86106

build-test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ initTargetDistroRid()
3737
export __DistroRid="osx-$__BuildArch"
3838
fi
3939
fi
40+
41+
if [ "$ID.$VERSION_ID" == "ubuntu.16.04" ]; then
42+
export __DistroRid="ubuntu.14.04-$__BuildArch"
43+
fi
4044
}
4145

4246
isMSBuildOnNETCoreSupported()

build.cmd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ if not exist "%__BinDir%" md "%__BinDir%"
273273
if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
274274
if not exist "%__LogsDir%" md "%__LogsDir%"
275275

276-
REM It is convinient to have your Nuget search path include the location where the build
277-
REM will plass packages. However nuget used during the build will fail if that directory
278-
REM does not exist. Avoid this in at least one case by agressively creating the directory.
276+
REM It is convenient to have your Nuget search path include the location where the build
277+
REM will place packages. However nuget used during the build will fail if that directory
278+
REM does not exist. Avoid this in at least one case by aggressively creating the directory.
279279
if not exist "%__BinDir%\.nuget\pkg" md "%__BinDir%\.nuget\pkg"
280280

281281
echo %__MsgPrefix%Commencing CoreCLR Repo build
@@ -296,7 +296,7 @@ echo %__MsgPrefix%Using environment: "%__VSToolsRoot%\VsDevCmd.bat"
296296
call "%__VSToolsRoot%\VsDevCmd.bat"
297297
@if defined _echo @echo on
298298

299-
@call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\build.proj -generateHeaderWindows -NativeVersionHeaderFile="%__RootBinDir%\obj\_version.h" %__RunArgs% %__UnprocessedBuildArgs%
299+
@call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\build.proj -generateHeaderWindows -NativeVersionHeaderFile="%__RootBinDir%\obj\_version.h" %__RunArgs% %__UnprocessedBuildArgs%
300300

301301
REM =========================================================================================
302302
REM ===
@@ -342,7 +342,7 @@ if %__BuildNative% EQU 1 (
342342
set nativePlatfromArgs=-platform=%__BuildArch%
343343
if /i "%__BuildArch%" == "arm64" ( set nativePlatfromArgs=-useEnv )
344344

345-
if /i "%__BuildArch%" == "arm64" (
345+
if /i "%__BuildArch%" == "arm64" (
346346
rem arm64 builds currently use private toolset which has not been released yet
347347
REM TODO, remove once the toolset is open.
348348
call :PrivateToolSet
@@ -354,7 +354,7 @@ if %__BuildNative% EQU 1 (
354354
if /i "%__BuildArch%" == "x86" ( set __VCBuildArch=x86 )
355355
if /i "%__BuildArch%" == "arm" (
356356
set __VCBuildArch=x86_arm
357-
357+
358358
REM Make CMake pick the highest installed version in the 10.0.* range
359359
set ___SDKVersion="-DCMAKE_SYSTEM_VERSION=10.0"
360360
)
@@ -474,7 +474,7 @@ if /i "%__DoCrossArchBuild%"=="1" (
474474
echo !__BuildWrn!
475475
echo !__BuildErr!
476476
exit /b 1
477-
)
477+
)
478478

479479
:SkipCrossCompBuild
480480
REM } Scope environment changes end
@@ -632,7 +632,7 @@ if %__BuildTests% EQU 1 (
632632

633633
rem arm64 builds currently use private toolset which has not been released yet
634634
REM TODO, remove once the toolset is open.
635-
if /i "%__BuildArch%" == "arm64" call :PrivateToolSet
635+
if /i "%__BuildArch%" == "arm64" call :PrivateToolSet
636636

637637
set NEXTCMD=call %__ProjectDir%\build-test.cmd %__BuildArch% %__BuildType% %__UnprocessedBuildArgs%
638638
echo %__MsgPrefix%!NEXTCMD!
@@ -642,7 +642,7 @@ if %__BuildTests% EQU 1 (
642642
REM buildtest.cmd has already emitted an error message and mentioned the build log file to examine.
643643
exit /b 1
644644
)
645-
)
645+
)
646646

647647
REM =========================================================================================
648648
REM ===

0 commit comments

Comments
 (0)