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

[Android] Add callback to host-runtime contract for getting assembly data #112705

Merged
merged 69 commits into from
Feb 25, 2025
Merged
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
7b144f3
Beginnings of native Android build
grendello Dec 6, 2024
06c1c83
Beginnings of native Android build
grendello Dec 6, 2024
62189fc
Bump min API level to 29 (proper TLS support) and link the right syst…
steveisok Dec 11, 2024
f9f7b90
Fix host/target confusion in R2R tool publish / Add Android target to…
steveisok Dec 13, 2024
2a1535e
Beginnings of native Android build
grendello Dec 6, 2024
10e88b0
Cleanup
ivanpovazan Jan 10, 2025
c2b4eac
Revert changes to R2R that alias Android to linux and put it in a few…
steveisok Jan 10, 2025
aebb13f
Undo host awareness in crossgen_publish as building it is about the t…
steveisok Jan 14, 2025
766af9b
Make sure android runtime pack is generated and crossgen_inbuild uses…
steveisok Jan 15, 2025
4f9e680
Condition min api level for coreclr and not.
steveisok Jan 15, 2025
2509f3f
Add FEATURE_NATIVEAOT_ONLY
steveisok Jan 16, 2025
37d326f
Revert FEATURE_NATIVEAOT_ONLY
steveisok Jan 16, 2025
ee65f01
Set PrimaryRuntimeFlavor on mobile official build and don't try to ge…
steveisok Jan 16, 2025
c17e21e
Override API level in coreclr runtime.proj and flow runtimeFlavor int…
steveisok Jan 16, 2025
83d394b
Disable ThreadStatic optimizations until emulated TLS support is added
steveisok Jan 17, 2025
0f53984
Using API level 21 should be good now
steveisok Jan 17, 2025
55cc33c
Set runtime feature flag in cmake config
kotlarmilos Jan 17, 2025
0b007c3
Don't get in the way of building coreclr+mono runtimes together. Work…
steveisok Jan 18, 2025
686bace
Allow cross build on osx when targeting arm32, fix bad arm32 linker a…
steveisok Jan 22, 2025
6f01f1d
Revert CLR_CMAKE_RUNTIME_CORECLR and enable event pipe TCP stuff
steveisok Jan 22, 2025
6143339
Exclude arm and x86 from generating packages / Always set CrossBuild=…
steveisok Jan 23, 2025
d662757
Initial Android CoreCLR initialization function implementation
grendello Jan 24, 2025
73fd37e
Preparing bundle mode for Android
grendello Jan 28, 2025
6f32ec3
Tracking why System.Private.CoreLib.dll load fails
grendello Jan 31, 2025
439962d
Don't try to mmap assembly image on Android
grendello Feb 3, 2025
0e6fe94
Tracking abort() calls
grendello Feb 4, 2025
d69a550
For now
grendello Feb 5, 2025
5895ad8
Revert "For now"
grendello Feb 6, 2025
d4cdf66
Logging to Android logcat
grendello Feb 6, 2025
75c6e4c
Write to logcat instead of stderr
grendello Feb 6, 2025
91772f4
This should work...
grendello Feb 19, 2025
32ee9a9
Update src/coreclr/vm/peimage.inl
grendello Feb 19, 2025
4026a7b
Update src/coreclr/vm/peimage.cpp
grendello Feb 19, 2025
cc4e734
Post-rebase adjustments
grendello Feb 20, 2025
0650ae7
[WIP] Remove android_coreclr_initialize and modify the existing one
grendello Feb 20, 2025
562c8e9
Cleanup - build failed locally for arm64. Removed unused blocks
steveisok Feb 20, 2025
493a186
Remove host_runtime_contract from coreclr_initialize. Current expecta…
steveisok Feb 20, 2025
3e97a9e
Update src/coreclr/hosts/inc/coreclrhost.h
grendello Feb 20, 2025
f398c6e
Update src/coreclr/inc/bundle.h
grendello Feb 20, 2025
7127b59
Update src/coreclr/hosts/inc/coreclrhost.h
grendello Feb 20, 2025
e1e7e32
Address feedback
grendello Feb 20, 2025
58b2698
Merge remote-tracking branch 'upstream/main' into dev/grendel/android…
steveisok Feb 21, 2025
7d4254a
Remove some logging related things since Elinor's PR landed
steveisok Feb 21, 2025
a16e3ed
Fix HostRuntimeContract tests
elinor-fung Feb 21, 2025
99e2bbf
AndroidGetDataStart -> GetData
elinor-fung Feb 21, 2025
cf72fbe
Don't try to manage external assembly not mapped by the runtime
elinor-fung Feb 21, 2025
f286e15
Remove newline-only changes
elinor-fung Feb 21, 2025
1533d9f
Explicitly check / document checking return value of probes
elinor-fung Feb 21, 2025
1cdb0ce
Check for non-file data instead of assuming that is the case on Android
elinor-fung Feb 21, 2025
5a97aff
Remove unnecessary check
elinor-fung Feb 21, 2025
885d117
Don't set file handle for non-file data
elinor-fung Feb 21, 2025
54ad33c
Check for null data instead of always returns FALSE for PEImage::IsFi…
elinor-fung Feb 21, 2025
2821e75
GetData -> GetExternalData
elinor-fung Feb 21, 2025
ff9021d
Remove AndroidGetAppName
elinor-fung Feb 21, 2025
38c6376
Remove BundleFileLocation::AppName
elinor-fung Feb 21, 2025
8c60c1a
Remove LogToAndroid. Scenario should now use LogToConsole.
AaronRobinsonMSFT Feb 22, 2025
57553d4
Feedback
AaronRobinsonMSFT Feb 22, 2025
dfc64db
Fix the build
AaronRobinsonMSFT Feb 22, 2025
656a6fd
Update src/coreclr/vm/peimage.cpp
AaronRobinsonMSFT Feb 22, 2025
d890acc
Update src/coreclr/vm/util.cpp
elinor-fung Feb 22, 2025
f4fe37a
Remove stripping away path. Dedup script echo
steveisok Feb 24, 2025
cf2aae6
Remove logging - ivan will follow up in a separate PR
steveisok Feb 24, 2025
2222efe
Merge branch 'main' into dev/grendel/android-clr-host-local
jkotas Feb 24, 2025
7c0350b
Remove redundant target_link_libraries
steveisok Feb 24, 2025
331e849
Merge branch 'main' into dev/grendel/android-clr-host-local
jkotas Feb 24, 2025
2dcd170
Merge branch 'main' into dev/grendel/android-clr-host-local
jkotas Feb 24, 2025
1df4b0d
Revert files with whitespace-only changes
elinor-fung Feb 24, 2025
bbf5e47
Merge branch 'main' into dev/grendel/android-clr-host-local
steveisok Feb 24, 2025
792f95e
Merge branch 'main' into dev/grendel/android-clr-host-local
steveisok Feb 25, 2025
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
Prev Previous commit
Next Next commit
Remove logging - ivan will follow up in a separate PR
steveisok committed Feb 24, 2025
commit cf2aae659aab9a9520e0e4499f9d01020054382e
6 changes: 0 additions & 6 deletions src/coreclr/dlls/mscordbi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -106,12 +106,6 @@ elseif(CLR_CMAKE_HOST_UNIX)
)
endif(CLR_CMAKE_HOST_HAIKU)

if(CLR_CMAKE_TARGET_ANDROID)
list(APPEND COREDBI_LIBRARIES
log
)
endif(CLR_CMAKE_TARGET_ANDROID)

# Before llvm 16, lld was setting `--undefined-version` by default. The default was
# flipped to `--no-undefined-version` in lld 16, so we will explicitly set it to
# `--undefined-version` for our use-case.
5 changes: 1 addition & 4 deletions src/coreclr/pal/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -300,10 +300,7 @@ if(CLR_CMAKE_TARGET_LINUX)
else(NOT CLR_CMAKE_TARGET_ANDROID)
target_link_libraries(coreclrpal
PUBLIC
${ANDROID_GLOB}
${LZMA}
PRIVATE
log)
${ANDROID_GLOB})
endif(NOT CLR_CMAKE_TARGET_ANDROID)

target_link_libraries(coreclrpal
10 changes: 0 additions & 10 deletions src/coreclr/pal/src/thread/process.cpp
Original file line number Diff line number Diff line change
@@ -71,10 +71,6 @@ SET_DEFAULT_DEBUG_CHANNEL(PROCESS); // some headers have code with asserts, so d
#include <sys/membarrier.h>
#endif

#if defined(TARGET_ANDROID)
#include <android/log.h>
#endif // defined(TARGET_ANDROID)

#ifdef __APPLE__
#include <pwd.h>
#include <sys/sysctl.h>
@@ -2549,12 +2545,6 @@ PROCAbort(int signal, siginfo_t* siginfo)
// the others to prevent multiple core dumps from being generated.
SEHCleanupSignals(false /* isChildProcess */);

#if defined(TARGET_ANDROID)
// Ideally, MAIN_CLR_MODULE_NAME_A would be used, but cor.h can't
// currently be included in the pal.
__android_log_print(ANDROID_LOG_FATAL, "coreclr", "Aborting in %s:%u", __FILE_NAME__, __LINE__);
#endif // defined(TARGET_ANDROID)

// Abort the process after waiting for the core dump to complete
abort();
}
10 changes: 0 additions & 10 deletions src/coreclr/utilcode/log.cpp
Original file line number Diff line number Diff line change
@@ -18,10 +18,6 @@
#include "log.h"
#include "utilcode.h"

#if defined(TARGET_ANDROID)
#include <android/log.h>
#endif // defined(TARGET_ANDROID)

#ifdef LOGGING

#define DEFAULT_LOGFILE_NAME W("COMPLUS.LOG")
@@ -375,16 +371,10 @@ VOID LogSpewAlwaysValist(const char *fmt, va_list args)

if (LogFlags & LOG_ENABLE_CONSOLE_LOGGING)
{
#if defined(TARGET_ANDROID)
// TODO: priority should be configurable here (best, passed via a parameter)
// likewise for the tag
__android_log_write(ANDROID_LOG_INFO, MAIN_CLR_MODULE_NAME_A, pBuffer);
#else
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), pBuffer, buflen, &written, 0);
//<TODO>@TODO ...Unnecessary to flush console?</TODO>
if (LogFlags & LOG_ENABLE_FLUSH_FILE)
FlushFileBuffers( GetStdHandle(STD_OUTPUT_HANDLE) );
#endif // defined(TARGET_ANDROID)
}

if (LogFlags & LOG_ENABLE_DEBUGGER_LOGGING)
2 changes: 0 additions & 2 deletions src/native/corehost/apphost/static/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -309,8 +309,6 @@ target_link_libraries(
if(CLR_CMAKE_TARGET_ANDROID)
target_link_libraries(
singlefilehost
PRIVATE
log
)
endif()