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

Could not AOT the assembly: Google.ZXing.Core.dll #5779

Closed
Huaba93 opened this issue Mar 25, 2021 · 5 comments
Closed

Could not AOT the assembly: Google.ZXing.Core.dll #5779

Huaba93 opened this issue Mar 25, 2021 · 5 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects.

Comments

@Huaba93
Copy link

Huaba93 commented Mar 25, 2021

Description
AOT with LLVM enabled does not work for Google.ZXing.Core.dll which is part of Xamarin.Facebook.Android.

[aot-compiler stderr] LLVM ERROR: Broken module found, compilation aborted!
[aot-compiler stderr] AOT of image /Users/christophhuber/git/Sepp-mobile/Sepp.Mobile.Droid/obj/Release/android/assets/shrunk/Google.ZXing.Core.dll failed.

It works when LLVM is disabled.

Steps to Reproduce

  1. Xamarin.Facebook.Android
  2. Enable full AOT
  3. Build and deploy

Reproduction Sample

Expected Behavior

AOT should work with enabled LLVM compiler.

Actual Behavior

AOT does only work with disabled LLVM compiler.

Version Information

Show/Hide Visual Studio info
Visual Studio Enterprise 2019 for Mac
Version 8.9.2 (build 0)
Installation UUID: 92f14d0c-7226-4b52-80ad-490c421a6011
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000125

Mono Framework MDK
Runtime:
	Mono 6.12.0.125 (2020-02/8c552e98bd6) (64-bit)
	Package version: 612000125

Roslyn (Language Service)
3.9.0-6.21152.10+c10f884b30737542ddd84ca889a4aad9281ce210

NuGet
Version: 5.8.0.6860

.NET Core SDK
SDK: /usr/local/share/dotnet/sdk/5.0.201/Sdks
SDK Versions:
	5.0.201
	5.0.103
	5.0.102
	5.0.101
	5.0.100
	3.1.407
	3.1.406
	3.1.405
	3.1.404
	3.1.403
	3.1.402
	3.1.401
	3.1.302
	3.1.300
	3.1.200
	3.1.102
	3.1.101
	3.1.100
	3.0.101
	3.0.100
	3.0.100-rc1-014190
	3.0.100-preview9-014004
	2.2.300
	2.2.101
	2.1.810
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

.NET Core Runtime
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	5.0.4
	5.0.3
	5.0.2
	5.0.1
	5.0.0
	3.1.13
	3.1.12
	3.1.11
	3.1.10
	3.1.9
	3.1.8
	3.1.7
	3.1.6
	3.1.4
	3.1.2
	3.1.1
	3.1.0
	3.0.1
	3.0.0
	3.0.0-rc1-19456-20
	3.0.0-preview9-19423-09
	2.2.5
	2.2.0
	2.1.23
	2.1.22
	2.1.21
	2.1.20
	2.1.18
	2.1.16
	2.1.15
	2.1.14
	2.1.13

.NET Core 3.1 SDK
SDK: 3.1.407

Xamarin.Profiler
Version: 1.6.12.29
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Apple Developer Tools
Xcode 12.4 (17801)
Build 12D4e

Xamarin.Mac
Version: 7.8.2.5 (Visual Studio Enterprise)
Hash: 3836759d4
Branch: d16-9
Build date: 2021-02-10 17:56:43-0500

Xamarin.iOS
Version: 14.14.2.5 (Visual Studio Enterprise)
Hash: 3836759d4
Branch: d16-9
Build date: 2021-02-10 17:56:44-0500

Xamarin.Android
Version: 11.2.2.1 (Visual Studio Enterprise)
Commit: xamarin-android/d16-9/877f572
Android SDK: /Users/christophhuber/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		7.1 (API level 25)
		8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.5
SDK Build Tools Version: 29.0.2

Build Information: 
Mono: 5e9cb6d
Java.Interop: xamarin/java.interop/d16-9@54f8c24
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.34.1@daff8f4
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-9@d210f11

Microsoft OpenJDK for Mobile
Java SDK: /Users/christophhuber/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 16.9.0.22
Hash: a391de2
Branch: remotes/origin/d16-9
Build date: 2021-03-05 19:52:30 UTC

Android Device Manager
Version: 16.9.0.17
Hash: fc2b3db
Branch: remotes/origin/d16-9
Build date: 2021-03-05 19:52:54 UTC

Xamarin Designer
Version: 16.9.0.316
Hash: 2241b204a
Branch: tags/vsm-rel/d16.9-4540908
Build date: 2021-03-10 22:18:10 UTC

Build Information
Release ID: 809020000
Git revision: a69906fb0095d046b113a63419c9af3034ce104e
Build date: 2021-03-11 14:01:37-05
Build branch: release-8.9
Xamarin extensions: a69906fb0095d046b113a63419c9af3034ce104e

Operating System
Mac OS X 10.15.7
Darwin 19.6.0 Darwin Kernel Version 19.6.0
    Tue Jan 12 22:13:05 PST 2021
    root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64

Log File

LogCat.txt
AOT_Output.txt

@Huaba93 Huaba93 added Area: App+Library Build Issues when building Library projects or Application projects. needs-triage Issues that need to be assigned. labels Mar 25, 2021
@TTalpey
Copy link

TTalpey commented May 31, 2021

Seeing the same, since upgrading to VS2019 Enterprise 16.10 and Win10 21H1. Disabling LLVM compile does succeed.

It appears to be yet another "spaces in path" issue on the C:\Program Files (x86) tree. Partial Output contents below:

[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk
dk-bundle\platforms\android-19\arch-arm\usr\lib: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin..\sysroot\usr\lib\arm-linux-androideabi: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk
dk-bundle\platforms\android-19\arch-arm\usr\lib: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin..\sysroot\usr\lib\arm-linux-androideabi: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lunwind
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lunwind
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lcompiler_rt-extras
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lgcc_real
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lcompiler_rt-extras
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -ldl
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lgcc_real
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -ldl
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk
dk-bundle\platforms\android-19\arch-arm\usr\lib: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open Files: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot open (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin..\sysroot\usr\lib\arm-linux-androideabi: No such file or directory
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lunwind
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lcompiler_rt-extras
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -lgcc_real
[aot-compiler stderr] C:\Program Files (x86)\Android\android-sdk
dk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.EXE: error: cannot find -ldl

@TTalpey
Copy link

TTalpey commented May 31, 2021

And furthermore, the "\n" in the path ...android-sdk\ndk-bundle... is being expanded into a newline.

Quotes are obviously needed somewhere in the build target.

@Tommigun1980
Copy link

I am also suffering of this and this issue is preventing me from using LLVM on my Android builds.
Any kind of fix or workaround would be greatly appreciated.

Thank you.

@dellis1972
Copy link
Contributor

This is likely a duplicate of #5964 or #5764.

The former (#5964) has a fix via #5979 which we are hoping will go out in the next d16.10 Service Release.

The latter #5764 see that in that case the Assembly being AOT'd has invalid IL in it which is breaking the compiler. See #5764 (comment). As yet we don't know what to do about that one.

I am going to close this issue as a duplicate since we are tracking all the bug reports on #5964 or #5764.

@Tommigun1980
Copy link

Tommigun1980 commented Jun 4, 2021

Thank you for the answer @dellis1972.

It does indeed seem that Google.ZXing.Core is broken somehow:

    [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly /Users/myname/Projects/myproject/MyApp.Android/obj/Development/android/assets/shrunk/Google.ZXing.Core.dll
    [aot-compiler stdout] AOTID ECDFCD8D-72E5-C8A4-F042-AFFFB093547E
    [aot-compiler stdout] Executing opt: "/Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/Darwin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "obj/Development/aot/armeabi-v7a/Google.ZXing.Core.dll/temp.opt.bc" "obj/Development/aot/armeabi-v7a/Google.ZXing.Core.dll/temp.bc"
    [aot-compiler stderr] Basic Block in function 'Google_ZXing_Client_Result_AddressBookParsedResult__ctor_string___string___string___string___string___string___string__' does not have terminator!
    [aot-compiler stderr] label %NOTINITED_BB30
    [aot-compiler stderr] LLVM ERROR: Broken module found, compilation aborted!

Until this is solved, is there any way to forcefully link out the offending methods, or maybe even opt some assemblies out from AOT? I'm perfectly fine with a temporary hack until this gets resolved if one is possible.

Thank you again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Projects
None yet
Development

No branches or pull requests

5 participants