Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
buildConfig: checked
buildConfig: debug
runtimeFlavor: coreclr
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
isiOSLikeSimulatorOnlyBuild: ${{ parameters.isiOSLikeSimulatorOnlyBuild }}
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/clrfeatures.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
if (NOT CLR_CMAKE_TARGET_ARCH_WASM)
if (NOT CLR_CMAKE_TARGET_ARCH_WASM AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_MACCATALYST)
set(FEATURE_JIT 1)
endif()

if (CLR_CMAKE_TARGET_ARCH_WASM OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
if (CLR_CMAKE_TARGET_ARCH_WASM OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS OR CLR_CMAKE_TARGET_MACCATALYST)
set(FEATURE_STATICALLY_LINKED 1)
endif()

Expand Down
6 changes: 4 additions & 2 deletions src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ endif(NOT CLR_CMAKE_HOST_ARCH_WASM)
target_link_libraries(coreclr_static PUBLIC ${CORECLR_LIBRARIES} cee_wks_core ${CORECLR_STATIC_CLRJIT_STATIC} ${CEE_WKS_STATIC} ${FOUNDATION})
target_compile_definitions(coreclr_static PUBLIC CORECLR_EMBEDDED)

if (CLR_CMAKE_HOST_ANDROID)
target_link_libraries(coreclr PUBLIC log)
if (CLR_CMAKE_HOST_ANDROID OR CLR_CMAKE_HOST_IOS OR CLR_CMAKE_HOST_TVOS OR CLR_CMAKE_HOST_MACCATALYST)
if (CLR_CMAKE_HOST_ANDROID)
target_link_libraries(coreclr PUBLIC log)
endif()
target_link_libraries(coreclr_static
PUBLIC
coreclrminipal_objects
Expand Down
30 changes: 30 additions & 0 deletions src/coreclr/interpreter/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2322,6 +2322,36 @@ bool InterpCompiler::EmitNamedIntrinsicCall(NamedIntrinsic ni, CORINFO_CLASS_HAN
return true;
}

case NI_System_Threading_Interlocked_Exchange:
{
CHECK_STACK(2);
InterpType retType = GetInterpType(sig.retType);

int32_t opcode;
switch (retType)
{
case InterpTypeI4:
opcode = INTOP_EXCHANGE_I4;
break;
case InterpTypeI8:
opcode = INTOP_EXCHANGE_I8;
break;
default:
return false;
}

AddIns(opcode);
m_pStackPointer -= 2;

int32_t addrVar = m_pStackPointer[0].var;
int32_t valueVar = m_pStackPointer[1].var;

PushInterpType(retType, nullptr);
m_pLastNewIns->SetSVars2(addrVar, valueVar);
m_pLastNewIns->SetDVar(m_pStackPointer[-1].var);
return true;
}

case NI_System_Runtime_CompilerServices_RuntimeHelpers_IsReferenceOrContainsReferences:
{
CORINFO_CLASS_HANDLE clsHnd = sig.sigInst.methInst[0];
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/interpreter/eeinterp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ CorJitResult CILInterp::compileMethod(ICorJitInfo* compHnd,
break;
}

#ifdef TARGET_WASM
// interpret everything on wasm
#if defined(TARGET_WASM) || defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST)
// interpret everything on wasm and apple mobile
doInterpret = true;
#else
// NOTE: We do this check even if doInterpret==true in order to populate g_interpModule
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/interpreter/intops.def
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ OPDEF(INTOP_LOAD_FRAMEVAR, "load.framevar", 2, 1, 0, InterpOpNoArgs)
// Intrinsics
OPDEF(INTOP_COMPARE_EXCHANGE_I4, "compare.exchange.i4", 5, 1, 3, InterpOpNoArgs)
OPDEF(INTOP_COMPARE_EXCHANGE_I8, "compare.exchange.i8", 5, 1, 3, InterpOpNoArgs)
OPDEF(INTOP_EXCHANGE_I4, "exchange.i4", 3, 1, 2, InterpOpNoArgs)
OPDEF(INTOP_EXCHANGE_I8, "exchange.i8", 3, 1, 2, InterpOpNoArgs)

// All instructions after this point are IROPS, instructions that are not emitted/executed
OPDEF(INTOP_NOP, "nop", 1, 0, 0, InterpOpNoArgs)
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/interpreter/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ NamedIntrinsic GetNamedIntrinsic(COMP_HANDLE compHnd, CORINFO_METHOD_HANDLE comp
{
if (!strcmp(methodName, "CompareExchange"))
return NI_System_Threading_Interlocked_CompareExchange;
else if (!strcmp(methodName, "Exchange"))
return NI_System_Threading_Interlocked_Exchange;
else if (!strcmp(methodName, "MemoryBarrier"))
return NI_System_Threading_Interlocked_MemoryBarrier;
}
Expand Down
23 changes: 23 additions & 0 deletions src/coreclr/vm/interpexec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2534,6 +2534,29 @@ do \
break;
}

#define EXCHANGE(type) \
do \
{ \
type* dst = LOCAL_VAR(ip[2], type*); \
NULL_CHECK(dst); \
type newValue = LOCAL_VAR(ip[3], type); \
type old = InterlockedExchangeT(dst, newValue); \
LOCAL_VAR(ip[1], type) = old; \
ip += 4; \
} while (0)

case INTOP_EXCHANGE_I4:
{
EXCHANGE(int32_t);
break;
}

case INTOP_EXCHANGE_I8:
{
EXCHANGE(int64_t);
break;
}

case INTOP_CALL_FINALLY:
{
const int32_t* targetIp = ip + ip[1];
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/prestub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2357,7 +2357,7 @@ PCODE MethodDesc::DoPrestub(MethodTable *pDispatchingMT, CallerGCMode callerGCMo
pCode = DoBackpatch(pMT, pDispatchingMT, FALSE);

Return:
#if defined(FEATURE_INTERPRETER) && defined(FEATURE_JIT)
#if defined(FEATURE_INTERPRETER) && !defined(TARGET_WASM)
InterpByteCodeStart *pInterpreterCode = GetInterpreterCode();
if (pInterpreterCode != NULL)
{
Expand Down Expand Up @@ -2924,7 +2924,7 @@ static PCODE getHelperForSharedStatic(Module * pModule, ReadyToRunFixupKind kind
}
pArgs->offset = pFD->GetOffset();

BinderMethodID managedHelperId = fUnbox ?
BinderMethodID managedHelperId = fUnbox ?
METHOD__STATICSHELPERS__STATICFIELDADDRESSUNBOX_DYNAMIC :
METHOD__STATICSHELPERS__STATICFIELDADDRESS_DYNAMIC;

Expand Down
2 changes: 1 addition & 1 deletion src/native/libs/System.Globalization.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ if(CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_WASI)
endif()

install (TARGETS System.Globalization.Native-Static DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs)
if(CLR_CMAKE_HOST_ANDROID)
if(CLR_CMAKE_HOST_ANDROID OR CLR_CMAKE_HOST_IOS OR CLR_CMAKE_HOST_TVOS OR CLR_CMAKE_HOST_MACCATALYST)
install (TARGETS System.Globalization.Native-Static DESTINATION sharedFramework COMPONENT runtime)
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ endif ()

install (TARGETS System.IO.Compression.Native-Static DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs)

if(CLR_CMAKE_HOST_ANDROID)
if(CLR_CMAKE_HOST_ANDROID OR CLR_CMAKE_HOST_IOS OR CLR_CMAKE_HOST_TVOS OR CLR_CMAKE_HOST_MACCATALYST)
install (TARGETS System.IO.Compression.Native-Static DESTINATION sharedFramework COMPONENT runtime)

foreach(BROTLI_LIB ${BROTLI_LIBRARIES})
Expand Down
2 changes: 1 addition & 1 deletion src/native/libs/System.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ set_target_properties(System.Native-Static PROPERTIES OUTPUT_NAME System.Native

install (TARGETS System.Native-Static DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs)

if(CLR_CMAKE_HOST_ANDROID)
if(CLR_CMAKE_HOST_ANDROID OR CLR_CMAKE_HOST_IOS OR CLR_CMAKE_HOST_TVOS OR CLR_CMAKE_HOST_MACCATALYST)
install (TARGETS System.Native-Static DESTINATION sharedFramework COMPONENT runtime)
endif()
5 changes: 3 additions & 2 deletions src/tasks/AppleAppBuilder/Xcode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,10 @@ public string GenerateCMake(
string[] dylibs = Directory.GetFiles(workspace, "*.dylib");
if (targetRuntime == TargetRuntime.CoreCLR)
{
foreach (string lib in dylibs)
string[] staticLibs = Directory.GetFiles(workspace, "*.a");
foreach (string lib in staticLibs)
{
toLink += $" \"-force_load {lib}\"{Environment.NewLine}";
toLink += $" \"{lib}\"{Environment.NewLine}";
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,9 @@

public static class Program
{
[DllImport("__Internal")]
public static extern void mono_ios_set_summary(string value);

public static async Task<int> Main(string[] args)
public static int Main(string[] args)
{
mono_ios_set_summary($"Starting functional test");
int result = RunInterpreter();
Console.WriteLine("Done!");
await Task.Delay(5000);

return result;
}

[MethodImpl(MethodImplOptions.NoInlining)]
public unsafe static int RunInterpreter()
{
return 42;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
</PropertyGroup>

<ItemGroup>
<EnvironmentVariables Include="DOTNET_Interpreter=RunInterpreter" />
<EnvironmentVariables Include="DOTNET_InterpDump=RunInterpreter" />
<EnvironmentVariables Include="DOTNET_InterpDump=*!*" />
<EnvironmentVariables Include="DOTNET_ReadyToRun=0" />
</ItemGroup>

Expand Down
Loading