Skip to content

Commit

Permalink
Drop CoreCLR tvOS Simulator support for now
Browse files Browse the repository at this point in the history
  • Loading branch information
filipnavara committed Apr 8, 2024
1 parent d30df01 commit eec0c41
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 51 deletions.
4 changes: 2 additions & 2 deletions docs/workflow/building/coreclr/ios.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cross Compilation for iOS/tvOS Simulator on macOS
# Cross Compilation for iOS Simulator on macOS

## Requirements

Expand All @@ -9,7 +9,7 @@ Build requirements are the same as for building native CoreCLR on macOS. iPhone
Build the runtime pack and tools with

```
./build.sh clr+clr.runtime+libs+packs -os [iossimulator/tvossimulator/maccatalyst] -arch [x64/arm64] -cross -c Release
./build.sh clr+clr.runtime+libs+packs -os [iossimulator/maccatalyst] -arch [x64/arm64] -cross -c Release
```

## Running the sample iOS app
Expand Down
49 changes: 29 additions & 20 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ if(CORECLR_SET_RPATH)
set(MACOSX_RPATH ON)
endif(CORECLR_SET_RPATH)

if(CLR_CMAKE_HOST_TVOS)
set(FEATURE_STANDALONE_GC 0)
endif()

OPTION(CLR_CMAKE_ENABLE_CODE_COVERAGE "Enable code coverage" OFF)

#----------------------------------------------------
Expand Down Expand Up @@ -97,8 +101,9 @@ if(CLR_CMAKE_HOST_UNIX)
add_linker_flag(-Wl,-z,notext)
endif()

add_subdirectory(pal)

if(NOT CLR_CMAKE_HOST_TVOS)
add_subdirectory(pal)
endif()
if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
add_subdirectory(hosts)
endif()
Expand All @@ -122,7 +127,9 @@ add_subdirectory(pal/prebuilt/inc)
set(EP_GENERATED_HEADER_PATH "${GENERATED_INCLUDE_DIR}")
include (${CLR_SRC_NATIVE_DIR}/eventpipe/configure.cmake)

add_subdirectory(debug/debug-pal)
if(NOT CLR_CMAKE_HOST_TVOS)
add_subdirectory(debug/debug-pal)
endif()

add_subdirectory(minipal)

Expand Down Expand Up @@ -236,25 +243,27 @@ if(CLR_CMAKE_HOST_UNIX)
add_subdirectory(nativeresources)
endif(CLR_CMAKE_HOST_UNIX)

add_subdirectory(utilcode)
add_subdirectory(inc)
if(NOT CLR_CMAKE_HOST_TVOS)
add_subdirectory(utilcode)
add_subdirectory(inc)

if(CLR_CMAKE_HOST_UNIX)
if(CLR_CMAKE_HOST_UNIX)
add_subdirectory(palrt)
endif(CLR_CMAKE_HOST_UNIX)

add_subdirectory(ilasm)
add_subdirectory(ildasm)
add_subdirectory(gcinfo)
add_subdirectory(jit)
add_subdirectory(vm)
add_subdirectory(md)
add_subdirectory(debug)
add_subdirectory(binder)
add_subdirectory(classlibnative)
add_subdirectory(dlls)
add_subdirectory(unwinder)
add_subdirectory(interop)
endif(CLR_CMAKE_HOST_UNIX)

add_subdirectory(ilasm)
add_subdirectory(ildasm)
add_subdirectory(gcinfo)
add_subdirectory(jit)
add_subdirectory(vm)
add_subdirectory(md)
add_subdirectory(debug)
add_subdirectory(binder)
add_subdirectory(classlibnative)
add_subdirectory(dlls)
add_subdirectory(unwinder)
add_subdirectory(interop)
endif()

if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
add_subdirectory(tools)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ endif(CLR_CMAKE_TARGET_WIN32)

# add the install targets
install_clr(TARGETS coreclr DESTINATIONS . sharedFramework COMPONENT runtime)
if(CLR_CMAKE_HOST_MACCATALYST OR CLR_CMAKE_HOST_IOS OR CLR_CMAKE_HOST_TVOS)
if(CLR_CMAKE_HOST_MACCATALYST OR CLR_CMAKE_HOST_IOS)
install_clr(TARGETS coreclr_static DESTINATIONS . sharedFramework COMPONENT runtime)
endif()

Expand Down
6 changes: 1 addition & 5 deletions src/coreclr/pal/src/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,7 @@ check_function_exists(statvfs HAVE_STATVFS)
check_function_exists(thread_self HAVE_THREAD_SELF)
check_function_exists(_lwp_self HAVE__LWP_SELF)
check_function_exists(pthread_mach_thread_np HAVE_MACH_THREADS)
if(CLR_CMAKE_TARGET_TVOS)
set(HAVE_MACH_EXCEPTIONS 0)
else()
check_function_exists(thread_set_exception_ports HAVE_MACH_EXCEPTIONS)
endif()
check_function_exists(thread_set_exception_ports HAVE_MACH_EXCEPTIONS)
check_function_exists(vm_allocate HAVE_VM_ALLOCATE)
check_function_exists(vm_read HAVE_VM_READ)
check_function_exists(directio HAVE_DIRECTIO)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/pal/src/exception/seh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ PAL_ERROR SEHEnable(CPalThread *pthrCurrent)
{
#if HAVE_MACH_EXCEPTIONS
return pthrCurrent->EnableMachExceptions();
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun) || defined(TARGET_TVOS)
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun)
return NO_ERROR;
#else// HAVE_MACH_EXCEPTIONS
#error not yet implemented
Expand All @@ -330,7 +330,7 @@ PAL_ERROR SEHDisable(CPalThread *pthrCurrent)
{
#if HAVE_MACH_EXCEPTIONS
return pthrCurrent->DisableMachExceptions();
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun) || defined(TARGET_TVOS)
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun)
return NO_ERROR;
#else // HAVE_MACH_EXCEPTIONS
#error not yet implemented
Expand Down
12 changes: 2 additions & 10 deletions src/coreclr/pal/src/exception/signal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ BOOL SEHInitializeSignals(CorUnix::CPalThread *pthrCurrent, DWORD flags)
handle_signal(SIGINT, sigint_handler, &g_previous_sigint, 0 /* additionalFlags */, true /* skipIgnored */);
handle_signal(SIGQUIT, sigquit_handler, &g_previous_sigquit, 0 /* additionalFlags */, true /* skipIgnored */);

#if HAVE_MACH_EXCEPTIONS || defined(TARGET_TVOS)
#if HAVE_MACH_EXCEPTIONS
handle_signal(SIGSEGV, sigsegv_handler, &g_previous_sigsegv);
#else
handle_signal(SIGTRAP, sigtrap_handler, &g_previous_sigtrap);
Expand Down Expand Up @@ -471,15 +471,7 @@ static void sigfpe_handler(int code, siginfo_t *siginfo, void *context)
invoke_previous_action(&g_previous_sigfpe, code, siginfo, context);
}

#if defined(TARGET_TVOS)

static bool SwitchStackAndExecuteHandler(int code, siginfo_t *siginfo, void *context, size_t sp)
{
// Not yet implemented
_exit(0xdead);
}

#elif !HAVE_MACH_EXCEPTIONS
#if !HAVE_MACH_EXCEPTIONS

/*++
Function :
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/pal/src/include/pal/thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ namespace CorUnix
m_pNext = pNext;
};

#if !HAVE_MACH_EXCEPTIONS && !defined(TARGET_TVOS)
#if !HAVE_MACH_EXCEPTIONS
BOOL
EnsureSignalAlternateStack(
void
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/pal/src/init/sxs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ AllocatePalThread(CPalThread **ppThread)
goto exit;
}

#if !HAVE_MACH_EXCEPTIONS && !defined(TARGET_TVOS)
#if !HAVE_MACH_EXCEPTIONS
// Ensure alternate stack for SIGSEGV handling. Our SIGSEGV handler is set to
// run on an alternate stack and the stack needs to be allocated per thread.
if (!pThread->EnsureSignalAlternateStack())
Expand Down
8 changes: 2 additions & 6 deletions src/coreclr/pal/src/thread/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,6 @@ CorUnix::InternalCreateProcess(
LPPROCESS_INFORMATION lpProcessInformation
)
{
#ifdef TARGET_TVOS
return ERROR_NOT_SUPPORTED;
#else
PAL_ERROR palError = NO_ERROR;
IPalObject *pobjProcess = NULL;
IPalObject *pobjProcessRegistered = NULL;
Expand Down Expand Up @@ -1084,7 +1081,6 @@ CorUnix::InternalCreateProcess(
}

return palError;
#endif // !TARGET_TVOS
}


Expand Down Expand Up @@ -2199,7 +2195,7 @@ PROCCreateCrashDump(
INT cbErrorMessageBuffer,
bool serialize)
{
#if defined(TARGET_IOS) || defined(TARGET_TVOS)
#if defined(TARGET_IOS)
return FALSE;
#else
_ASSERTE(argv.size() > 0);
Expand Down Expand Up @@ -2326,7 +2322,7 @@ PROCCreateCrashDump(
}
}
return true;
#endif // !TARGET_IOS && !TARGET_TVOS
#endif // !TARGET_IOS
}

/*++
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/pal/src/thread/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static void InternalEndCurrentThreadWrapper(void *arg)
will lock its own critical section */
LOADCallDllMain(DLL_THREAD_DETACH, NULL);

#if !HAVE_MACH_EXCEPTIONS && !defined(TARGET_TVOS)
#if !HAVE_MACH_EXCEPTIONS
pThread->FreeSignalAlternateStack();
#endif // !HAVE_MACH_EXCEPTIONS

Expand Down Expand Up @@ -1683,7 +1683,7 @@ CPalThread::ThreadEntry(
}
#endif // HAVE_SCHED_GETAFFINITY && HAVE_SCHED_SETAFFINITY

#if !HAVE_MACH_EXCEPTIONS && !defined(TARGET_TVOS)
#if !HAVE_MACH_EXCEPTIONS
if (!pThread->EnsureSignalAlternateStack())
{
ASSERT("Cannot allocate alternate stack for SIGSEGV!\n");
Expand Down Expand Up @@ -2406,7 +2406,7 @@ CPalThread::WaitForStartStatus(
return m_fStartStatus;
}

#if !HAVE_MACH_EXCEPTIONS && !defined(TARGET_TVOS)
#if !HAVE_MACH_EXCEPTIONS
/*++
Function :
EnsureSignalAlternateStack
Expand Down

0 comments on commit eec0c41

Please sign in to comment.