From c87683474dbbe9c39230faa6774b617dd28e07de Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Tue, 15 Feb 2022 16:02:51 -0500 Subject: [PATCH 1/3] Add a transport package with libmono-profiler-aot.so on Android --- eng/Subsets.props | 6 ++++++ src/mono/mono.proj | 3 +++ src/mono/mono/profiler/CMakeLists.txt | 7 +++++++ ...time.MonoAOTCompiler.Profiler.Mono.pkgproj | 19 +++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Profiler.Mono/Microsoft.NET.Runtime.MonoAOTCompiler.Profiler.Mono.pkgproj diff --git a/eng/Subsets.props b/eng/Subsets.props index 8d288c73ee9615..b678cb7ec467d7 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -65,6 +65,7 @@ mono.llvm+ mono.llvm+ $(DefaultMonoSubsets)mono.wasmruntime+ + $(DefaultMonoSubsets)mono.aotprofiler+ $(DefaultMonoSubsets)mono.aotcross+ $(DefaultMonoSubsets)mono.runtime+mono.corelib+mono.packages @@ -128,6 +129,7 @@ + @@ -334,6 +336,10 @@ + + + + diff --git a/src/mono/mono.proj b/src/mono/mono.proj index ed1945437a6689..f58e2eac5e5ced 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -861,6 +861,9 @@ <_MonoRuntimeArtifacts Condition="'$(TargetsBrowser)' == 'true' and '$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(MonoObjDir)out\lib\libmono-profiler-aot.a"> $(RuntimeBinDir)libmono-profiler-aot.a + <_MonoRuntimeArtifacts Condition="'$(TargetsAndroid)' == 'true' and '$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(MonoObjDir)out\lib\libmono-profiler-aot.so"> + $(RuntimeBinDir)\..\..\monoprofiler\$(PlatformConfigPathPart)\libmono-profiler-aot.so + <_MonoICorDebugArtifacts Condition="'$(MonoMsCorDbi)' == 'true'" Include="$(MonoObjDir)out\lib\$(LibPrefix)dbgshim$(LibSuffix)"> $(RuntimeBinDir)$(LibPrefix)dbgshim$(LibSuffix) diff --git a/src/mono/mono/profiler/CMakeLists.txt b/src/mono/mono/profiler/CMakeLists.txt index b8092fe882578b..866784fec0d070 100644 --- a/src/mono/mono/profiler/CMakeLists.txt +++ b/src/mono/mono/profiler/CMakeLists.txt @@ -28,6 +28,13 @@ if(NOT DISABLE_LIBS) endif() endif() + if(HOST_ANDROID) + add_library(mono-profiler-aot SHARED aot.c helper.c) + target_compile_definitions(mono-profiler-aot PRIVATE -DMONO_DLL_EXPORT) + target_link_libraries(mono-profiler-aot monosgen-shared eglib_objects log) + install(TARGETS mono-profiler-aot LIBRARY) + endif() + if(NOT HOST_WASI) add_library(mono-profiler-aot-static STATIC aot.c helper.c) set_target_properties(mono-profiler-aot-static PROPERTIES OUTPUT_NAME mono-profiler-aot) diff --git a/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Profiler.Mono/Microsoft.NET.Runtime.MonoAOTCompiler.Profiler.Mono.pkgproj b/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Profiler.Mono/Microsoft.NET.Runtime.MonoAOTCompiler.Profiler.Mono.pkgproj new file mode 100644 index 00000000000000..852f770d139bce --- /dev/null +++ b/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Profiler.Mono/Microsoft.NET.Runtime.MonoAOTCompiler.Profiler.Mono.pkgproj @@ -0,0 +1,19 @@ + + + + + true + true + Provides AOT profiler for Mono runtime + false + false + transport.$(PackageRID). + Microsoft.NET.Runtime.MonoAOTCompiler.Profiler.Mono + + + + + + + + From 7b55726604c5075ba201811af6e547f0402f4a7f Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Thu, 17 Feb 2022 12:39:16 -0500 Subject: [PATCH 2/3] Link monoapi in profiler --- src/mono/mono/profiler/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/profiler/CMakeLists.txt b/src/mono/mono/profiler/CMakeLists.txt index 770a8199533f7d..2453a453544048 100644 --- a/src/mono/mono/profiler/CMakeLists.txt +++ b/src/mono/mono/profiler/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT DISABLE_LIBS) add_library(mono-profiler-log-static STATIC helper.c log.c log-args.c) target_link_libraries(mono-profiler-log-static monoapi) - set_target_properties(mono-profiler-log-static PROPERTIES OUTPUT_NAME mono-profiler-log) + set_target_properties(mono-profiler-log-static PROPERTIES OUTPUT_NAME mono-profiler-log monoapi) install(TARGETS mono-profiler-log-static LIBRARY) if(NOT DISABLE_LOG_PROFILER_GZ) @@ -32,7 +32,7 @@ if(NOT DISABLE_LIBS) if(HOST_ANDROID) add_library(mono-profiler-aot SHARED aot.c helper.c) target_compile_definitions(mono-profiler-aot PRIVATE -DMONO_DLL_EXPORT) - target_link_libraries(mono-profiler-aot monosgen-shared eglib_objects log) + target_link_libraries(mono-profiler-aot monosgen-shared eglib_objects log monoapi) install(TARGETS mono-profiler-aot LIBRARY) endif() From 3cb89a49a689acf84227d3d3fdcef24ba58b268d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksey=20Kliger=20=28=CE=BBgeek=29?= Date: Thu, 17 Feb 2022 13:24:30 -0500 Subject: [PATCH 3/3] remove monoapi from set_target_properties --- src/mono/mono/profiler/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/profiler/CMakeLists.txt b/src/mono/mono/profiler/CMakeLists.txt index 2453a453544048..0328b1c420015f 100644 --- a/src/mono/mono/profiler/CMakeLists.txt +++ b/src/mono/mono/profiler/CMakeLists.txt @@ -21,7 +21,7 @@ if(NOT DISABLE_LIBS) add_library(mono-profiler-log-static STATIC helper.c log.c log-args.c) target_link_libraries(mono-profiler-log-static monoapi) - set_target_properties(mono-profiler-log-static PROPERTIES OUTPUT_NAME mono-profiler-log monoapi) + set_target_properties(mono-profiler-log-static PROPERTIES OUTPUT_NAME mono-profiler-log) install(TARGETS mono-profiler-log-static LIBRARY) if(NOT DISABLE_LOG_PROFILER_GZ)