Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building CoreCLR for MacCatalyst/iOS simulator #109928

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
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
33 changes: 33 additions & 0 deletions docs/workflow/building/coreclr/ios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Cross Compilation for iOS Simulator on macOS

## Requirements

Build requirements are the same as for building native CoreCLR on macOS. iPhone SDK has to be enabled in Xcode installation.

## Cross compiling CoreCLR

Build the runtime pack and tools with

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

## Running the sample iOS app

Build and run the sample app with

```
./dotnet.sh publish src/mono/sample/iOS/Program.csproj -c Release /p:TargetOS=iossimulator /p:TargetArchitecture=arm64 /p:DeployAndRun=true /p:UseMonoRuntime=false /p:RunAOTCompilation=false /p:MonoForceInterpreter=false
```

The command also produces an XCode project that can be opened with `open ./src/mono/sample/iOS/bin/iossimulator-arm64/Bundle/HelloiOS/HelloiOS.xcodeproj` and debugged in Xcode.

## Running the runtime tests

Build the runtime tests with

```
./src/tests/build.sh -os iossimulator arm64 Release -p:UseMonoRuntime=false
```

Running the tests is not implemented yet. It will likely need similar app bundle infrastructure as NativeAOT/iOS uses.
6 changes: 3 additions & 3 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
</PropertyGroup>

<PropertyGroup>
<RuntimeFlavor Condition="'$(TargetsMobile)' == 'true' and !$(_subset.Contains('+clr.nativeaotlibs+'))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="('$(TargetsMobile)' == 'true' or '$(TargetsLinuxBionic)' == 'true') and $(_subset.Contains('+clr.nativeaotlibs+'))">CoreCLR</RuntimeFlavor>
<RuntimeFlavor Condition="('$(TargetsMobile)' == 'true' or '$(TargetsLinuxBionic)' == 'true') and ($(_subset.Contains('+clr.nativeaotlibs+')) or $(_subset.Contains('+clr.runtime+')))">CoreCLR</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and '$(TargetsMobile)' == 'true'">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and ($(_subset.Contains('+mono+')) or $(_subset.Contains('+mono.runtime+'))) and (!$(_subset.Contains('+clr+')) and !$(_subset.Contains('+clr.runtime+')))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">$(PrimaryRuntimeFlavor)</RuntimeFlavor>
</PropertyGroup>
Expand All @@ -67,7 +67,7 @@
<DefaultCoreClrSubsets>clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools+host.native</DefaultCoreClrSubsets>
<DefaultCoreClrSubsets Condition="'$(PackageRID)' == 'linux-armel'">clr.native+linuxdac+clr.corelib+clr.tools+clr.nativecorelib+clr.packages+clr.nativeaotlibs+clr.crossarchtools</DefaultCoreClrSubsets>
<!-- Even on platforms that do not support the CoreCLR runtime, we still want to build ilasm/ildasm. -->
<DefaultCoreClrSubsets Condition="'$(PrimaryRuntimeFlavor)' != 'CoreCLR'">clr.iltools+clr.packages</DefaultCoreClrSubsets>
<DefaultCoreClrSubsets Condition="'$(RuntimeFlavor)' != 'CoreCLR'">clr.iltools+clr.packages</DefaultCoreClrSubsets>

<DefaultNativeAotSubsets>clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime</DefaultNativeAotSubsets>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageFile Include="$(RuntimeBinDir)R2RDump\ILCompiler.Reflection.ReadyToRun.dll">
<PackageFile Include="$(RuntimeBinDir)ILCompiler.Reflection.ReadyToRun.dll">
<TargetPath>\lib\netstandard2.0\</TargetPath>
</PackageFile>
<Dependency Include="System.Reflection.Metadata">
Expand Down
23 changes: 14 additions & 9 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(CORECLR_SET_RPATH)
set(MACOSX_RPATH ON)
endif(CORECLR_SET_RPATH)

if(CLR_CMAKE_HOST_MACCATALYST OR CLR_CMAKE_HOST_IOS OR CLR_CMAKE_HOST_TVOS)
if(CLR_CMAKE_HOST_TVOS)
set(FEATURE_STANDALONE_GC 0)
endif()

Expand Down Expand Up @@ -59,7 +59,7 @@ include(components.cmake)
#---------------------------
# Build the single file host
#---------------------------
if(NOT CLR_CROSS_COMPONENTS_BUILD)
if(NOT CLR_CROSS_COMPONENTS_BUILD AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS)
set(CLR_SINGLE_FILE_HOST_ONLY 1)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/corehost/apphost/static Corehost.Static)
add_dependencies(runtime singlefilehost)
Expand Down Expand Up @@ -101,8 +101,10 @@ if(CLR_CMAKE_HOST_UNIX)
add_linker_flag(-Wl,-z,notext)
endif()

if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
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()
else()
Expand All @@ -129,7 +131,7 @@ add_subdirectory(${CLR_SRC_NATIVE_DIR}/containers containers)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/eventpipe eventpipe)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/minipal shared_minipal)

if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
if(NOT CLR_CMAKE_HOST_TVOS)
add_subdirectory(debug/debug-pal)
endif()

Expand Down Expand Up @@ -246,7 +248,7 @@ if(CLR_CMAKE_HOST_UNIX)
add_subdirectory(nativeresources)
endif(CLR_CMAKE_HOST_UNIX)

if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
if(NOT CLR_CMAKE_HOST_TVOS)
add_subdirectory(utilcode)
add_subdirectory(inc)

Expand All @@ -260,15 +262,18 @@ if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_H
add_subdirectory(binder)
add_subdirectory(classlibnative)
add_subdirectory(dlls)
add_subdirectory(tools)
add_subdirectory(unwinder)
add_subdirectory(interop)
endif()

if(CLR_CMAKE_HOST_WIN32)
add_subdirectory(hosts)
endif(CLR_CMAKE_HOST_WIN32)
if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
add_subdirectory(tools)
endif(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)

if(CLR_CMAKE_HOST_WIN32)
add_subdirectory(hosts)
endif(CLR_CMAKE_HOST_WIN32)

#----------------------------------------------------
# Cross target Component install configuration
#----------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/debug/daccess/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ target_link_libraries(daccess PRIVATE cdacreader_api)

add_dependencies(daccess eventing_headers)

if(CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
if(CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS OR CLR_CMAKE_HOST_APPLE)
add_definitions(-DUSE_DAC_TABLE_RVA)

set(args $<$<NOT:$<BOOL:${CLR_CMAKE_HOST_OSX}>>:--dynamic> $<TARGET_FILE:coreclr> ${GENERATED_INCLUDE_DIR}/dactablerva.h)
set(args $<$<NOT:$<BOOL:${CLR_CMAKE_HOST_APPLE}>>:--dynamic> $<TARGET_FILE:coreclr> ${GENERATED_INCLUDE_DIR}/dactablerva.h)

add_custom_command(
OUTPUT ${GENERATED_INCLUDE_DIR}/dactablerva.h
Expand All @@ -72,4 +72,4 @@ if(CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
)

add_dependencies(daccess dactablerva_header)
endif(CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS)
endif(CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS OR CLR_CMAKE_HOST_APPLE)
4 changes: 2 additions & 2 deletions src/coreclr/dlls/mscordac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ else(CLR_CMAKE_HOST_WIN32)
# Add dependency on export file
add_custom_target(mscordaccore_exports DEPENDS ${EXPORTS_FILE})

if(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS OR CLR_CMAKE_HOST_HAIKU)
if(CLR_CMAKE_HOST_APPLE OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS OR CLR_CMAKE_HOST_HAIKU)
generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS OR CLR_CMAKE_HOST_HAIKU)
endif(CLR_CMAKE_HOST_APPLE OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS OR CLR_CMAKE_HOST_HAIKU)

if(CORECLR_SET_RPATH AND CLR_CMAKE_HOST_OSX AND CLR_CMAKE_HOST_ARCH_ARM64)
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ 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)
install_clr(TARGETS coreclr_static DESTINATIONS . sharedFramework COMPONENT runtime)
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to install this?

Copy link
Member Author

Choose a reason for hiding this comment

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

iOS generally restricts linking to static libraries or dynamic frameworks distributed with the app itself. The aim was to include statically built CoreCLR in the runtime pack.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if that means that the single file is the only deployment mechanism on iOS. If it is the case, then I am not sure what would be the scenario where developers would explicitly use the static version of coreclr.

Copy link
Member

Choose a reason for hiding this comment

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

Linking with a static library typically results in smaller apps, which is why we've always linked Mono statically by default.

Linking dynamically can make the build a little bit faster (from past experience in Xamarin, we never ported this to .NET when we migrated due to time constraints).

Copy link
Member

Choose a reason for hiding this comment

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

The single file is a host statically linked to all the native libraries including coreclr. The scenario when the developers would need static coreclr library would be when they want to use their own host. Thinking about it more, I guess distributing the static coreclr version actually makes sense to enable such scenarios.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that sounds like what we want.

Note that .dylib won't do (Apple doesn't allow them in iOS apps), each dynamic library has to be made into a .framework (which works).

FWIW Apple has recommended using no more than 6-8 .frameworks because otherwise it affects startup performance.

endif()

# Enable profile guided optimization
add_pgo(coreclr)
8 changes: 7 additions & 1 deletion src/coreclr/hosts/inc/coreclrhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@
#define CORECLR_CALLING_CONVENTION
#endif

#ifdef __cplusplus
#define CORECLR_HOSTING_API_LINKAGE extern "C"
#else
#define CORECLR_HOSTING_API_LINKAGE
#endif

#include <stdint.h>

// For each hosting API, we define a function prototype and a function pointer
// The prototype is useful for implicit linking against the dynamic coreclr
// library and the pointer for explicit dynamic loading (dlopen, LoadLibrary)
#define CORECLR_HOSTING_API(function, ...) \
extern "C" int CORECLR_CALLING_CONVENTION function(__VA_ARGS__); \
CORECLR_HOSTING_API_LINKAGE int CORECLR_CALLING_CONVENTION function(__VA_ARGS__); \
typedef int (CORECLR_CALLING_CONVENTION *function##_ptr)(__VA_ARGS__)

//
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/inc/crosscomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define MAKE_TARGET_DLLNAME_W(name) name W(".dll")
#define MAKE_TARGET_DLLNAME_A(name) name ".dll"
#else // TARGET_WINDOWS
#ifdef TARGET_OSX
#ifdef TARGET_APPLE
#define MAKE_TARGET_DLLNAME_W(name) W("lib") name W(".dylib")
#define MAKE_TARGET_DLLNAME_A(name) "lib" name ".dylib"
#else
Expand Down Expand Up @@ -686,9 +686,9 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS {

#if defined(TARGET_OSX) && defined(TARGET_X86)
#define DAC_CS_NATIVE_DATA_SIZE 76
#elif defined(TARGET_OSX) && defined(TARGET_AMD64)
#elif defined(TARGET_APPLE) && defined(TARGET_AMD64)
#define DAC_CS_NATIVE_DATA_SIZE 120
#elif defined(TARGET_OSX) && defined(TARGET_ARM64)
#elif defined(TARGET_APPLE) && defined(TARGET_ARM64)
#define DAC_CS_NATIVE_DATA_SIZE 120
#elif defined(TARGET_FREEBSD) && defined(TARGET_X86)
#define DAC_CS_NATIVE_DATA_SIZE 12
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/inc/executableallocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class ExecutableWriterHolder

void Unmap()
{
#if defined(HOST_OSX) && defined(HOST_ARM64) && !defined(DACCESS_COMPILE)
#if defined(HOST_APPLE) && defined(HOST_ARM64) && !defined(DACCESS_COMPILE)
if (m_addressRX != NULL)
{
PAL_JitWriteProtect(false);
Expand Down Expand Up @@ -321,7 +321,7 @@ class ExecutableWriterHolder
ExecutableWriterHolder(T* addressRX, size_t size, ExecutableAllocator::CacheableMapping cacheMapping = ExecutableAllocator::AddToCache)
{
m_addressRX = addressRX;
#if defined(HOST_OSX) && defined(HOST_ARM64)
#if defined(HOST_APPLE) && defined(HOST_ARM64)
m_addressRW = addressRX;
PAL_JitWriteProtect(true);
#else
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/inc/targetosarch.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TargetOS
static bool OSSettingConfigured;
static bool IsApplePlatform;
#else
#if defined(TARGET_OSX)
#if defined(TARGET_APPLE)
static const bool IsApplePlatform = true;
#else
static const bool IsApplePlatform = false;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ set(JIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# Creates a static library "clrjit_static" to link into the VM.
add_subdirectory(static)

if (CLR_CMAKE_TARGET_OSX)
if (CLR_CMAKE_TARGET_APPLE)
set(TARGET_OS_NAME unix_osx)
elseif (CLR_CMAKE_TARGET_UNIX)
set(TARGET_OS_NAME unix)
Expand Down
34 changes: 17 additions & 17 deletions src/coreclr/minipal/Unix/doublemapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
#include "minipal.h"
#include "minipal/cpufeatures.h"

#ifdef TARGET_OSX
#ifdef TARGET_APPLE

#include <mach/mach.h>

#else // TARGET_OSX
#else // TARGET_APPLE

#ifdef TARGET_64BIT
static const off_t MaxDoubleMappedSize = 2048ULL*1024*1024*1024;
#else
static const off_t MaxDoubleMappedSize = UINT_MAX;
#endif

#endif // TARGET_OSX
#endif // TARGET_APPLE

bool VMToOSInterface::CreateDoubleMemoryMapper(void** pHandle, size_t *pMaxExecutableCodeSize)
{
Expand All @@ -44,7 +44,7 @@ bool VMToOSInterface::CreateDoubleMemoryMapper(void** pHandle, size_t *pMaxExecu
return false;
}

#ifndef TARGET_OSX
#ifndef TARGET_APPLE

#ifdef TARGET_FREEBSD
int fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, S_IRWXU);
Expand All @@ -71,25 +71,25 @@ bool VMToOSInterface::CreateDoubleMemoryMapper(void** pHandle, size_t *pMaxExecu

*pMaxExecutableCodeSize = MaxDoubleMappedSize;
*pHandle = (void*)(size_t)fd;
#else // !TARGET_OSX
#else // !TARGET_APPLE

*pMaxExecutableCodeSize = SIZE_MAX;
*pHandle = NULL;
#endif // !TARGET_OSX
#endif // !TARGET_APPLE

return true;
}

void VMToOSInterface::DestroyDoubleMemoryMapper(void *mapperHandle)
{
#ifndef TARGET_OSX
#ifndef TARGET_APPLE
close((int)(size_t)mapperHandle);
#endif
}

extern "C" void* PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(const void* lpBeginAddress, const void* lpEndAddress, size_t dwSize, int fStoreAllocationInfo);

#ifdef TARGET_OSX
#ifdef TARGET_APPLE
bool IsMapJitFlagNeeded()
{
static volatile int isMapJitFlagNeeded = -1;
Expand Down Expand Up @@ -120,7 +120,7 @@ bool IsMapJitFlagNeeded()

return (bool)isMapJitFlagNeeded;
}
#endif // TARGET_OSX
#endif // TARGET_APPLE

void* VMToOSInterface::ReserveDoubleMappedMemory(void *mapperHandle, size_t offset, size_t size, const void *rangeStart, const void* rangeEnd)
{
Expand All @@ -134,7 +134,7 @@ void* VMToOSInterface::ReserveDoubleMappedMemory(void *mapperHandle, size_t offs
}

void* result = PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(rangeStart, rangeEnd, size, 0 /* fStoreAllocationInfo */);
#ifndef TARGET_OSX
#ifndef TARGET_APPLE
if (result != NULL)
{
// Map the shared memory over the range reserved from the executable memory allocator.
Expand All @@ -145,15 +145,15 @@ void* VMToOSInterface::ReserveDoubleMappedMemory(void *mapperHandle, size_t offs
result = NULL;
}
}
#endif // TARGET_OSX
#endif // TARGET_APPLE

// For requests with limited range, don't try to fall back to reserving at any address
if ((result != NULL) || !isUnlimitedRange)
{
return result;
}

#ifndef TARGET_OSX
#ifndef TARGET_APPLE
result = mmap(NULL, size, PROT_NONE, MAP_SHARED, fd, offset);
#else
int mmapFlags = MAP_ANON | MAP_PRIVATE;
Expand Down Expand Up @@ -183,28 +183,28 @@ void *VMToOSInterface::CommitDoubleMappedMemory(void* pStart, size_t size, bool

bool VMToOSInterface::ReleaseDoubleMappedMemory(void *mapperHandle, void* pStart, size_t offset, size_t size)
{
#ifndef TARGET_OSX
#ifndef TARGET_APPLE
int fd = (int)(size_t)mapperHandle;
if (mmap(pStart, size, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, offset) == MAP_FAILED)
{
return false;
}
memset(pStart, 0, size);
#endif // TARGET_OSX
#endif // TARGET_APPLE
return munmap(pStart, size) != -1;
}

void* VMToOSInterface::GetRWMapping(void *mapperHandle, void* pStart, size_t offset, size_t size)
{
#ifndef TARGET_OSX
#ifndef TARGET_APPLE
int fd = (int)(size_t)mapperHandle;
void* result = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset);
if (result == MAP_FAILED)
{
result = NULL;
}
return result;
#else // TARGET_OSX
#else // TARGET_APPLE
#ifdef TARGET_AMD64
vm_address_t startRW;
vm_prot_t curProtection, maxProtection;
Expand All @@ -229,7 +229,7 @@ void* VMToOSInterface::GetRWMapping(void *mapperHandle, void* pStart, size_t off
assert(false);
return NULL;
#endif // TARGET_AMD64
#endif // TARGET_OSX
#endif // TARGET_APPLE
}

bool VMToOSInterface::ReleaseRWMapping(void* pStart, size_t size)
Expand Down
Loading
Loading