Skip to content

Unable to use $(EnableLLVM) with Android AOT #56386

@jonathanpeppers

Description

@jonathanpeppers

Description

Context: dotnet/android#5539

When using the new <MonoAOTCompiler/> task, it fails if you try to turn on $(EnableLLVM):

Microsoft.Android.Sdk.Aot.targets(65,5): Precompiling failed for C:\src\xamarin-android\bin\TestDebug\temp\NoSymbolsArgShouldReduceAppSize\obj\Release\android-arm64\linked\UnnamedProject.dll: '"C:\src\xamarin-android\bin\TestDebug\temp\SDK Ümläüts\ndk\toolchains\llvm\prebuilt\windows-x86_64\bin\opt"' is not recognized as an internal or external command,
operable program or batch file.
AOT of image UnnamedProject.dll failed.
Mono Ahead of Time compiler - compiling assembly C:\src\xamarin-android\bin\TestDebug\temp\NoSymbolsArgShouldReduceAppSize\obj\Release\android-arm64\linked\UnnamedProject.dll
AOTID 20266A52-3AA1-1A98-06EF-28AD91144013
Executing opt: "C:\src\xamarin-android\bin\TestDebug\temp\SDK Ümläüts\ndk\toolchains\llvm\prebuilt\windows-x86_64\bin\opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "mono_aot_a17176\temp.opt.bc" "mono_aot_a17176\temp.bc"

I also get a build warning about opt.exe:

Microsoft.Android.Sdk.Aot.targets(65,5): [UnnamedProject.dll] '"C:\src\xamarin-android\bin\TestDebug\temp\SDK Ümläüts\ndk\toolchains\llvm\prebuilt\windows-x86_64\bin\opt"' is not recognized as an internal or external command,

opt.exe seems to be present in the AOT pack, why is it using LLVMPath to look for opt?

image

The value passed in for LLVMPath, seems to be correct:

image

But opt isn't located here, it is in the Mono AOT pack.

Note the folder used here (odd characters) is on purpose for testing, so this might be also be related: #56163.

I might be doing something wrong. Let me know, thanks!

Configuration

dotnet --version
6.0.100-rc.1.21376.3

Regression?

No, AOT on Android is new.

Other information

Build log: msbuild.zip

/cc @steveisok @akoeplinger

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions