Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1d8483b
Apple side of the library builder
Jan 11, 2023
6cc724f
Embed framework through cmake on iOS. Add android fragments
Jan 12, 2023
bbf6992
Android library build
Jan 18, 2023
0055975
Bring back android exports
Jan 19, 2023
76cdbe4
Fix android library build by getting rid of force_load as that is onl…
Jan 21, 2023
9caea1f
Merge remote-tracking branch 'upstream/main' into lib-builder-mobile
Jan 24, 2023
9c3d805
Android builds library in separate cmake. iOS does too, but there are…
Feb 1, 2023
37fde1a
Add ability to pass in library projects to the main app
Feb 6, 2023
e3d1fd4
Clean up Android and scale back iOS to just building the library.
Feb 8, 2023
3911d2c
Merge remote-tracking branch 'upstream/main' into lib-builder-mobile
Feb 8, 2023
9bb0dd9
Move symbol table stripping to its own method
Feb 8, 2023
4ed46bf
Revert aotcompiler.c workaround
Feb 8, 2023
fde2bda
Condition some of the library builder specific items
Feb 8, 2023
d6fd785
Cleanup
Feb 9, 2023
cde3f9d
Add library builder tasks as a correlation payload.
Feb 10, 2023
6ba6aa9
Remove unnecessary librarybuilder props import
Feb 10, 2023
ba37138
Feedback
Feb 13, 2023
d3c03ac
Make sure sample provides linker arg items
Feb 14, 2023
04acf6c
Linker args in runtime test build
Feb 14, 2023
f4c204f
Merge remote-tracking branch 'upstream/main' into lib-builder-mobile
Feb 22, 2023
2ccf282
Make the runtime libraries to link actually work
Feb 23, 2023
807844e
Add default list of pinvokes for android aot
Feb 23, 2023
55e98f5
Merge remote-tracking branch 'upstream/main' into lib-builder-mobile
Feb 28, 2023
340a02f
Feedback
Feb 28, 2023
09aab3c
Remove extra symbols to keep. Condition direct icalls and direct pinv…
Mar 1, 2023
c99889b
PR feedback. Add test UnmanagedCallersOnly back in
Mar 1, 2023
223cf3a
Remove autoinit.c as it will come back in a follow up
Mar 1, 2023
e641c28
Generate list of assemblies that contained unmanagedcallersonly attri…
Mar 4, 2023
6a23439
More feedback
Mar 6, 2023
e272bb0
Merge remote-tracking branch 'upstream/main' into lib-builder-mobile
Mar 6, 2023
f30804d
Ignore CA1850 in the library builder
Mar 6, 2023
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
Condition some of the library builder specific items
  • Loading branch information
Steve Pfister committed Feb 8, 2023
commit fde2bda44267a38d6911a73128287ac6d95ffb4f
107 changes: 58 additions & 49 deletions src/mono/msbuild/android/build/AndroidApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,28 @@
<_AotModuleTablePath>$(AndroidAppBundleDir)\modules.c</_AotModuleTablePath>
</PropertyGroup>

<!--
LibraryBuilder takes the approach of accepting items to help what is being linked
as opposed to figuring it out in the task.
-->

<!-- common linker arguments for app and library builds -->
<ItemGroup>
<_RuntimeSymbolsToKeep Include="
register_aot_modules;
mono_jit_init_version;
mono_jit_exec;
mono_assembly_get_name;
mono_assembly_name_get_culture;
mono_assembly_name_get_name;
mono_assembly_open;
mono_class_get_method_from_name;
mono_class_get_name;
mono_class_get_namespace;
mono_debug_init;
mono_dllmap_insert;
mono_domain_get;
mono_gc_init_finalizer_thread;
mono_get_exception_class;
mono_install_assembly_preload_hook;
mono_install_load_aot_data_hook;
mono_install_unhandled_exception_hook;
mono_jit_cleanup;
mono_jit_parse_options;
mono_jit_set_aot_mode;
mono_object_get_class;
mono_object_get_virtual_method;
mono_runtime_invoke;
mono_set_crash_chaining;
mono_set_signal_chaining;
mono_string_to_utf8;
mono_trace_set_log_handler;
monovm_initialize;
monovm_runtimeconfig_initialize;
mono_aot_register_module;
mono_polling_required;
mono_thread_interruption_request_flag;" />
<_CommonLinkerArgs Include="libz.so" />
<_CommonLinkerArgs Include="log" />
<_CommonLinkerArgs Include="-u GlobalizationNative_LoadICU" />
<_CommonLinkerArgs Include="-u GlobalizationNative_GetLatestJapaneseEra" />
<_CommonLinkerArgs Include="-u GlobalizationNative_ChangeCase" />
<_CommonLinkerArgs Include="-u GlobalizationNative_CloseSortHandle" />
<_CommonLinkerArgs Include="-u GlobalizationNative_GetLocales" />
<_CommonLinkerArgs Include="-u GlobalizationNative_GetLocaleInfoInt" />
<_CommonLinkerArgs Include="-u GlobalizationNative_GetLocaleTimeFormat" />
<_CommonLinkerArgs Include="-u GlobalizationNative_ToUnicode" />
<_CommonLinkerArgs Include="-u GlobalizationNative_NormalizeString" />
<_CommonLinkerArgs Include="-u GlobalizationNative_GetTimeZoneDisplayName" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition="'$(_IsLibraryMode)' == 'true'">
<!-- add all non stub libs first -->
<!-- if runtimecompoents is empty, exclude -static.a and include -stub-static.a instead -->
<!-- if runtimecomponents is *, we're ok because all -static.a is included -->
Expand Down Expand Up @@ -98,20 +82,45 @@ mono_thread_interruption_request_flag;" />
Include="$(AndroidAppDir)\*-stub-static.a" />
</ItemGroup>

<!-- common linker arguments for app and library builds -->
<ItemGroup>
<_CommonLinkerArgs Include="libz.so" />
<_CommonLinkerArgs Include="log" />
<_CommonLinkerArgs Include="-u GlobalizationNative_LoadICU" />
<_CommonLinkerArgs Include="-u GlobalizationNative_GetLatestJapaneseEra" />
<_CommonLinkerArgs Include="-u GlobalizationNative_ChangeCase" />
<_CommonLinkerArgs Include="-u GlobalizationNative_CloseSortHandle" />
<_CommonLinkerArgs Include="-u GlobalizationNative_GetLocales" />
<_CommonLinkerArgs Include="-u GlobalizationNative_GetLocaleInfoInt" />
<_CommonLinkerArgs Include="-u GlobalizationNative_GetLocaleTimeFormat" />
<_CommonLinkerArgs Include="-u GlobalizationNative_ToUnicode" />
<_CommonLinkerArgs Include="-u GlobalizationNative_NormalizeString" />
<_CommonLinkerArgs Include="-u GlobalizationNative_GetTimeZoneDisplayName" />
<!--
This exists for the time being in order to support runtime initialization in library mode.
It will go away once we have support for auto initialization.
Copy link
Member

Choose a reason for hiding this comment

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

nit: do we have a tracking issue for removing this?

-->
<ItemGroup Condition="'$(_IsLibraryMode)' == 'true'">
<_RuntimeSymbolsToKeep Include="
register_aot_modules;
mono_jit_init_version;
mono_jit_exec;
mono_assembly_get_name;
mono_assembly_name_get_culture;
mono_assembly_name_get_name;
mono_assembly_open;
mono_class_get_method_from_name;
mono_class_get_name;
mono_class_get_namespace;
mono_debug_init;
mono_dllmap_insert;
mono_domain_get;
mono_gc_init_finalizer_thread;
mono_get_exception_class;
mono_install_assembly_preload_hook;
mono_install_load_aot_data_hook;
mono_install_unhandled_exception_hook;
mono_jit_cleanup;
mono_jit_parse_options;
mono_jit_set_aot_mode;
mono_object_get_class;
mono_object_get_virtual_method;
mono_runtime_invoke;
mono_set_crash_chaining;
mono_set_signal_chaining;
mono_string_to_utf8;
mono_trace_set_log_handler;
monovm_initialize;
monovm_runtimeconfig_initialize;
mono_aot_register_module;
mono_polling_required;
mono_thread_interruption_request_flag;" />
</ItemGroup>
</Target>

Expand Down
3 changes: 2 additions & 1 deletion src/mono/msbuild/apple/build/AppleApp.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

<!--<ShouldILStrip Condition="'$(RunAOTCompilation)' == 'true' and '$(MonoForceInterpreter)' != 'true'">true</ShouldILStrip>-->

<_NativeLibraryTarget Condition="'$(NativeLib)' != ''">_BuildNativeLibrary;</_NativeLibraryTarget>
<_IsLibraryMode Condition="'$(NativeLib)' != ''">true</_IsLibraryMode>
<_NativeLibraryTarget Condition="'$(_IsLibraryMode)' == 'true'">_BuildNativeLibrary;</_NativeLibraryTarget>

<AppleBuildAppAfterThisTarget Condition="'$(AppleBuildAppAfterThisTarget)' == ''">Publish</AppleBuildAppAfterThisTarget>
<AppleBuildAppDependsOn>
Expand Down
39 changes: 24 additions & 15 deletions src/mono/msbuild/apple/build/AppleApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PropertyGroup>
<!-- Unable to properly integrate nativelib into app build, so not supported for now. -->
Copy link
Member

Choose a reason for hiding this comment

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

nit: looks like this applies to _IsLibraryMode so move it one line down

<AppleGenerateAppBundle Condition="'$(NativeLib)' != ''">false</AppleGenerateAppBundle>
<AppleGenerateAppBundle Condition="'$(_IsLibraryMode)' == 'true'">false</AppleGenerateAppBundle>
</PropertyGroup>

<Target Name="AppleBuildApp" AfterTargets="$(AppleBuildAppAfterThisTarget)" />
Expand All @@ -29,10 +29,26 @@
</PropertyGroup>

<PropertyGroup>
<_TargetsDevice Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'">true</_TargetsDevice>
<_TargetsDevice Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvos'">true</_TargetsDevice>
</PropertyGroup>

<!--
LibraryBuilder takes the approach of accepting items to help what is being linked
as opposed to figuring it out in the task.
-->

<!-- common linker arguments for app and library builds -->
<ItemGroup>
<_CommonLinkerArgs Include="-framework Foundation" />
<_CommonLinkerArgs Include="-framework GSS" />
<_CommonLinkerArgs Include="-framework Security" />
<_CommonLinkerArgs Include="-framework UIKit" />
<_CommonLinkerArgs Include="-lz" />
<_CommonLinkerArgs Include="-lc++" />
<_CommonLinkerArgs Include="-liconv" />
</ItemGroup>

<ItemGroup Condition="'$(_IsLibraryMode)' == 'true'">
<!-- add all non stub libs first -->
<!-- if runtimecompoents is empty, exclude -static.a and include -stub-static.a instead -->
<!-- if runtimecomponents is *, we're ok because all -static.a is included -->
Expand Down Expand Up @@ -68,18 +84,11 @@
Include="$(AppleAppDir)\*-stub-static.a" />
</ItemGroup>

<!-- common linker arguments for app and library builds -->
<ItemGroup>
<_CommonLinkerArgs Include="-framework Foundation" />
<_CommonLinkerArgs Include="-framework GSS" />
<_CommonLinkerArgs Include="-framework Security" />
<_CommonLinkerArgs Include="-framework UIKit" />
<_CommonLinkerArgs Include="-lz" />
<_CommonLinkerArgs Include="-lc++" />
<_CommonLinkerArgs Include="-liconv" />
</ItemGroup>

<ItemGroup>
<!--
This exists for the time being in order to support runtime initialization in library mode.
It will go away once we have support for auto initialization.
-->
<ItemGroup Condition="'$(_IsLibraryMode)' == 'true'">
<_RuntimeSymbolsToKeep Include="
_register_aot_modules;
_mono_jit_init_version;
Expand Down Expand Up @@ -142,7 +151,7 @@ _monovm_runtimeconfig_initialize;" />
</PropertyGroup>

<PropertyGroup>
<_EnableUnmanagedCallersOnlyMethodsExport Condition="'$(NativeLib)' != ''">true</_EnableUnmanagedCallersOnlyMethodsExport>
<_EnableUnmanagedCallersOnlyMethodsExport Condition="'$(_IsLibraryMode)' == 'true'">true</_EnableUnmanagedCallersOnlyMethodsExport>
</PropertyGroup>

<ItemGroup>
Expand Down