Skip to content

Create managed version of llvm-objcopy #9692

@jpobst

Description

@jpobst

Context: #9455

For each assembly/pdb/config/others file we wrap as a .so in order to place in the /lib directory of an APK, we shell out twice to llvm-objcopy:

llvm-objcopy.EXE --add-section payload=obj\Debug\net9.0-android\android\assets\arm64-v8a\myproject.dll obj\Debug\net9.0-android\android-arm64\wrapped\lib_myproject.dll.so
llvm-objcopy.EXE --set-section-flags payload=readonly,data --set-section-alignment payload=16384 obj\Debug\net9.0-android\android-arm64\wrapped\lib_myproject.dll.so

There is considerable overhead to this process.

In this example we spend ~42 seconds in this step:

dotnet new android
dotnet build -p:EmbedAssembliesIntoApk=true

A managed version that did not need to shell out to external processes of this would likely be faster.

Some potential options:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: App+Library BuildIssues when building Library projects or Application projects.Area: PerformanceIssues with performance.enhancementProposed change to current functionality.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions