forked from xamarin/xamarin-macios
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[runtime] Create a version of our runtime that can be used with Nativ…
…eAOT. This contributes towards xamarin#17339.
- Loading branch information
1 parent
00e5713
commit d237df7
Showing
8 changed files
with
118 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ | ||
/* | ||
* Authors: Rolf Bjarne Kvinge | ||
* | ||
* Copyright (C) 2023 Microsoft Corp. | ||
* | ||
*/ | ||
|
||
#if defined (NATIVEAOT) | ||
|
||
#include <sys/stat.h> | ||
#include <inttypes.h> | ||
#include <pthread.h> | ||
#include <sys/mman.h> | ||
#include <dlfcn.h> | ||
|
||
#include "product.h" | ||
#include "runtime-internal.h" | ||
#include "slinked-list.h" | ||
#include "xamarin/xamarin.h" | ||
#include "xamarin/coreclr-bridge.h" | ||
#include "xamarin/nativeaot-bridge.h" | ||
|
||
void | ||
xamarin_bridge_call_runtime_initialize (struct InitializationOptions* options, GCHandle* exception_gchandle) | ||
{ | ||
xamarin_objcruntime_runtime_nativeaotinitialize (options, exception_gchandle); | ||
} | ||
|
||
bool | ||
xamarin_bridge_vm_initialize (int propertyCount, const char **propertyKeys, const char **propertyValues) | ||
{ | ||
return true; | ||
} | ||
|
||
int | ||
mono_jit_exec (MonoDomain * domain, MonoAssembly * assembly, int argc, const char** argv) | ||
{ | ||
return __managed__Main (argc, argv); | ||
} | ||
|
||
#endif // NATIVEAOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
/* Support for using NativeAOT */ | ||
|
||
#if defined (NATIVEAOT) | ||
|
||
#ifndef __NATIVEAOT_BRIDGE__ | ||
#define __NATIVEAOT_BRIDGE__ | ||
|
||
#include <stdatomic.h> | ||
|
||
#include "runtime.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void xamarin_objcruntime_runtime_nativeaotinitialize (struct InitializationOptions* options, GCHandle* exception_gchandle); | ||
int __managed__Main (int argc, const char** argv); | ||
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif | ||
|
||
#endif /* __NATIVEAOT_BRIDGE__ */ | ||
|
||
#endif // NATIVEAOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters