Skip to content
Merged
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
16 changes: 8 additions & 8 deletions eng/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@
<_runtimeOSVersionIndex>$(_runtimeOS.IndexOfAny(".-0123456789"))</_runtimeOSVersionIndex>
<_runtimeOSFamily Condition="'$(_runtimeOSVersionIndex)' != '-1'">$(_runtimeOS.SubString(0, $(_runtimeOSVersionIndex)))</_runtimeOSFamily>

<_buildingInOSX>$([MSBuild]::IsOSPlatform('OSX'))</_buildingInOSX>
<_portableOS>linux</_portableOS>
<_portableOS Condition="'$(_runtimeOS)' == 'linux-musl'">linux-musl</_portableOS>
<_portableOS Condition="$(_buildingInOSX)">osx</_portableOS>
<_portableOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">osx</_portableOS>
<_portableOS Condition="'$(_runtimeOSFamily)' == 'win' or '$(TargetOS)' == 'windows'">win</_portableOS>
<_portableOS Condition="'$(_runtimeOSFamily)' == 'FreeBSD'">freebsd</_portableOS>
<_portableOS Condition="'$(_runtimeOSFamily)' == 'illumos'">illumos</_portableOS>
Expand Down Expand Up @@ -123,17 +122,18 @@
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'linux-musl' and $(TargetArchitecture.StartsWith('arm')) and !$(_hostArch.StartsWith('arm'))">linux-x64</_toolRuntimeRID>

<!-- There are no WebAssembly tools, so use the default ones -->
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(TargetOS)' == 'windows'">win-x64</_toolRuntimeRID>
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(TargetOS)' != 'windows' and $(_buildingInOSX)">osx-x64</_toolRuntimeRID>
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and '$(TargetOS)' != 'windows' and !$(_buildingInOSX)">linux-x64</_toolRuntimeRID>
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser'">linux-x64</_toolRuntimeRID>
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and $([MSBuild]::IsOSPlatform('WINDOWS'))">win-x64</_toolRuntimeRID>
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'browser' and $([MSBuild]::IsOSPlatform('OSX'))">osx-x64</_toolRuntimeRID>

<!-- There are no Android tools, so use the default ones -->
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(TargetOS)' == 'windows'">win-x64</_toolRuntimeRID>
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(TargetOS)' != 'windows' and $(_buildingInOSX)">osx-x64</_toolRuntimeRID>
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and '$(TargetOS)' != 'windows' and !$(_buildingInOSX)">linux-x64</_toolRuntimeRID>
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android'">linux-x64</_toolRuntimeRID>
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and $([MSBuild]::IsOSPlatform('WINDOWS'))">win-x64</_toolRuntimeRID>
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and $([MSBuild]::IsOSPlatform('OSX'))">osx-x64</_toolRuntimeRID>

<!-- There are no iOS or tvOS tools and it can be built on OSX only, so use that -->
<_toolRuntimeRID Condition="'$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'tvos'">osx-x64</_toolRuntimeRID>

<MicrosoftNetCoreIlasmPackageRuntimeId>$(_toolRuntimeRID)</MicrosoftNetCoreIlasmPackageRuntimeId>

<_packageRID Condition="'$(PortableBuild)' == 'true'">$(_portableOS)-$(TargetArchitecture)</_packageRID>
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/src/gc/unix/cgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Module Name:
#include <errno.h>
#include <limits>

#include "config.gc.h"

#include "cgroup.h"

#ifndef SIZE_T_MAX
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/gc/unix/config.gc.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
#cmakedefine01 HAVE_SYSINFO_WITH_MEM_UNIT
#cmakedefine01 HAVE_XSW_USAGE
#cmakedefine01 HAVE_XSWDEV

#cmakedefine01 HAVE_NON_LEGACY_STATFS

#endif // __CONFIG_H__
26 changes: 26 additions & 0 deletions src/coreclr/src/gc/unix/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,30 @@ int main(int argc, char **argv)
return 0;
}" HAVE_XSW_USAGE)

check_struct_has_member(
"struct statfs"
f_fstypename
"sys/mount.h"
HAVE_STATFS_FSTYPENAME)

check_struct_has_member(
"struct statvfs"
f_fstypename
"sys/mount.h"
HAVE_STATVFS_FSTYPENAME)

# statfs: Find whether this struct exists
if (HAVE_STATFS_FSTYPENAME OR HAVE_STATVFS_FSTYPENAME)
set (STATFS_INCLUDES sys/mount.h)
else ()
set (STATFS_INCLUDES sys/statfs.h)
endif ()

check_prototype_definition(
statfs
"int statfs(const char *path, struct statfs *buf)"
0
${STATFS_INCLUDES}
HAVE_NON_LEGACY_STATFS)

configure_file(${CMAKE_CURRENT_LIST_DIR}/config.gc.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.gc.h)
14 changes: 10 additions & 4 deletions src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,7 @@ private void Get_CORINFO_SIG_INFO(MethodSignature signature, CORINFO_SIG_INFO* s
}
else
{
// Use platform default
sig->callConv = _compilation.TypeSystemContext.Target.IsWindows
? CorInfoCallConv.CORINFO_CALLCONV_STDCALL
: CorInfoCallConv.CORINFO_CALLCONV_C;
sig->callConv = (CorInfoCallConv)PlatformDefaultUnmanagedCallingConvention();
}
}

Expand Down Expand Up @@ -1043,10 +1040,19 @@ private bool isIntrinsicType(CORINFO_CLASS_STRUCT_* classHnd)
return type.IsIntrinsic;
}

private MethodSignatureFlags PlatformDefaultUnmanagedCallingConvention()
{
return _compilation.TypeSystemContext.Target.IsWindows ?
MethodSignatureFlags.UnmanagedCallingConventionStdCall : MethodSignatureFlags.UnmanagedCallingConventionCdecl;
}

private CorInfoUnmanagedCallConv getUnmanagedCallConv(CORINFO_METHOD_STRUCT_* method)
{
MethodSignatureFlags unmanagedCallConv = HandleToObject(method).GetPInvokeMethodMetadata().Flags.UnmanagedCallingConvention;

if (unmanagedCallConv == MethodSignatureFlags.None)
unmanagedCallConv = PlatformDefaultUnmanagedCallingConvention();

// Verify that it is safe to convert MethodSignatureFlags.UnmanagedCallingConvention to CorInfoUnmanagedCallConv via a simple cast
Debug.Assert((int)CorInfoUnmanagedCallConv.CORINFO_UNMANAGED_CALLCONV_C == (int)MethodSignatureFlags.UnmanagedCallingConventionCdecl);
Debug.Assert((int)CorInfoUnmanagedCallConv.CORINFO_UNMANAGED_CALLCONV_STDCALL == (int)MethodSignatureFlags.UnmanagedCallingConventionStdCall);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,6 @@ public override MethodDesc ResolveVariantInterfaceMethodToVirtualMethodOnType(Me
// See current interface call resolution for details on how that happens.
private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, MetadataType currentType)
{
if (currentType.IsInterface)
return null;

MethodDesc methodImpl = FindImplFromDeclFromMethodImpls(currentType, interfaceMethod);
if (methodImpl != null)
return methodImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public static PInvokeFlags GetDelegatePInvokeFlags(this EcmaType type)
flags.UnmanagedCallingConvention = MethodSignatureFlags.UnmanagedCallingConventionThisCall;
break;
case CallingConvention.Winapi:
flags.UnmanagedCallingConvention = MethodSignatureFlags.UnmanagedCallingConventionStdCall;
// Platform default
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,13 @@ public MethodSignatureFlags UnmanagedCallingConvention
{
switch (_attributes & PInvokeAttributes.CallingConventionMask)
{
case PInvokeAttributes.CallingConventionWinApi:
return MethodSignatureFlags.UnmanagedCallingConventionStdCall; // TODO: CDecl for varargs
case PInvokeAttributes.CallingConventionCDecl:
return MethodSignatureFlags.UnmanagedCallingConventionCdecl;
case PInvokeAttributes.CallingConventionStdCall:
return MethodSignatureFlags.UnmanagedCallingConventionStdCall;
case PInvokeAttributes.CallingConventionThisCall:
return MethodSignatureFlags.UnmanagedCallingConventionThisCall;
case PInvokeAttributes.CallingConventionWinApi: // Platform default
case PInvokeAttributes.None:
return MethodSignatureFlags.None;
default:
Expand Down
4 changes: 4 additions & 0 deletions src/libraries/Common/src/System/Sha1ForNonSecretPurposes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ public void Append(ReadOnlySpan<byte> input)
/// bytes will be lost. If the buffer is larger than 20 bytes, the
/// rest of the buffer is left unmodified.
/// </param>
#if ES_BUILD_STANDALONE
public void Finish(byte[] output)
#else
public void Finish(Span<byte> output)
#endif
{
long l = _length + 8 * _pos;
Append(0x80);
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Native/build-native.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ set __generatorArgs=
if [%__Ninja%] == [1] (
set __generatorArgs=
) else if [%__BuildArch%] == [wasm] (
set __generatorArgs=-j
set __generatorArgs=
) else (
set __generatorArgs=/p:Platform=%__BuildArch% /p:PlatformToolset="%__PlatformToolset%" -noWarn:MSB8065
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LazyThreadSafetyMode.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LockRecursionException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LowLevelLock.cs" Condition="'$(FeatureSharedLowLevelLock)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LowLevelSpinWaiter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LowLevelMonitor.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ManualResetEvent.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ManualResetEventSlim.cs" />
Expand Down Expand Up @@ -995,6 +996,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\Thread.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadAbortException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadExceptionEventArgs.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadInt64PersistentCounter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadInterruptedException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadLocal.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadPool.cs" />
Expand Down Expand Up @@ -1955,8 +1957,6 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\PortableThreadPool.CpuUtilizationReader.Windows.cs" Condition="'$(TargetsWindows)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LowLevelLifoSemaphore.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LowLevelLifoSemaphore.Windows.cs" Condition="'$(TargetsWindows)' == 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\LowLevelSpinWaiter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\RegisteredWaitHandle.Portable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Threading\ThreadInt64PersistentCounter.cs" />
</ItemGroup>
</Project>