Closed praeclarum closed 5 years ago
I suspect this is a duplicate of https://github.com/xamarin/xamarin-macios/issues/6787
Actually, somehow we are getting confused in archs?:
2019-11-19T23:03:59.1959500Z ld : warning : ignoring file /Users/runner/runners/2.160.1/work/1/s/CircuitTouch/obj/iPhone/Release/mtouch-cache/armv7s/System.Xml.dll-llvm.o, building for iOS-armv7s but attempting to link with file built for unknown-armv7 [/Users/runner/runners/2.160.1/work/1/s/CircuitTouch/iCircuit.csproj]
@chamons Yeah that's the line that scares me too.
I should mention that the build time went up from 14mins to over 30mins. Not sure it's related however...
@praeclarum could I get access to the source code so I can try this myself?
@rolfbjarne I just gave you access to praeclarum/Circuit. There are submodules in External that you will need to check out. Please open iCircuit.iOS.sln
I wonder if you would consider choosing a closer milestone? This issue prevents me from updating my app.
@praeclarum - We don't use milestones in the traditional sense. "Future" just means triaged mostly, unless it is an Xcode release or require-breaking-changes.
Once we figure out what's going on, we can see if there is a work around and how impactful the fix is.
I can't reproduce, the solution builds fine for me.
@praeclarum can you enable verbose diagnostic build logs in VSMac, clean and rebuild, and attach the build output?
Verbose build log: https://docs.microsoft.com/en-us/xamarin/cross-platform/troubleshooting/questions/version-logs#verbose-build-output-logs (both the mtouch and the msbuild parts)
@rolfbjarne The same failure reproduces on 3 different build systems for me.
Please make sure you do a Release Device build.
I will work on a verbose build over here.
@rolfbjarne Here are the results of a verbose build (same error). This is on a 4th machine. I have also attached my versions and mtouch command line.
It seems llc creates an armv7 object file when asked to create an armv7s object file.
Test case: https://github.com/rolfbjarne/TestApp (branch: issue-7471
)
$ msbuild /p:Platform=iPhone /p:Configuration=Release /p:MtouchExtraArgs='-vvvvv' /verbosity:diag
Result:
error MT5209 : Native linking error : warning: ignoring file /Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe-llvm.o, building for iOS-armv7s but attempting to link with file built for unknown-armv7 [/Users/rolf/Projects/TestApp/test-app/test-app.csproj]
error MT5209 : Native linking error : warning: ignoring file /Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/mscorlib.dll-llvm.o, building for iOS-armv7s but attempting to link with file built for unknown-armv7 [/Users/rolf/Projects/TestApp/test-app/test-app.csproj]
error MT5209 : Native linking error : warning: ignoring file /Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/Xamarin.iOS.dll-llvm.o, building for iOS-armv7s but attempting to link with file built for unknown-armv7 [/Users/rolf/Projects/TestApp/test-app/test-app.csproj]
error MT5209 : Native linking error : warning: ignoring file /Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/System.dll-llvm.o, building for iOS-armv7s but attempting to link with file built for unknown-armv7 [/Users/rolf/Projects/TestApp/test-app/test-app.csproj]
MTOUCH : error MT5210: Native linking failed, undefined symbol: _mono_aot_Systeminit_method. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. [/Users/rolf/Projects/TestApp/test-app/test-app.csproj]
MTOUCH : error MT5210: Native linking failed, undefined symbol: _mono_aot_Systeminit_method_gshared_mrgctx. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. [/Users/rolf/Projects/TestApp/test-app/test-app.csproj]
MTOUCH : error MT5210: Native linking failed, undefined symbol: _mono_aot_Systeminit_method_gshared_this. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in. [/Users/rolf/Projects/TestApp/test-app/test-app.csproj]
[...]
The interesting part is this:
$ MONO_PATH=/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/3-Build /work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/bin/arm-darwin-mono-sgen --debug --llvm -O=gsharedvt -O=-float32 --aot=mtriple=armv7s-ios,data-outfile=/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.aotdata.armv7s,static,asmonly,direct-icalls,full,nodebug,dwarfdebug,msym-dir=/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/3-Build/Msym,llvm-path=/work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/LLVM/bin/,outfile=/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe.s,llvm-outfile=/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe-llvm.o "/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/3-Build/testapp.exe"
Mono Ahead of Time compiler - compiling assembly /Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/3-Build/testapp.exe
AOTID DBB8D53B-CA58-428E-49A5-A589A9B1B9FA
Executing opt: "/work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/LLVM/bin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe.s.opt.bc" "/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe.s.bc"
Executing llc: "/work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/LLVM/bin/llc" -march=arm -mattr=+v7 -exception-model=dwarf -disable-fp-elim -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7s-ios -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=_mono_aot_testapp_eh_frame -disable-tail-calls -relocation-model=pic -filetype=obj -o "/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe-llvm.o" "/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe.s.opt.bc"
Compiled: 25/25
Output file: '/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe.s'.
Linking symbol: '_mono_aot_module_testapp_info'.
LLVM output file: '/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe-llvm.o'.
JIT time: 2 ms, Generation time: 48 ms, Assembly+Link time: 0 ms.
$ file /Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe-llvm.o
/Users/rolf/Projects/TestApp/test-app/obj/iPhone/Release/mtouch-cache/armv7s/testapp.exe-llvm.o: Mach-O object arm_v7
This regressed when we merged mono 2019-02 (https://github.com/xamarin/xamarin-macios/commit/7300cd7a2a77dc11f35a6639943de7d65fb85d05).
This issue was moved to mono/mono#17931
My build is failing to link for arm7s.
I have reproduced this failure on my machine, Azure Dev Ops, and Bitrise. Any help would be greatly appreciated!
Steps to Reproduce
Expected Behavior
App builds
Actual Behavior
Fails to link native code
Environment
Build Logs
Armv7sBuildLog.txt