Skip to content

Commit 8d293e1

Browse files
committed
Drop CoreCLR tvOS Simulator support for now
1 parent bb0cde3 commit 8d293e1

File tree

10 files changed

+44
-51
lines changed

10 files changed

+44
-51
lines changed

docs/workflow/building/coreclr/ios.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Cross Compilation for iOS/tvOS Simulator on macOS
1+
# Cross Compilation for iOS Simulator on macOS
22

33
## Requirements
44

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

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

1515
## Running the sample iOS app

src/coreclr/CMakeLists.txt

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ if(CORECLR_SET_RPATH)
2929
set(MACOSX_RPATH ON)
3030
endif(CORECLR_SET_RPATH)
3131

32+
if(CLR_CMAKE_HOST_TVOS)
33+
set(FEATURE_STANDALONE_GC 0)
34+
endif()
35+
3236
OPTION(CLR_CMAKE_ENABLE_CODE_COVERAGE "Enable code coverage" OFF)
3337

3438
#----------------------------------------------------
@@ -97,8 +101,9 @@ if(CLR_CMAKE_HOST_UNIX)
97101
add_linker_flag(-Wl,-z,notext)
98102
endif()
99103

100-
add_subdirectory(pal)
101-
104+
if(NOT CLR_CMAKE_HOST_TVOS)
105+
add_subdirectory(pal)
106+
endif()
102107
if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
103108
add_subdirectory(hosts)
104109
endif()
@@ -122,7 +127,9 @@ add_subdirectory(pal/prebuilt/inc)
122127
set(EP_GENERATED_HEADER_PATH "${GENERATED_INCLUDE_DIR}")
123128
include (${CLR_SRC_NATIVE_DIR}/eventpipe/configure.cmake)
124129

125-
add_subdirectory(debug/debug-pal)
130+
if(NOT CLR_CMAKE_HOST_TVOS)
131+
add_subdirectory(debug/debug-pal)
132+
endif()
126133

127134
add_subdirectory(minipal)
128135

@@ -237,25 +244,27 @@ if(CLR_CMAKE_HOST_UNIX)
237244
add_subdirectory(nativeresources)
238245
endif(CLR_CMAKE_HOST_UNIX)
239246

240-
add_subdirectory(utilcode)
241-
add_subdirectory(inc)
247+
if(NOT CLR_CMAKE_HOST_TVOS)
248+
add_subdirectory(utilcode)
249+
add_subdirectory(inc)
242250

243-
if(CLR_CMAKE_HOST_UNIX)
251+
if(CLR_CMAKE_HOST_UNIX)
244252
add_subdirectory(palrt)
245-
endif(CLR_CMAKE_HOST_UNIX)
246-
247-
add_subdirectory(ilasm)
248-
add_subdirectory(ildasm)
249-
add_subdirectory(gcinfo)
250-
add_subdirectory(jit)
251-
add_subdirectory(vm)
252-
add_subdirectory(md)
253-
add_subdirectory(debug)
254-
add_subdirectory(binder)
255-
add_subdirectory(classlibnative)
256-
add_subdirectory(dlls)
257-
add_subdirectory(unwinder)
258-
add_subdirectory(interop)
253+
endif(CLR_CMAKE_HOST_UNIX)
254+
255+
add_subdirectory(ilasm)
256+
add_subdirectory(ildasm)
257+
add_subdirectory(gcinfo)
258+
add_subdirectory(jit)
259+
add_subdirectory(vm)
260+
add_subdirectory(md)
261+
add_subdirectory(debug)
262+
add_subdirectory(binder)
263+
add_subdirectory(classlibnative)
264+
add_subdirectory(dlls)
265+
add_subdirectory(unwinder)
266+
add_subdirectory(interop)
267+
endif()
259268

260269
if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
261270
add_subdirectory(tools)

src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ endif(CLR_CMAKE_TARGET_WIN32)
221221

222222
# add the install targets
223223
install_clr(TARGETS coreclr DESTINATIONS . sharedFramework COMPONENT runtime)
224-
if(CLR_CMAKE_HOST_MACCATALYST OR CLR_CMAKE_HOST_IOS OR CLR_CMAKE_HOST_TVOS)
224+
if(CLR_CMAKE_HOST_MACCATALYST OR CLR_CMAKE_HOST_IOS)
225225
install_clr(TARGETS coreclr_static DESTINATIONS . sharedFramework COMPONENT runtime)
226226
endif()
227227

src/coreclr/pal/src/configure.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,7 @@ check_function_exists(statvfs HAVE_STATVFS)
134134
check_function_exists(thread_self HAVE_THREAD_SELF)
135135
check_function_exists(_lwp_self HAVE__LWP_SELF)
136136
check_function_exists(pthread_mach_thread_np HAVE_MACH_THREADS)
137-
if(CLR_CMAKE_TARGET_TVOS)
138-
set(HAVE_MACH_EXCEPTIONS 0)
139-
else()
140-
check_function_exists(thread_set_exception_ports HAVE_MACH_EXCEPTIONS)
141-
endif()
137+
check_function_exists(thread_set_exception_ports HAVE_MACH_EXCEPTIONS)
142138
check_function_exists(vm_allocate HAVE_VM_ALLOCATE)
143139
check_function_exists(vm_read HAVE_VM_READ)
144140
check_function_exists(directio HAVE_DIRECTIO)

src/coreclr/pal/src/exception/seh.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ PAL_ERROR SEHEnable(CPalThread *pthrCurrent)
305305
{
306306
#if HAVE_MACH_EXCEPTIONS
307307
return pthrCurrent->EnableMachExceptions();
308-
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun) || defined(TARGET_TVOS)
308+
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun)
309309
return NO_ERROR;
310310
#else// HAVE_MACH_EXCEPTIONS
311311
#error not yet implemented
@@ -330,7 +330,7 @@ PAL_ERROR SEHDisable(CPalThread *pthrCurrent)
330330
{
331331
#if HAVE_MACH_EXCEPTIONS
332332
return pthrCurrent->DisableMachExceptions();
333-
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun) || defined(TARGET_TVOS)
333+
#elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__sun)
334334
return NO_ERROR;
335335
#else // HAVE_MACH_EXCEPTIONS
336336
#error not yet implemented

src/coreclr/pal/src/exception/signal.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ BOOL SEHInitializeSignals(CorUnix::CPalThread *pthrCurrent, DWORD flags)
182182
handle_signal(SIGINT, sigint_handler, &g_previous_sigint, 0 /* additionalFlags */, true /* skipIgnored */);
183183
handle_signal(SIGQUIT, sigquit_handler, &g_previous_sigquit, 0 /* additionalFlags */, true /* skipIgnored */);
184184

185-
#if HAVE_MACH_EXCEPTIONS || defined(TARGET_TVOS)
185+
#if HAVE_MACH_EXCEPTIONS
186186
handle_signal(SIGSEGV, sigsegv_handler, &g_previous_sigsegv);
187187
#else
188188
handle_signal(SIGTRAP, sigtrap_handler, &g_previous_sigtrap);
@@ -471,15 +471,7 @@ static void sigfpe_handler(int code, siginfo_t *siginfo, void *context)
471471
invoke_previous_action(&g_previous_sigfpe, code, siginfo, context);
472472
}
473473

474-
#if defined(TARGET_TVOS)
475-
476-
static bool SwitchStackAndExecuteHandler(int code, siginfo_t *siginfo, void *context, size_t sp)
477-
{
478-
// Not yet implemented
479-
_exit(0xdead);
480-
}
481-
482-
#elif !HAVE_MACH_EXCEPTIONS
474+
#if !HAVE_MACH_EXCEPTIONS
483475

484476
/*++
485477
Function :

src/coreclr/pal/src/include/pal/thread.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ namespace CorUnix
588588
m_pNext = pNext;
589589
};
590590

591-
#if !HAVE_MACH_EXCEPTIONS && !defined(TARGET_TVOS)
591+
#if !HAVE_MACH_EXCEPTIONS
592592
BOOL
593593
EnsureSignalAlternateStack(
594594
void

src/coreclr/pal/src/init/sxs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ AllocatePalThread(CPalThread **ppThread)
6464
goto exit;
6565
}
6666

67-
#if !HAVE_MACH_EXCEPTIONS && !defined(TARGET_TVOS)
67+
#if !HAVE_MACH_EXCEPTIONS
6868
// Ensure alternate stack for SIGSEGV handling. Our SIGSEGV handler is set to
6969
// run on an alternate stack and the stack needs to be allocated per thread.
7070
if (!pThread->EnsureSignalAlternateStack())

src/coreclr/pal/src/thread/process.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,6 @@ CorUnix::InternalCreateProcess(
545545
LPPROCESS_INFORMATION lpProcessInformation
546546
)
547547
{
548-
#ifdef TARGET_TVOS
549-
return ERROR_NOT_SUPPORTED;
550-
#else
551548
PAL_ERROR palError = NO_ERROR;
552549
IPalObject *pobjProcess = NULL;
553550
IPalObject *pobjProcessRegistered = NULL;
@@ -1084,7 +1081,6 @@ CorUnix::InternalCreateProcess(
10841081
}
10851082

10861083
return palError;
1087-
#endif // !TARGET_TVOS
10881084
}
10891085

10901086

@@ -2199,7 +2195,7 @@ PROCCreateCrashDump(
21992195
INT cbErrorMessageBuffer,
22002196
bool serialize)
22012197
{
2202-
#if defined(TARGET_IOS) || defined(TARGET_TVOS)
2198+
#if defined(TARGET_IOS)
22032199
return FALSE;
22042200
#else
22052201
_ASSERTE(argv.size() > 0);
@@ -2326,7 +2322,7 @@ PROCCreateCrashDump(
23262322
}
23272323
}
23282324
return true;
2329-
#endif // !TARGET_IOS && !TARGET_TVOS
2325+
#endif // !TARGET_IOS
23302326
}
23312327

23322328
/*++

src/coreclr/pal/src/thread/thread.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static void InternalEndCurrentThreadWrapper(void *arg)
173173
will lock its own critical section */
174174
LOADCallDllMain(DLL_THREAD_DETACH, NULL);
175175

176-
#if !HAVE_MACH_EXCEPTIONS && !defined(TARGET_TVOS)
176+
#if !HAVE_MACH_EXCEPTIONS
177177
pThread->FreeSignalAlternateStack();
178178
#endif // !HAVE_MACH_EXCEPTIONS
179179

@@ -1683,7 +1683,7 @@ CPalThread::ThreadEntry(
16831683
}
16841684
#endif // HAVE_SCHED_GETAFFINITY && HAVE_SCHED_SETAFFINITY
16851685

1686-
#if !HAVE_MACH_EXCEPTIONS && !defined(TARGET_TVOS)
1686+
#if !HAVE_MACH_EXCEPTIONS
16871687
if (!pThread->EnsureSignalAlternateStack())
16881688
{
16891689
ASSERT("Cannot allocate alternate stack for SIGSEGV!\n");
@@ -2406,7 +2406,7 @@ CPalThread::WaitForStartStatus(
24062406
return m_fStartStatus;
24072407
}
24082408

2409-
#if !HAVE_MACH_EXCEPTIONS && !defined(TARGET_TVOS)
2409+
#if !HAVE_MACH_EXCEPTIONS
24102410
/*++
24112411
Function :
24122412
EnsureSignalAlternateStack

0 commit comments

Comments
 (0)