diff options
author | Adeel Mujahid <adeelbm@outlook.com> | 2020-05-12 16:45:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-12 16:45:02 +0300 |
commit | 8271d53e6210161b4898af880fe4bf87d3714eac (patch) | |
tree | 647fed4ab2b04435696e9d32b978fb0617825dc0 | |
parent | 210a82a2e7f024365309c532f4511ed4122a4743 (diff) |
Add configurations for SunOS CoreCLR managed build (#36266)
23 files changed, 123 insertions, 60 deletions
diff --git a/eng/Configurations.props b/eng/Configurations.props index 764887c3ae5..94646e7991b 100644 --- a/eng/Configurations.props +++ b/eng/Configurations.props @@ -43,6 +43,7 @@ <TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('OSX'))">OSX</TargetOS> <TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('FREEBSD'))">FreeBSD</TargetOS> <TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('NETBSD'))">NetBSD</TargetOS> + <TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('SUNOS'))">SunOS</TargetOS> <TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSUnixLike())">Linux</TargetOS> <TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('WINDOWS'))">Windows_NT</TargetOS> <CoreCLRTargetOS Condition="'$(CoreCLRTargetOS)' == ''">$(TargetOS)</CoreCLRTargetOS> diff --git a/eng/build.sh b/eng/build.sh index 64496fd1080..36e68ef1c1d 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -18,7 +18,7 @@ usage() { echo "Common settings:" echo " --subset Build a subset, print available subsets with -subset help (short: -s)" - echo " --os Build operating system: Windows_NT, Linux, FreeBSD, OSX, tvOS, iOS, Android or Browser" + echo " --os Build operating system: Windows_NT, Linux, FreeBSD, OSX, tvOS, iOS, Android, Browser, NetBSD or SunOS" echo " --arch Build platform: x86, x64, arm, armel, arm64 or wasm" echo " --configuration Build configuration: Debug, Release or [CoreCLR]Checked (short: -c)" echo " --runtimeConfiguration Runtime build configuration: Debug, Release or [CoreCLR]Checked (short: -rc)" @@ -108,16 +108,16 @@ while [[ $# > 0 ]]; do exit 0 ;; -subset|-s) - if [ -z ${2+x} ]; then + if [ -z ${2+x} ]; then arguments="$arguments /p:Subset=help" shift 1 - else + else arguments="$arguments /p:Subset=$2" shift 2 fi ;; -arch) - if [ -z ${2+x} ]; then + if [ -z ${2+x} ]; then echo "No architecture supplied. See help (--help) for supported architectures." 1>&2 exit 1 fi @@ -125,7 +125,7 @@ while [[ $# > 0 ]]; do shift 2 ;; -configuration|-c) - if [ -z ${2+x} ]; then + if [ -z ${2+x} ]; then echo "No configuration supplied. See help (--help) for supported configurations." 1>&2 exit 1 fi @@ -134,7 +134,7 @@ while [[ $# > 0 ]]; do shift 2 ;; -framework|-f) - if [ -z ${2+x} ]; then + if [ -z ${2+x} ]; then echo "No framework supplied. See help (--help) for supported frameworks." 1>&2 exit 1 fi @@ -143,7 +143,7 @@ while [[ $# > 0 ]]; do shift 2 ;; -os) - if [ -z ${2+x} ]; then + if [ -z ${2+x} ]; then echo "No target operating system supplied. See help (--help) for supported target operating systems." 1>&2 exit 1 fi @@ -156,7 +156,7 @@ while [[ $# > 0 ]]; do shift 1 ;; -testscope) - if [ -z ${2+x} ]; then + if [ -z ${2+x} ]; then echo "No test scope supplied. See help (--help) for supported test scope values." 1>&2 exit 1 fi @@ -172,7 +172,7 @@ while [[ $# > 0 ]]; do shift 1 ;; -runtimeconfiguration|-rc) - if [ -z ${2+x} ]; then + if [ -z ${2+x} ]; then echo "No runtime configuration supplied. See help (--help) for supported runtime configurations." 1>&2 exit 1 fi @@ -181,7 +181,7 @@ while [[ $# > 0 ]]; do shift 2 ;; -librariesconfiguration|-lc) - if [ -z ${2+x} ]; then + if [ -z ${2+x} ]; then echo "No libraries configuration supplied. See help (--help) for supported libraries configurations." 1>&2 exit 1 fi @@ -198,7 +198,7 @@ while [[ $# > 0 ]]; do shift 1 ;; -cmakeargs) - if [ -z ${2+x} ]; then + if [ -z ${2+x} ]; then echo "No cmake args supplied." 1>&2 exit 1 fi diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index 27381c68d0e..309244b9671 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -409,7 +409,7 @@ done # Get the number of processors available to the scheduler # Other techniques such as `nproc` only get the number of # processors available to a single process. -platform=$(uname) +platform="$(uname)" if [[ "$platform" == "FreeBSD" ]]; then __NumProc=$(sysctl hw.ncpu | awk '{ print $2+1 }') elif [[ "$platform" == "NetBSD" || "$platform" == "SunOS" ]]; then diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 735f77b0282..e0301cb6b3f 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -227,15 +227,13 @@ if (CLR_CMAKE_HOST_UNIX) if(CLR_CMAKE_HOST_OSX) message("Detected OSX x86_64") - endif(CLR_CMAKE_HOST_OSX) - - if(CLR_CMAKE_HOST_FREEBSD) + elseif(CLR_CMAKE_HOST_FREEBSD) message("Detected FreeBSD amd64") - endif(CLR_CMAKE_HOST_FREEBSD) - - if(CLR_CMAKE_HOST_NETBSD) + elseif(CLR_CMAKE_HOST_NETBSD) message("Detected NetBSD amd64") - endif(CLR_CMAKE_HOST_NETBSD) + elseif(CLR_CMAKE_HOST_SUNOS) + message("Detected SunOS amd64") + endif(CLR_CMAKE_HOST_SUNOS) endif(CLR_CMAKE_HOST_UNIX) if (CLR_CMAKE_HOST_WIN32) @@ -373,6 +371,8 @@ if(CLR_CMAKE_TARGET_UNIX) add_definitions(-DTARGET_LINUX) elseif(CLR_CMAKE_TARGET_NETBSD) add_definitions(-DTARGET_NETBSD) + elseif(CLR_CMAKE_TARGET_SUNOS) + add_definitions(-DTARGET_SUNOS) elseif(CLR_CMAKE_TARGET_ANDROID) add_definitions(-DTARGET_ANDROID) endif() diff --git a/eng/run-test.sh b/eng/run-test.sh index abd1d920b16..5f14e6f6121 100644 --- a/eng/run-test.sh +++ b/eng/run-test.sh @@ -15,12 +15,12 @@ wait_on_pids() usage() { - echo "Runs .NET CoreFX tests on FreeBSD, NetBSD or Linux" + echo "Runs .NET CoreFX tests on FreeBSD, Linux, NetBSD or SunOS" echo "usage: run-test [options]" echo echo "Input sources:" echo " --runtime <location> Location of root of the binaries directory" - echo " containing the FreeBSD, NetBSD or Linux runtime" + echo " containing the FreeBSD, Linux, NetBSD or SunOS runtime" echo " default: <repo_root>/bin/testhost/netcoreapp-<OS>-<Configuration>-<Arch>" echo " --corefx-tests <location> Location of the root binaries location containing" echo " the tests to run" @@ -29,7 +29,7 @@ usage() echo "Flavor/OS/Architecture options:" echo " --configuration <config> Configuration to run (Debug/Release)" echo " default: Debug" - echo " --os <os> OS to run (FreeBSD, NetBSD or Linux)" + echo " --os <os> OS to run (FreeBSD, Linux, NetBSD or SunOS)" echo " default: detect current OS" echo " --arch <Architecture> Architecture to run (x64, arm, armel, x86, arm64)" echo " default: detect current architecture" @@ -236,34 +236,34 @@ done # Compute paths to the binaries if they haven't already been computed -if [ "$Runtime" == "" ] +if [ -z "$Runtime" ] then Runtime="$ProjectRoot/artifacts/bin/testhost/netcoreapp-$OS-$Configuration-$__Arch" fi -if [ "$CoreFxTests" == "" ] +if [ -z "$CoreFxTests" ] then CoreFxTests="$ProjectRoot/artifacts/bin" fi # Check parameters up front for valid values: -if [ ! "$Configuration" == "Debug" ] && [ ! "$Configuration" == "Release" ] +if [ "$Configuration" != "Debug" ] && [ "$Configuration" != "Release" ] then echo "error: Configuration should be Debug or Release" exit 1 fi -if [ ! "$OS" == "FreeBSD" ] && [ ! "$OS" == "NetBSD" ] && [ ! "$OS" == "Linux" ] +if [ "$OS" != "FreeBSD" ] && [ "$OS" != "Linux" ] && [ "$OS" != "NetBSD" ] && [ "$OS" != "SunOS" ] then - echo "error: OS should be FreeBSD, NetBSD or Linux" + echo "error: OS should be FreeBSD, Linux, NetBSD or Linux" exit 1 fi export CORECLR_SERVER_GC="$serverGC" export PAL_OUTPUTDEBUGSTRING="1" -if [ "$LANG" == "" ] +if [ -z "$LANG" ] then export LANG="en_US.UTF-8" fi @@ -285,7 +285,10 @@ if [ $RunTestSequential -eq 1 ] then maxProcesses=1; else - if [ `uname` = "NetBSD" ] || [ `uname` = "FreeBSD" ]; then + platform="$(uname)" + if [ "$platform" = "FreeBSD" ]; then + maxProcesses=$(sysctl hw.ncpu | awk '{ print $2+1 }') + if [ "$platform" = "NetBSD" ] || [ "$platform" = "SunOS" ] ; then maxProcesses=$(($(getconf NPROCESSORS_ONLN)+1)) else maxProcesses=$(($(getconf _NPROCESSORS_ONLN)+1)) diff --git a/eng/targetframeworksuffix.props b/eng/targetframeworksuffix.props index 2f427328fd5..f89923d3ab8 100644 --- a/eng/targetframeworksuffix.props +++ b/eng/targetframeworksuffix.props @@ -62,6 +62,13 @@ <PackageTargetRuntime>netbsd</PackageTargetRuntime> </PropertyGroup> </When> + <When Condition="'$(TargetFrameworkSuffix)' == 'SunOS'"> + <PropertyGroup> + <TargetsUnix>true</TargetsUnix> + <TargetsSunOS>true</TargetsSunOS> + <PackageTargetRuntime>sunos</PackageTargetRuntime> + </PropertyGroup> + </When> <When Condition="'$(TargetFrameworkSuffix)' == 'Browser'"> <PropertyGroup> <TargetsLinux>true</TargetsLinux> diff --git a/src/coreclr/dir.common.props b/src/coreclr/dir.common.props index e4d212b2aee..2ff54f14de2 100644 --- a/src/coreclr/dir.common.props +++ b/src/coreclr/dir.common.props @@ -55,10 +55,11 @@ <TargetsFreeBSD Condition="'$(TargetOS)' == 'FreeBSD'">true</TargetsFreeBSD> <TargetsLinux Condition="'$(TargetOS)' == 'Linux'">true</TargetsLinux> <TargetsNetBSD Condition="'$(TargetOS)' == 'NetBSD'">true</TargetsNetBSD> + <TargetsSunOS Condition="'$(TargetOS)' == 'SunOS'">true</TargetsSunOS> <TargetsOSX Condition="'$(TargetOS)' == 'OSX'">true</TargetsOSX> <TargetsWindows Condition="'$(TargetOS)' == 'Windows_NT'">true</TargetsWindows> - <TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true'">true</TargetsUnix> + <TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetsSunOS)' == 'true'">true</TargetsUnix> <!-- We are only tracking Linux Distributions for Nuget RID mapping --> <DistroRid Condition="'$(TargetsLinux)' == 'true'">$(__DistroRid)</DistroRid> diff --git a/src/coreclr/run-cppcheck.sh b/src/coreclr/run-cppcheck.sh index c505fd184de..46e51e1e747 100755 --- a/src/coreclr/run-cppcheck.sh +++ b/src/coreclr/run-cppcheck.sh @@ -17,13 +17,13 @@ usage() check_dependencies() { # Check presence of cppcheck on the path - if [ "$RunCppCheck" == true ] + if [ "$RunCppCheck" = "true" ] then hash cppcheck 2>/dev/null || { echo >&2 "Please install cppcheck before running this script"; exit 1; } fi - + # Check presence of sloccount on the path - if [ "$RunSlocCount" == true ] + if [ "$RunSlocCount" = "true" ] then hash sloccount 2>/dev/null || { echo >&2 "Please install sloccount before running this script"; exit 1; } fi @@ -39,9 +39,10 @@ SloccountOutput="sloccount.sc" # Get the number of processors available to the scheduler # Other techniques such as `nproc` only get the number of # processors available to a single process. -if [ `uname` = "FreeBSD" ]; then -NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'` -elif [ `uname` = "NetBSD" ]; then +platform="$(uname)" +if [ "$platform" = "FreeBSD" ]; then +NumProc=$(sysctl hw.ncpu | awk '{ print $2+1 }') +elif [ "$platform" = "NetBSD" || "$platform" = "SunOS" ]; then NumProc=$(($(getconf NPROCESSORS_ONLN)+1)) else NumProc=$(($(getconf _NPROCESSORS_ONLN)+1)) @@ -80,19 +81,19 @@ do esac done -if [ "$FilesFromArgs" != "" ]; +if [ -n "$FilesFromArgs" ]; then Files=$FilesFromArgs fi -if [ "$CppCheckOutput" == "" ]; +if [ -z "$CppCheckOutput" ]; then echo "Expected: file for cppcheck output" usage exit 1 fi -if [ "$SloccountOutput" == "" ]; +if [ -z "$SloccountOutput" ]; then echo "Expected: file for sloccount output" usage @@ -101,14 +102,14 @@ fi check_dependencies -if [ "$RunCppCheck" == true ] +if [ "$RunCppCheck" = "true" ] then echo "Running cppcheck for files: $Files" cppcheck --enable=all -j $NumProc --xml --xml-version=2 --force $Files 2> $CppCheckOutput CppCheckOutputs="$CppCheckOutput (cppcheck)" fi -if [ "$RunSlocCount" == true ] +if [ "$RunSlocCount" = "true" ] then echo "Running sloccount for files: $Files" sloccount --wide --details $Files > $SloccountOutput diff --git a/src/coreclr/src/.nuget/Directory.Build.props b/src/coreclr/src/.nuget/Directory.Build.props index e321b384626..2fd932c03b8 100644 --- a/src/coreclr/src/.nuget/Directory.Build.props +++ b/src/coreclr/src/.nuget/Directory.Build.props @@ -28,7 +28,7 @@ <RuntimeOS Condition="'$(RuntimeOS)' == ''">$(OSRid)</RuntimeOS> - <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Android;Linux;FreeBSD</SupportedPackageOSGroups> + <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Android;Linux;FreeBSD;NetBSD;SunOS</SupportedPackageOSGroups> <SupportedPackageOSGroups>;$(SupportedPackageOSGroups);</SupportedPackageOSGroups> <!-- Identify OS family based upon the RuntimeOS, which could be distro specific (e.g. osx.10.12) or @@ -96,6 +96,20 @@ <PackageRID Condition="'$(PortableBuild)' == 'true'">freebsd-$(TargetArchitecture)</PackageRID> </PropertyGroup> </When> + <When Condition="'$(_runtimeOSFamily)' == 'netbsd'"> + <PropertyGroup> + <PackageRID>netbsd-$(TargetArchitecture)</PackageRID> + <!-- Set the platform part of the RID if we are doing a portable build --> + <PackageRID Condition="'$(PortableBuild)' == 'true'">netbsd-$(TargetArchitecture)</PackageRID> + </PropertyGroup> + </When> + <When Condition="'$(_runtimeOSFamily)' == 'sunos'"> + <PropertyGroup> + <PackageRID>sunos-$(TargetArchitecture)</PackageRID> + <!-- Set the platform part of the RID if we are doing a portable build --> + <PackageRID Condition="'$(PortableBuild)' == 'true'">sunos-$(TargetArchitecture)</PackageRID> + </PropertyGroup> + </When> <When Condition="'$(_runtimeOSFamily)' == 'android'"> <PropertyGroup> <PackageRID>android.21-$(TargetArchitecture)</PackageRID> @@ -159,6 +173,12 @@ <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';FreeBSD;'))"> <OfficialBuildRID Include="freebsd-x64" /> </ItemGroup> + <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';NetBSD;'))"> + <OfficialBuildRID Include="netbsd-x64" /> + </ItemGroup> + <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';SunOS;'))"> + <OfficialBuildRID Include="sunos-x64" /> + </ItemGroup> <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Windows_NT;'))"> <OfficialBuildRID Include="win-x86"> <Platform>x86</Platform> diff --git a/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets b/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets index 299511fa2a8..f2c0a3fb649 100644 --- a/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets +++ b/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets @@ -7,7 +7,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and created a backup copy. Incorrect changes to this file will make it impossible to load or build your projects from the command-line or the IDE. -Copyright (c) .NET Foundation. All rights reserved. +Copyright (c) .NET Foundation. All rights reserved. *********************************************************************************************** --> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> @@ -24,13 +24,15 @@ Copyright (c) .NET Foundation. All rights reserved. <_OSPlatform Condition="$([MSBuild]::IsOSPlatform('linux'))">linux</_OSPlatform> <_OSPlatform Condition="$([MSBuild]::IsOSPlatform('osx'))">osx</_OSPlatform> <_OSPlatform Condition="$([MSBuild]::IsOSPlatform('freebsd'))">freebsd</_OSPlatform> + <_OSPlatform Condition="$([MSBuild]::IsOSPlatform('netbsd'))">netbsd</_OSPlatform> + <_OSPlatform Condition="$([MSBuild]::IsOSPlatform('sunos'))">sunos</_OSPlatform> <_OSArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</_OSArchitecture> <MicrosoftNetCoreIlasmPackageRuntimeId Condition="'$(MicrosoftNetCoreIlasmPackageRuntimeId)' == ''">$(_OSPlatform)-$(_OSArchitecture.ToLower())</MicrosoftNetCoreIlasmPackageRuntimeId> <MicrosoftNETCoreILAsmVersion Condition="'$(MicrosoftNETCoreILAsmVersion)' == ''">5.0.0</MicrosoftNETCoreILAsmVersion> <MicrosoftNetCoreIlasmPackageName>runtime.$(MicrosoftNetCoreIlasmPackageRuntimeId).microsoft.netcore.ilasm</MicrosoftNetCoreIlasmPackageName> <MicrosoftNetCoreIldasmPackageName>runtime.$(MicrosoftNetCoreIlasmPackageRuntimeId).microsoft.netcore.ildasm</MicrosoftNetCoreIldasmPackageName> - + <!-- If ILAsmToolPath is specified, it will be used and no packages will be restored Otherwise packages will be restored and ilasm and ildasm will be referenced from their packages. --> <_IlasmDir Condition="'$(ILAsmToolPath)' != ''">$([MSBuild]::NormalizeDirectory($(ILAsmToolPath)))</_IlasmDir> @@ -68,8 +70,8 @@ Copyright (c) .NET Foundation. All rights reserved. </Target> <!-- projects can define an ILResourceReference and we'll decompile it to get native resources --> - <Target Name="DisassembleIlasmResourceFile" - BeforeTargets="CoreCompile" + <Target Name="DisassembleIlasmResourceFile" + BeforeTargets="CoreCompile" Condition="'$(OS)'=='Windows_NT'" Inputs="@(ILResourceReference)" Outputs="$(IntermediateOutputPath)$(MSBuildProjectName).ref.res.obj"> @@ -122,7 +124,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_KeyFileArgument Condition="'$(KeyOriginatorFile)' != ''">-KEY="$(KeyOriginatorFile)"</_KeyFileArgument> - <_IlasmSwitches>-QUIET -NOLOGO</_IlasmSwitches> + <_IlasmSwitches>-QUIET -NOLOGO</_IlasmSwitches> <_IlasmSwitches Condition="'$(FoldIdenticalMethods)' == 'True'">$(_IlasmSwitches) -FOLD</_IlasmSwitches> <_IlasmSwitches Condition="'$(SizeOfStackReserve)' != ''">$(_IlasmSwitches) -STACK=$(SizeOfStackReserve)</_IlasmSwitches> <_IlasmSwitches Condition="'$(DebugType)' == 'Full'">$(_IlasmSwitches) -DEBUG</_IlasmSwitches> diff --git a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt index 4358d79669b..4260ea92d19 100644 --- a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt @@ -61,10 +61,10 @@ else(CLR_CMAKE_HOST_WIN32) set(EXPORTS_LINKER_OPTION "${EXPORTS_LINKER_OPTION} -Wl,--no-warn-shared-textrel") endif(CLR_CMAKE_TARGET_ANDROID AND CLR_CMAKE_HOST_ARCH_ARM) - if(CLR_CMAKE_HOST_SUNOS) + if(CLR_CMAKE_TARGET_SUNOS) # Add linker exports file option set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE}) - endif(CLR_CMAKE_HOST_SUNOS) + endif(CLR_CMAKE_TARGET_SUNOS) endif (CLR_CMAKE_HOST_WIN32) diff --git a/src/coreclr/src/inc/pedecoder.h b/src/coreclr/src/inc/pedecoder.h index ad0e77e532c..c4f4e92b6b6 100644 --- a/src/coreclr/src/inc/pedecoder.h +++ b/src/coreclr/src/inc/pedecoder.h @@ -95,6 +95,8 @@ inline CHECK CheckOverflow(RVA value1, COUNT_T value2) #define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0x7B79 #elif defined(__NetBSD__) #define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0x1993 +#elif defined(__sun) +#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0x1992 #else #define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0 #endif diff --git a/src/coreclr/src/jit/CMakeLists.txt b/src/coreclr/src/jit/CMakeLists.txt index 8ba2c47973f..0fd69af5982 100644 --- a/src/coreclr/src/jit/CMakeLists.txt +++ b/src/coreclr/src/jit/CMakeLists.txt @@ -325,7 +325,7 @@ else() set(JIT_EXPORTS_LINKER_OPTION -Wl,--version-script=${JIT_EXPORTS_FILE}) elseif(CLR_CMAKE_TARGET_OSX) set(JIT_EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${JIT_EXPORTS_FILE}) - elseif(CLR_CMAKE_HOST_SUNOS) + elseif(CLR_CMAKE_TARGET_SUNOS) # Add linker exports file option set(JIT_EXPORTS_LINKER_OPTION -Wl,-M,${JIT_EXPORTS_FILE}) endif() diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt index 37ff7de67a1..2d2d037ca29 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt @@ -26,10 +26,10 @@ if(CLR_CMAKE_TARGET_OSX) set(EXPORTS_LINKER_OPTION1 -Wl,-exported_symbols_list,${EXPORTS_FILE1}) endif(CLR_CMAKE_TARGET_OSX) -if(CLR_CMAKE_HOST_SUNOS) +if(CLR_CMAKE_TARGET_SUNOS) # Add linker exports file option set(EXPORTS_LINKER_OPTION -Wl,-M,${EXPORTS_FILE}) -endif(CLR_CMAKE_HOST_SUNOS) +endif(CLR_CMAKE_TARGET_SUNOS) set(DLL1SOURCES dlltest1.cpp) add_library(paltest_pal_sxs_test1_dll1 SHARED ${DLL1SOURCES}) diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_X64/TargetRegisterMap.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_X64/TargetRegisterMap.cs index 808f8ed03c5..7d76bf5259b 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_X64/TargetRegisterMap.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_X64/TargetRegisterMap.cs @@ -34,6 +34,8 @@ namespace ILCompiler.DependencyAnalysis.X64 case TargetOS.Linux: case TargetOS.OSX: case TargetOS.FreeBSD: + case TargetOS.SunOS: + case TargetOS.NetBSD: Arg0 = Register.RDI; Arg1 = Register.RSI; Arg2 = Register.RDX; diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs index 162df18395a..9337d767090 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs @@ -31,6 +31,7 @@ namespace Internal.TypeSystem OSX, FreeBSD, NetBSD, + SunOS, WebAssembly, } diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs index d4ba4683609..0b943d62339 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/ObjectWriter/TargetExtensions.cs @@ -20,6 +20,7 @@ namespace ILCompiler.PEWriter Apple = 0x4644, FreeBSD = 0xADC4, NetBSD = 0x1993, + SunOS = 0x1992, } /// <summary> diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs index c252c306d46..729a4922157 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs @@ -31,6 +31,7 @@ namespace ILCompiler.Reflection.ReadyToRun FreeBSD = 0xADC4, Linux = 0x7B79, NetBSD = 0x1993, + SunOS = 0x1992, Windows = 0, Unknown = -1 } diff --git a/src/coreclr/tests/scripts/run-corefx-tests.sh b/src/coreclr/tests/scripts/run-corefx-tests.sh index 03d186f04c9..39a87d03834 100755 --- a/src/coreclr/tests/scripts/run-corefx-tests.sh +++ b/src/coreclr/tests/scripts/run-corefx-tests.sh @@ -16,7 +16,7 @@ usage() echo "Flavor/OS/Architecture options:" echo " --configuration <config> Configuration to run (Debug/Release)" echo " default: Debug" - echo " --os <os> OS to run (FreeBSD, Linux, NetBSD or OSX)" + echo " --os <os> OS to run (FreeBSD, Linux, NetBSD, OSX, SunOS)" echo " default: detect current OS" echo " --arch <Architecture> Architecture to run (x64, arm, armel, x86, arm64)" echo " default: detect current architecture" @@ -37,7 +37,7 @@ usage() echo "Runtime Code Coverage options:" echo " --coreclr-coverage Optional argument to get coreclr code coverage reports" echo " --coreclr-objs <location> Location of root of the object directory" - echo " containing the FreeBSD, Linux, NetBSD or OSX coreclr build" + echo " containing the FreeBSD, Linux, NetBSD, OSX or SunOS coreclr build" echo " default: <repo_root>/bin/obj/<OS>.x64.<Configuration" echo " --coreclr-src <location> Location of root of the directory" echo " containing the coreclr source files" @@ -81,6 +81,10 @@ case $OSName in OS=NetBSD ;; + SunOS) + OS=SunOS + ;; + *) echo "Unsupported OS $OSName detected, configuring as if for Linux" OS=Linux @@ -342,7 +346,7 @@ run_test() coreclr_code_coverage() { - if [ ! "$OS" == "FreeBSD" ] && [ ! "$OS" == "Linux" ] && [ ! "$OS" == "NetBSD" ] && [ ! "$OS" == "OSX" ] ; then + if [ "$OS" != "FreeBSD" ] && [ "$OS" != "Linux" ] && [ "$OS" != "NetBSD" ] && [ "$OS" != "OSX" ] && [ "$OS" != "SunOS" ] ; then echo "error: Code Coverage not supported on $OS" exit 1 fi @@ -501,9 +505,9 @@ then exit 1 fi -if [ ! "$OS" == "FreeBSD" ] && [ ! "$OS" == "Linux" ] && [ ! "$OS" == "NetBSD" ] && [ ! "$OS" == "OSX" ] +if [ "$OS" != "FreeBSD" ] && [ "$OS" != "Linux" ] && [ "$OS" != "NetBSD" ] && [ "$OS" != "OSX" ] && [ "$OS" != "SunOS" ] then - echo "error: OS should be FreeBSD, Linux, NetBSD or OSX" + echo "error: OS should be FreeBSD, Linux, NetBSD, OSX or SunOS" exit 1 fi diff --git a/src/coreclr/tests/scripts/run-gc-reliability-framework.sh b/src/coreclr/tests/scripts/run-gc-reliability-framework.sh index 8f8886a1bc8..c136c1561ec 100755 --- a/src/coreclr/tests/scripts/run-gc-reliability-framework.sh +++ b/src/coreclr/tests/scripts/run-gc-reliability-framework.sh @@ -18,6 +18,9 @@ case $OSName in OS=NetBSD ;; + SunOS) + OS=SunOS + ;; *) echo "Unsupported OS $OSName detected, configuring as if for Linux" OS=Linux diff --git a/src/coreclr/tests/setup-stress-dependencies.sh b/src/coreclr/tests/setup-stress-dependencies.sh index 400a78003f6..a81c8fff7b2 100755 --- a/src/coreclr/tests/setup-stress-dependencies.sh +++ b/src/coreclr/tests/setup-stress-dependencies.sh @@ -82,7 +82,7 @@ if [ -z "$libInstallDir" ]; then exit_with_error 1 fi -if [ "$__BuildArch" == "arm64" ] || [ "$__BuildArch" == "arm" ]; then +if [ "$__BuildArch" = "arm64" ] || [ "$__BuildArch" = "arm" ]; then echo "No runtime dependencies for arm32/arm64" exit $EXIT_CODE_SUCCESS fi diff --git a/src/coreclr/tests/src/Directory.Build.props b/src/coreclr/tests/src/Directory.Build.props index fd07aff01d3..c4ed9921bd3 100644 --- a/src/coreclr/tests/src/Directory.Build.props +++ b/src/coreclr/tests/src/Directory.Build.props @@ -91,6 +91,20 @@ <TestNugetRuntimeId>ubuntu.14.04-$(TargetArchitecture)</TestNugetRuntimeId> </PropertyGroup> </When> + <When Condition="'$(TargetOS)'=='NetBSD'"> + <PropertyGroup> + <TargetsUnix>true</TargetsUnix> + <TargetsNetBSD>true</TargetsNetBSD> + <TestNugetRuntimeId>ubuntu.14.04-$(TargetArchitecture)</TestNugetRuntimeId> + </PropertyGroup> + </When> + <When Condition="'$(TargetOS)'=='SunOS'"> + <PropertyGroup> + <TargetsUnix>true</TargetsUnix> + <TargetsSunOS>true</TargetsSunOS> + <TestNugetRuntimeId>ubuntu.14.04-$(TargetArchitecture)</TestNugetRuntimeId> + </PropertyGroup> + </When> </Choose> <PropertyGroup> @@ -109,7 +123,7 @@ </PropertyGroup> <PropertyGroup> - <TargetsUnknownUnix Condition="'$(TargetsUnix)' == 'true' AND '$(TargetOS)' != 'FreeBSD' AND '$(TargetOS)' != 'Linux' AND '$(TargetOS)' != 'OSX'">true</TargetsUnknownUnix> + <TargetsUnknownUnix Condition="'$(TargetsUnix)' == 'true' AND '$(TargetOS)' != 'FreeBSD' AND '$(TargetOS)' != 'Linux' AND '$(TargetOS)' != 'NetBSD' AND '$(TargetOS)' != 'OSX' AND '$(TargetOS)' != 'SunOS'">true</TargetsUnknownUnix> <Language Condition="'$(Language)' == '' and '$(MSBuildProjectExtension)' == '.csproj'">C#</Language> <Language Condition="'$(Language)' == '' and '$(MSBuildProjectExtension)' == '.ilproj'">IL</Language> </PropertyGroup> diff --git a/src/coreclr/tests/src/JIT/Directed/StructABI/StructABI.csproj b/src/coreclr/tests/src/JIT/Directed/StructABI/StructABI.csproj index d43bf082a22..440413d3e28 100644 --- a/src/coreclr/tests/src/JIT/Directed/StructABI/StructABI.csproj +++ b/src/coreclr/tests/src/JIT/Directed/StructABI/StructABI.csproj @@ -16,7 +16,7 @@ <ItemGroup> <Compile Include="StructABI.cs" /> <Compile Include="StructABI.Windows.cs" Condition="'$(TargetOS)' == 'Windows_NT'" /> - <Compile Include="StructABI.Unix.cs" Condition="'$(TargetOS)' == 'Linux' Or '$(TargetOS)' == 'FreeBSD'" /> + <Compile Include="StructABI.Unix.cs" Condition="'$(TargetOS)' == 'Linux' Or '$(TargetOS)' == 'FreeBSD' Or '$(TargetOS)' == 'SunOS'" /> <Compile Include="StructABI.OSX.cs" Condition="'$(TargetOS)' == 'OSX'" /> </ItemGroup> <ItemGroup> |