Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion eng/common/cross/build-rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ __FreeBSDPackages+=" terminfo-db"
__OpenBSDVersion="7.8"
__OpenBSDPackages="heimdal-libs"
__OpenBSDPackages+=" icu4c"
__OpenBSDPackages+=" inotify-tools"
__OpenBSDPackages+=" libinotify"
__OpenBSDPackages+=" openssl"
__OpenBSDPackages+=" e2fsprogs"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janvorli, I've picked it from dotnet/arcade#17027.


__IllumosPackages="icu"
__IllumosPackages+=" mit-krb5"
Expand Down
16 changes: 9 additions & 7 deletions eng/common/cross/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64")
set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu")
endif()
elseif(FREEBSD)
set(triple "aarch64-unknown-freebsd12")
set(TOOLCHAIN "aarch64-unknown-freebsd14")
elseif(OPENBSD)
set(triple "aarch64-unknown-openbsd")
set(TOOLCHAIN "aarch64-unknown-openbsd")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "armel")
set(CMAKE_SYSTEM_PROCESSOR armv7l)
Expand Down Expand Up @@ -117,9 +117,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "x64")
set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu")
endif()
elseif(FREEBSD)
set(triple "x86_64-unknown-freebsd12")
set(TOOLCHAIN "x86_64-unknown-freebsd14")
elseif(OPENBSD)
set(triple "x86_64-unknown-openbsd")
set(TOOLCHAIN "x86_64-unknown-openbsd")
elseif(ILLUMOS)
set(TOOLCHAIN "x86_64-illumos")
elseif(HAIKU)
Expand Down Expand Up @@ -160,6 +160,8 @@ if(TIZEN)
find_toolchain_dir("${CROSS_ROOTFS}/usr/lib64/gcc/${TIZEN_TOOLCHAIN}")
endif()

message(STATUS "TIZEN_TOOLCHAIN_PATH set to: ${TIZEN_TOOLCHAIN_PATH}")

include_directories(SYSTEM ${TIZEN_TOOLCHAIN_PATH}/include/c++)
include_directories(SYSTEM ${TIZEN_TOOLCHAIN_PATH}/include/c++/${TIZEN_TOOLCHAIN})
endif()
Expand Down Expand Up @@ -204,9 +206,9 @@ if(ANDROID)
include(${CROSS_ROOTFS}/../build/cmake/android.toolchain.cmake)
elseif(FREEBSD OR OPENBSD)
# we cross-compile by instructing clang
set(CMAKE_C_COMPILER_TARGET ${triple})
set(CMAKE_CXX_COMPILER_TARGET ${triple})
set(CMAKE_ASM_COMPILER_TARGET ${triple})
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_SYSROOT "${CROSS_ROOTFS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld")
Expand Down
26 changes: 26 additions & 0 deletions eng/common/native/NativeAotSupported.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project>
<PropertyGroup>

<!-- Reject unsupported OS via RID prefix match -->
<_NativeAotSupportedOS Condition="
'$(TargetOS)' != 'browser' and
'$(TargetOS)' != 'haiku' and
'$(TargetOS)' != 'illumos' and
'$(TargetOS)' != 'netbsd' and
'$(TargetOS)' != 'solaris'
">true</_NativeAotSupportedOS>

<!-- Reject unsupported architectures via RID suffix match -->
<_NativeAotSupportedArch Condition="
'$(TargetArchitecture)' != 'wasm' and
('$(TargetArchitecture)' != 'x86' or '$(TargetOS)' == 'windows')
">true</_NativeAotSupportedArch>

<NativeAotSupported Condition="
'$(NativeAotSupported)' == '' and
'$(_NativeAotSupportedOS)' == 'true' and
'$(_NativeAotSupportedArch)' == 'true'
">true</NativeAotSupported>

</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions src/tests/Common/CoreCLRTestLibrary/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public static bool Verbose
public static bool IsWindows => OperatingSystem.IsWindows();
public static bool IsLinux => OperatingSystem.IsLinux();
public static bool IsFreeBSD => OperatingSystem.IsFreeBSD();
public static bool IsOpenBSD => OperatingSystem.IsOSPlatform("OpenBSD");
public static bool IsMacOSX => OperatingSystem.IsMacOS();
public static bool IsWindowsNanoServer => (!IsWindowsIoTCore && GetInstallationType().Equals("Nano Server", StringComparison.OrdinalIgnoreCase));

Expand Down
4 changes: 4 additions & 0 deletions src/tests/Common/XUnitWrapperGenerator/ITestInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ private static string GetPlatformConditionFromTestPlatform(Xunit.TestPlatforms p
{
platformCheckConditions.Add(@"global::System.OperatingSystem.IsFreeBSD()");
}
if (platform.HasFlag(Xunit.TestPlatforms.OpenBSD))
{
platformCheckConditions.Add(@"global::System.OperatingSystem.IsOSPlatform(""OpenBSD"")");
}
if (platform.HasFlag(Xunit.TestPlatforms.NetBSD))
{
platformCheckConditions.Add(@"global::System.OperatingSystem.IsOSPlatform(""NetBSD"")");
Expand Down
34 changes: 18 additions & 16 deletions src/tests/Common/XUnitWrapperGenerator/TestPlatforms.cs

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,25 @@ namespace Xunit
[Flags]
public enum TestPlatforms
{
Windows = 1,
Linux = 2,
OSX = 4,
FreeBSD = 8,
NetBSD = 16,
illumos = 32,
Solaris = 64,
iOS = 128,
tvOS = 256,
Android = 512,
Browser = 1024,
MacCatalyst = 2048,
LinuxBionic = 4096,
Wasi = 8192,
Haiku = 16384,
AnyUnix = FreeBSD | Linux | NetBSD | OSX | illumos | Solaris | iOS | tvOS | MacCatalyst | Android | Browser | LinuxBionic | Wasi | Haiku,
Windows = 1 << 0,
Linux = 1 << 1,
OSX = 1 << 2,
FreeBSD = 1 << 3,
NetBSD = 1 << 4,
illumos = 1 << 5,
Solaris = 1 << 6,
iOS = 1 << 7,
tvOS = 1 << 8,
Android = 1 << 9,
Browser = 1 << 10,
MacCatalyst = 1 << 11,
LinuxBionic = 1 << 12,
Wasi = 1 << 13,
Haiku = 1 << 14,
OpenBSD = 1 << 15,

AnyApple = OSX | iOS | tvOS | MacCatalyst,
AnyUnix = AnyApple | Linux | FreeBSD | NetBSD | OpenBSD | illumos | Solaris | Android | Browser | LinuxBionic | Wasi | Haiku,
Any = ~0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@ private static Xunit.TestPlatforms GetPlatformForTargetOS(string? targetOS)
"browser" => Xunit.TestPlatforms.Browser,
"wasi" => Xunit.TestPlatforms.Wasi,
"freebsd" => Xunit.TestPlatforms.FreeBSD,
"openbsd" => Xunit.TestPlatforms.OpenBSD,
"netbsd" => Xunit.TestPlatforms.NetBSD,
null or "" or "anyos" => Xunit.TestPlatforms.Any,
_ => 0
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Common/scripts/bringup_runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ function run_test {

# Get the number of processors available to the scheduler
platform="$(uname -s | tr '[:upper:]' '[:lower:]')"
if [[ "$platform" == "freebsd" ]]; then
if [[ "$platform" == "freebsd" || "$platform" == "openbsd" ]]; then
NumProc="$(($(sysctl -n hw.ncpu)+1))"
elif [[ "$platform" == "netbsd" || "$platform" == "sunos" ]]; then
NumProc="$(($(getconf NPROCESSORS_ONLN)+1))"
Expand Down
31 changes: 4 additions & 27 deletions src/tests/Common/scripts/run-gc-reliability-framework.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
#!/usr/bin/env bash

OSName=$(uname -s | tr '[:upper:]' '[:lower:]')
case $OSName in
darwin)
OS=osx
;;
__RepoRootDir="$(cd "$(dirname "$0")/../../../.." && pwd -P)"

freeBSD)
OS=freebsd
;;
. "$__RepoRootDir/eng/common/native/init-os-and-arch.sh"

linux)
OS=linux
;;

netbsd)
OS=netbsd
;;

sunos)
OS=sunos
;;
*)
echo "Unsupported OS $OSName detected, configuring as if for Linux"
OS=linux
;;
esac

export CORE_ROOT=`pwd`/artifacts/tests/$OSName.$1.$2/Tests/Core_Root
FRAMEWORK_DIR=`pwd`/artifacts/tests/$OSName.$1.$2/GC/Stress/Framework/ReliabilityFramework
export CORE_ROOT=`pwd`/artifacts/tests/$os.$1.$2/Tests/Core_Root
FRAMEWORK_DIR=`pwd`/artifacts/tests/$os.$1.$2/GC/Stress/Framework/ReliabilityFramework
$CORE_ROOT/corerun $FRAMEWORK_DIR/ReliabilityFramework.exe $FRAMEWORK_DIR/testmix_gc.config
EXIT_CODE=$?
if [ $EXIT_CODE -eq 100 ]
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Directed/StructABI/StructABI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<ItemGroup>
<Compile Include="StructABI.cs" />
<Compile Include="StructABI.Windows.cs" Condition="'$(TargetOS)' == 'windows'" />
<Compile Include="StructABI.Unix.cs" Condition="'$(TargetOS)' == 'linux' Or '$(TargetOS)' == 'freebsd' Or '$(TargetOS)' == 'netbsd' Or '$(TargetOS)' == 'illumos' Or '$(TargetOS)' == 'solaris' Or '$(TargetOS)' == 'haiku'" />
<Compile Include="StructABI.OSX.cs" Condition="'$(TargetOS)' == 'osx'" />
<Compile Include="StructABI.Unix.cs" Condition="'$(TargetOS)' != 'windows' and '$(TargetOS)' != 'osx'" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(TestLibraryProjectPath)" />
Expand Down
2 changes: 1 addition & 1 deletion src/tests/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ fi

# Get the number of processors available to the scheduler
platform="$(uname -s | tr '[:upper:]' '[:lower:]')"
if [[ "$platform" == "freebsd" ]]; then
if [[ "$platform" == "freebsd" || "$platform" == "openbsd" ]]; then
__NumProc="$(($(sysctl -n hw.ncpu)+1))"
elif [[ "$platform" == "netbsd" || "$platform" == "sunos" ]]; then
__NumProc="$(($(getconf NPROCESSORS_ONLN)+1))"
Expand Down
6 changes: 3 additions & 3 deletions src/tests/profiler/common/ProfilerTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ public static string GetProfilerPath()
{
profilerName = $"{ProfilerName}.dll";
}
else if ((TestLibrary.Utilities.IsLinux) || (TestLibrary.Utilities.IsFreeBSD))
else if (TestLibrary.Utilities.IsMacOSX)
{
profilerName = $"lib{ProfilerName}.so";
profilerName = $"lib{ProfilerName}.dylib";
}
else
{
profilerName = $"lib{ProfilerName}.dylib";
profilerName = $"lib{ProfilerName}.so";
}

string profilerPath = Path.Combine(Environment.CurrentDirectory, profilerName);
Expand Down
6 changes: 3 additions & 3 deletions src/tests/profiler/eventpipe/reverse_startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ public static string GetProfilerPath()
{
profilerName = "Profiler.dll";
}
else if ((TestLibrary.Utilities.IsLinux) || (TestLibrary.Utilities.IsFreeBSD))
else if (TestLibrary.Utilities.IsMacOSX)
{
profilerName = "libProfiler.so";
profilerName = "libProfiler.dylib";
}
else
{
profilerName = "libProfiler.dylib";
profilerName = "libProfiler.so";
}

string rootPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
Expand Down
6 changes: 3 additions & 3 deletions src/tests/profiler/unittest/releaseondetach.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public unsafe static int RunTest(string[] args)
{
profilerName = "Profiler.dll";
}
else if ((TestLibrary.Utilities.IsLinux) || (TestLibrary.Utilities.IsFreeBSD))
else if (TestLibrary.Utilities.IsMacOSX)
{
profilerName = "libProfiler.so";
profilerName = "libProfiler.dylib";
}
else
{
profilerName = "libProfiler.dylib";
profilerName = "libProfiler.so";
}

string rootPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
Expand Down
4 changes: 2 additions & 2 deletions src/tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ def setup_coredump_generation(host_os):
"""
global coredump_pattern

if host_os == "osx" or "freebsd":
if host_os == "osx" or "freebsd" or "openbsd":
coredump_pattern = subprocess.check_output("sysctl -n kern.corefile", shell=True).rstrip()
elif host_os == "linux":
with open("/proc/sys/kernel/core_pattern", "r") as f:
Expand Down Expand Up @@ -687,7 +687,7 @@ def print_info_from_coredump_file(host_os, arch, coredump_name, executable_name)

command = ""

if host_os == "osx" or "freebsd":
if host_os == "osx" or "freebsd" or "openbsd":
command = "lldb -c %s -b -o 'bt all' -o 'disassemble -b -p'" % coredump_name
elif host_os == "linux":
command = "gdb --batch -ex \"thread apply all bt full\" -ex \"disassemble /r $pc\" -ex \"quit\" %s %s" % (executable_name, coredump_name)
Expand Down
Loading