Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 3eb625e

Browse files
authored
Merge pull request #14892 from weshaggard/MergeDevRelease20-rel
Merge dev/release/2.0.0 into release/2.0.0
2 parents 0757752 + 9546256 commit 3eb625e

32 files changed

+464
-281
lines changed

BuildToolsVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0-servicing-02012-01
1+
2.0.0-servicing-02213-03

CMakeLists.txt

Lines changed: 31 additions & 27 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.")
@@ -52,11 +52,15 @@ if (WIN32)
5252
endif()
5353

5454
# Explicitly specify the assembler to be used for Arm32 compile
55-
file(TO_CMAKE_PATH "$ENV{VCINSTALLDIR}\\bin\\x86_arm\\armasm.exe" CMAKE_ASM_COMPILER)
56-
57-
set(CMAKE_ASM_MASM_COMPILER ${CMAKE_ASM_COMPILER})
58-
message("CMAKE_ASM_MASM_COMPILER explicitly set to: ${CMAKE_ASM_MASM_COMPILER}")
55+
if($ENV{__VSVersion} STREQUAL "vs2015")
56+
file(TO_CMAKE_PATH "$ENV{VCINSTALLDIR}\\bin\\x86_arm\\armasm.exe" CMAKE_ASM_COMPILER)
57+
else()
58+
file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\HostX86\\arm\\armasm.exe" CMAKE_ASM_COMPILER)
59+
endif()
5960

61+
set(CMAKE_ASM_MASM_COMPILER ${CMAKE_ASM_COMPILER})
62+
message("CMAKE_ASM_MASM_COMPILER explicitly set to: ${CMAKE_ASM_MASM_COMPILER}")
63+
6064
# Enable generic assembly compilation to avoid CMake generate VS proj files that explicitly
6165
# use ml[64].exe as the assembler.
6266
enable_language(ASM)
@@ -71,13 +75,13 @@ if (WIN32)
7175
endif()
7276

7377
if (CLR_CMAKE_HOST_ARCH STREQUAL arm64)
74-
# CMAKE_CXX_COMPILER will default to the compiler installed with
75-
# Visual studio. Overwrite it to the compiler on the path.
76-
# TODO, remove when cmake generator supports Arm64 as a target.
77-
find_program(PATH_CXX_COMPILER cl)
78-
set(CMAKE_CXX_COMPILER ${PATH_CXX_COMPILER})
79-
message("Overwriting the CMAKE_CXX_COMPILER.")
80-
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})
8185
endif()
8286

8387
else (WIN32)
@@ -88,7 +92,7 @@ else (WIN32)
8892
if (AWK STREQUAL "AWK-NOTFOUND")
8993
message(FATAL_ERROR "AWK not found")
9094
endif()
91-
95+
9296
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
9397

9498
# Ensure that dsymutil and strip are present
@@ -321,13 +325,13 @@ if (WIN32)
321325
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO") #Do not create Side-by-Side Assembly Manifest
322326

323327
if (CLR_CMAKE_PLATFORM_ARCH_ARM)
324-
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.02") #windows subsystem - arm minimum is 6.02
328+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.02") #windows subsystem - arm minimum is 6.02
325329
elseif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
326-
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.03") #windows subsystem - arm64 minimum is 6.03
330+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.03") #windows subsystem - arm64 minimum is 6.03
327331
else ()
328332
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,6.01") #windows subsystem
329333
endif ()
330-
334+
331335
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE") # can handle addresses larger than 2 gigabytes
332336
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NXCOMPAT") #Compatible with Data Execution Prevention
333337
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DYNAMICBASE") #Use address space layout randomization
@@ -366,11 +370,11 @@ if (WIN32)
366370
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /machine:arm64")
367371
endif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
368372

369-
# Force uCRT to be dynamically linked for Release build
370-
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
371-
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
372-
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
373-
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
373+
# Force uCRT to be dynamically linked for Release build
374+
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
375+
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
376+
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
377+
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
374378

375379
elseif (CLR_CMAKE_PLATFORM_UNIX)
376380
# Set the values to display when interactively configuring CMAKE_BUILD_TYPE
@@ -433,11 +437,11 @@ elseif (CLR_CMAKE_PLATFORM_UNIX)
433437
endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED)
434438
endif(WIN32)
435439

436-
if(CLR_CMAKE_PLATFORM_LINUX)
440+
if(CLR_CMAKE_PLATFORM_LINUX)
437441
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,--noexecstack")
438442
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id=sha1")
439443
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id=sha1")
440-
endif(CLR_CMAKE_PLATFORM_LINUX)
444+
endif(CLR_CMAKE_PLATFORM_LINUX)
441445

442446
#------------------------------------
443447
# Definitions (for platform)
@@ -492,9 +496,9 @@ if (CLR_CMAKE_PLATFORM_UNIX)
492496
message("Detected FreeBSD amd64")
493497
endif(CLR_CMAKE_PLATFORM_FREEBSD)
494498

495-
if(CLR_CMAKE_PLATFORM_NETBSD)
496-
message("Detected NetBSD amd64")
497-
endif(CLR_CMAKE_PLATFORM_NETBSD)
499+
if(CLR_CMAKE_PLATFORM_NETBSD)
500+
message("Detected NetBSD amd64")
501+
endif(CLR_CMAKE_PLATFORM_NETBSD)
498502
endif(CLR_CMAKE_PLATFORM_UNIX)
499503

500504
if (WIN32)
@@ -601,7 +605,7 @@ include(clrdefinitions.cmake)
601605

602606
# Microsoft.Dotnet.BuildTools.Coreclr version
603607
set(BuildToolsVersion "1.0.4-prerelease")
604-
set(BuildToolsDir "${CLR_DIR}/packages/Microsoft.DotNet.BuildTools.CoreCLR/${BuildToolsVersion}")
608+
set(BuildToolsDir "${CLR_CMAKE_PACKAGES_DIR}/Microsoft.DotNet.BuildTools.CoreCLR/${BuildToolsVersion}")
605609

606610
#------------------------------
607611
# Add Product Directory

DotnetCLIVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0-preview1-005724
1+
2.0.0

build-packages.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ initHostDistroRid()
1616
if [ "$__HostOS" == "Linux" ]; then
1717
if [ -e /etc/os-release ]; then
1818
source /etc/os-release
19+
if [[ $ID == "alpine" || $ID == "rhel" ]]; then
20+
# remove the last version digit
21+
VERSION_ID=${VERSION_ID%.*}
22+
fi
1923
__HostDistroRid="$ID.$VERSION_ID-$__Arch"
2024
elif [ -e /etc/redhat-release ]; then
2125
local redhatRelease=$(</etc/redhat-release)

build-test.cmd

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ set __BuildOS=Windows_NT
2222
:: is already configured to use that toolset. Otherwise, we will fallback to using the VS2015
2323
:: toolset if it is installed. Finally, we will fail the script if no supported VS instance
2424
:: can be found.
25+
if defined VisualStudioVersion goto :Run
26+
27+
set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
28+
if exist %_VSWHERE% (
29+
for /f "usebackq tokens=*" %%i in (`%_VSWHERE% -latest -property installationPath`) do set _VSCOMNTOOLS=%%i\Common7\Tools
30+
)
31+
if not exist "%_VSCOMNTOOLS%" set _VSCOMNTOOLS=%VS140COMNTOOLS%
32+
if not exist "%_VSCOMNTOOLS%" (
33+
echo Error: Visual Studio 2015 or 2017 required.
34+
echo Please see https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
35+
exit /b 1
36+
)
37+
38+
call "%_VSCOMNTOOLS%\VsDevCmd.bat"
39+
40+
:Run
41+
2542
if defined VS150COMNTOOLS (
2643
set "__VSToolsRoot=%VS150COMNTOOLS%"
2744
set "__VCToolsRoot=%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build"

build.cmd

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,24 @@ set __ThisScriptFull="%~f0"
1919
:: is already configured to use that toolset. Otherwise, we will fallback to using the VS2015
2020
:: toolset if it is installed. Finally, we will fail the script if no supported VS instance
2121
:: can be found.
22+
23+
if defined VisualStudioVersion goto :Run
24+
25+
set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
26+
if exist %_VSWHERE% (
27+
for /f "usebackq tokens=*" %%i in (`%_VSWHERE% -latest -property installationPath`) do set _VSCOMNTOOLS=%%i\Common7\Tools
28+
)
29+
if not exist "%_VSCOMNTOOLS%" set _VSCOMNTOOLS=%VS140COMNTOOLS%
30+
if not exist "%_VSCOMNTOOLS%" (
31+
echo Error: Visual Studio 2015 or 2017 required.
32+
echo Please see https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
33+
exit /b 1
34+
)
35+
36+
call "%_VSCOMNTOOLS%\VsDevCmd.bat"
37+
38+
:Run
39+
2240
if defined VS150COMNTOOLS (
2341
set "__VSToolsRoot=%VS150COMNTOOLS%"
2442
set "__VCToolsRoot=%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build"
@@ -59,7 +77,8 @@ set "__ProjectDir=%~dp0"
5977
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
6078
set "__ProjectFilesDir=%__ProjectDir%"
6179
set "__SourceDir=%__ProjectDir%\src"
62-
set "__PackagesDir=%__ProjectDir%\packages"
80+
set "__PackagesDir=%DotNetRestorePackagesPath%"
81+
if [%__PackagesDir%]==[] set "__PackagesDir=%__ProjectDir%\packages"
6382
set "__RootBinDir=%__ProjectDir%\bin"
6483
set "__LogsDir=%__RootBinDir%\Logs"
6584
set "__PgoOptDataVersion="
@@ -207,8 +226,8 @@ if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%"
207226
if not exist "%__LogsDir%" md "%__LogsDir%"
208227

209228
REM It is convinient to have your Nuget search path include the location where the build
210-
REM will plass packages. However nuget used during the build will fail if that directory
211-
REM does not exist. Avoid this in at least one case by agressively creating the directory.
229+
REM will plass packages. However nuget used during the build will fail if that directory
230+
REM does not exist. Avoid this in at least one case by agressively creating the directory.
212231
if not exist "%__BinDir%\.nuget\pkg" md "%__BinDir%\.nuget\pkg"
213232

214233
echo %__MsgPrefix%Commencing CoreCLR Repo build
@@ -228,7 +247,7 @@ REM ============================================================================
228247
echo %__MsgPrefix%Using environment: "%__VSToolsRoot%\VsDevCmd.bat"
229248
call "%__VSToolsRoot%\VsDevCmd.bat"
230249

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

233252
REM =========================================================================================
234253
REM ===
@@ -265,7 +284,7 @@ REM === Build the CLR VM
265284
REM ===
266285
REM =========================================================================================
267286

268-
if %__BuildNative% EQU 1 (
287+
if %__BuildNative% EQU 1 (
269288
echo %__MsgPrefix%Commencing build of native components for %__BuildOS%.%__BuildArch%.%__BuildType%
270289

271290
set nativePlatfromArgs=-platform=%__BuildArch%
@@ -275,7 +294,7 @@ if %__BuildNative% EQU 1 (
275294
set __MsbuildWrn=/flp1:WarningsOnly;LogFile="%__LogsDir%\CoreCLR_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn"
276295
set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__LogsDir%\CoreCLR_%__BuildOS%__%__BuildArch%__%__BuildType%.err"
277296

278-
if /i "%__BuildArch%" == "arm64" (
297+
if /i "%__BuildArch%" == "arm64" (
279298
rem arm64 builds currently use private toolset which has not been released yet
280299
REM TODO, remove once the toolset is open.
281300
call :PrivateToolSet
@@ -287,7 +306,7 @@ if %__BuildNative% EQU 1 (
287306
if /i "%__BuildArch%" == "x86" ( set __VCBuildArch=x86 )
288307
if /i "%__BuildArch%" == "arm" (
289308
set __VCBuildArch=x86_arm
290-
309+
291310
REM Make CMake pick the highest installed version in the 10.0.* range
292311
set ___SDKVersion="-DCMAKE_SYSTEM_VERSION=10.0"
293312
)
@@ -328,7 +347,7 @@ if %__BuildNative% EQU 1 (
328347
echo "%__LogsDir%\CoreCLR_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn"
329348
echo "%__LogsDir%\CoreCLR_%__BuildOS%__%__BuildArch%__%__BuildType%.err"
330349
exit /b 1
331-
)
350+
)
332351
)
333352
:SkipNativeBuild
334353

@@ -386,7 +405,7 @@ if /i "%__DoCrossArchBuild%"=="1" (
386405
echo "%__LogsDir%\Cross_%__BuildOS%__%__BuildArch%__%__BuildType%.wrn"
387406
echo "%__LogsDir%\Cross_%__BuildOS%__%__BuildArch%__%__BuildType%.err"
388407
exit /b 1
389-
)
408+
)
390409
)
391410

392411
:SkipCrossCompBuild
@@ -397,8 +416,8 @@ REM === CoreLib and NuGet package build section.
397416
REM ===
398417
REM =========================================================================================
399418

400-
if %__BuildCoreLib% EQU 1 (
401-
419+
if %__BuildCoreLib% EQU 1 (
420+
402421
echo %__MsgPrefix%Commencing build of System.Private.CoreLib for %__BuildOS%.%__BuildArch%.%__BuildType%
403422
rem Explicitly set Platform causes conflicts in CoreLib project files. Clear it to allow building from VS x64 Native Tools Command Prompt
404423
set Platform=
@@ -486,7 +505,7 @@ if %__BuildTests% EQU 1 (
486505

487506
rem arm64 builds currently use private toolset which has not been released yet
488507
REM TODO, remove once the toolset is open.
489-
if /i "%__BuildArch%" == "arm64" call :PrivateToolSet
508+
if /i "%__BuildArch%" == "arm64" call :PrivateToolSet
490509

491510
echo "%__ProjectDir%\build-test.cmd %__BuildArch% %__BuildType% %__UnprocessedBuildArgs%"
492511
@call %__ProjectDir%\build-test.cmd %__BuildArch% %__BuildType% %__UnprocessedBuildArgs%

build.proj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525
</Target>
2626

2727
<Target Name="RestoreOptData">
28-
<Exec Command="$(DotnetRestoreCommand) $(SourceDir).nuget/optdata/optdata.csproj" />
28+
<PropertyGroup>
29+
<OptDataRestoreCommand>"$(DotnetToolCommand)"</OptDataRestoreCommand>
30+
<OptDataRestoreCommand>$(OptDataRestoreCommand) restore</OptDataRestoreCommand>
31+
<OptDataRestoreCommand>$(OptDataRestoreCommand) --packages "$(PackagesDir.TrimEnd('/').TrimEnd('\'))"</OptDataRestoreCommand>
32+
</PropertyGroup>
33+
<Exec Command="$(OptDataRestoreCommand) $(SourceDir).nuget/optdata/optdata.csproj" />
2934
</Target>
3035

3136
<!--

build.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ initHostDistroRid()
6161
if [ "$__HostOS" == "Linux" ]; then
6262
if [ -e /etc/os-release ]; then
6363
source /etc/os-release
64+
if [[ $ID == "alpine" || $ID == "rhel" ]]; then
65+
# remove the last version digit
66+
VERSION_ID=${VERSION_ID%.*}
67+
fi
6468
__HostDistroRid="$ID.$VERSION_ID-$__HostArch"
6569
elif [ -e /etc/redhat-release ]; then
6670
local redhatRelease=$(</etc/redhat-release)
@@ -619,7 +623,7 @@ __IgnoreWarnings=0
619623
# Set the various build properties here so that CMake and MSBuild can pick them up
620624
__ProjectDir="$__ProjectRoot"
621625
__SourceDir="$__ProjectDir/src"
622-
__PackagesDir="$__ProjectDir/packages"
626+
__PackagesDir="${DotNetRestorePackagesPath:-${__ProjectDir}/packages}"
623627
__RootBinDir="$__ProjectDir/bin"
624628
__UnprocessedBuildArgs=
625629
__RunArgs=
@@ -870,6 +874,11 @@ if [[ $__ClangMajorVersion == 0 && $__ClangMinorVersion == 0 ]]; then
870874
__PortableBuild=0
871875
fi
872876

877+
elif [[ "$__HostOS" == "Linux" && \
878+
"$(lsb_release --id --short)" == "Ubuntu" && \
879+
"$(lsb_release --release --short)" == "16.04" ]]; then
880+
__ClangMajorVersion=3
881+
__ClangMinorVersion=9
873882
else
874883
__ClangMajorVersion=3
875884
__ClangMinorVersion=5

0 commit comments

Comments
 (0)