-
Notifications
You must be signed in to change notification settings - Fork 507
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
Maui Net6/7: Undefined Symbols for architecture arm64 error #16223
Comments
I'm not entirely sure what's going on, but I believe this goes away if you use Xcode 14:
|
It seems that clang from Xcode 14 will by default produce object files that earlier native linkers don't understand. The reason being that clang by default enables objc_msgSend stubs. Ref: https://developer.apple.com/videos/play/wwdc2022/110363/ There's apparently an (undocumented) way around this, by passing |
Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand. We disable this by passing -fno-objc-msgsend-selector-stubs to clang. Ref: https://developer.apple.com/videos/play/wwdc2022/110363/ Ref: https://www.wwdcnotes.com/notes/wwdc22/110363/ Ref: llvm/llvm-project#56034 Fixes xamarin#16223.
Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand. We disable this by passing -fno-objc-msgsend-selector-stubs to clang. Ref: https://developer.apple.com/videos/play/wwdc2022/110363/ Ref: https://www.wwdcnotes.com/notes/wwdc22/110363/ Ref: llvm/llvm-project#56034 Fixes xamarin#16223.
Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand. We disable this by passing -fno-objc-msgsend-selector-stubs to clang. Ref: https://developer.apple.com/videos/play/wwdc2022/110363/ Ref: https://www.wwdcnotes.com/notes/wwdc22/110363/ Ref: llvm/llvm-project#56034 Fixes xamarin#16223.
Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand. We disable this by passing -fno-objc-msgsend-selector-stubs to clang. Ref: https://developer.apple.com/videos/play/wwdc2022/110363/ Ref: https://www.wwdcnotes.com/notes/wwdc22/110363/ Ref: llvm/llvm-project#56034 Fixes xamarin#16223.
Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand. We disable this by passing -fno-objc-msgsend-selector-stubs to clang. Ref: https://developer.apple.com/videos/play/wwdc2022/110363/ Ref: https://www.wwdcnotes.com/notes/wwdc22/110363/ Ref: llvm/llvm-project#56034 Fixes #16223.
#16223. (#16232) Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand. We disable this by passing -fno-objc-msgsend-selector-stubs to clang. Ref: https://developer.apple.com/videos/play/wwdc2022/110363/ Ref: https://www.wwdcnotes.com/notes/wwdc22/110363/ Ref: llvm/llvm-project#56034 Fixes #16223. Backport of #16231 Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
…16236) Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand. We disable this by passing -fno-objc-msgsend-selector-stubs to clang. Ref: https://developer.apple.com/videos/play/wwdc2022/110363/ Ref: https://www.wwdcnotes.com/notes/wwdc22/110363/ Ref: llvm/llvm-project#56034 Fixes #16223. Backport of #16231 Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
This appears to have fixed the issue on our net7 runs, but we are still experiencing it on runs build using .Net 6. |
This has been fixed, but the fixes haven't been released yet. I'm guessing you're using Xcode 14 in your .NET 7 runs, the problem doesn't show up then. |
@rolfbjarne we are getting this on Microsoft Hosted MacOS (started a few days ago). We tried macos-11 and macos-12/latest. ILLINK : warning MT0079: The recommended Xcode version for Microsoft.iOS 16.0.517 is Xcode 14.0 or later. The current Xcode version (found in /Applications/Xcode_13.2.1.app/Contents/Developer) is 13.2.1. [/Users/runner/work/1/s/Infinox.IXSocial.Mobile/FrontEnd/src/UI/Clients/FrontEnd.UI.Maui.Blazor/FrontEnd.UI.Maui.Blazor.csproj] Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink Undefined symbols for architecture arm64: |
@oscore-john the easiest fix is probably to use Xcode 14 instead of Xcode 13.* (as the MT0079 warning says). The fix for the issue will be included in our release supporting Xcode 14.1 (and that release date depends on Apple, we have no say in the matter). |
Thanks @rolfbjarne , sorry if this is a naive question, can we, and if we can, then how do we, do this via Azure devops? We're currently doing the actual build using:
We're using the 'macOS-latest' image. Am I right in reading your message that we would need to create our own MacOS image for this purpose? (I've not done much iOS / mac development before, so apologies if the answer should be obvious) Thanks in advance |
Looks like it should be the default here: https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode? Although I'm not sure, maybe read the docs or raise an issue here: https://github.com/actions/runner-images |
Thanks, so at least I'm not going completely crazy! :-) |
In case anyone else comes across this - macos-latest seemed to still point at previous versions [of xcode], whereas using macos-12 solved the problem (at least for us). |
@rolfbjarne Short question: How can i add the flag I can't wait for the update to be released. |
You can't, this happens because we didn't use this flag when we built our binaries.
You can find older packages here: https://github.com/xamarin/xamarin-macios/blob/main/DOWNLOADS.md |
You are someone of great beauty for leaving this comment here. Thank you, saved me hours of assuming I'd gone wrong. |
Hi really thanks a lot, you also saved my hours. I had a question, where did you get this flag? It's not in the man page. Thanks. @rolfbjarne |
Hi, I am getting the same errors when building a very simple Xamarin Forms app based on the visual studio flyout template in Visual Studio for Mac Pre-release 2022 ( version 17.4 ). App builds fine for Android. App builds fine in iOS debug. As soon as I select iOS Release build ( in order to archive for publishing ), I get the MTOUCH: error MT5210 Native linking failed, undefined symbol ( see below ). I cannot upgrade to Xcode 14 as I am using a Mac that is limited to Big Sur ( you need Monterey to upgrade to Xcode 14 ) and my Mac apparently does not support Monterey. ***************************************** errors below ********************************* MTOUCH : warning MT0079: The recommended Xcode version for Xamarin.iOS 16.0.0 is Xcode 14.0 or later. The current Xcode version (found in /Applications/Xcode.app/Contents/Developer) is 13.2.1. thank you. |
@steviehutch you can either:
|
Thank you for the quick and positive response. When is the next service
release planned ( roughly ) ?
Kind regards
Steve
…On Mon, 24 Oct 2022 at 22:13, Rolf Bjarne Kvinge ***@***.***> wrote:
@steviehutch <https://github.com/steviehutch> you can either:
- Wait until our next service release and this should be fixed
- Downgrade to an earlier version of Xamarin.iOS (packages can be
found here:
https://github.com/xamarin/xamarin-macios/blob/main/DOWNLOADS.md)
—
Reply to this email directly, view it on GitHub
<#16223 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4XMUI22ZN477K7ZV7KG5TWE33WJANCNFSM6AAAAAAQ4BIVO4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I can't really say because it depends on external factors (for instance when Apple will make Xcode 14.1 stable), but my guess would be a few weeks. |
Hi Rolf,
I assume the service release will rely on me using Xcode 14.1?
As explained i am limited to XCode 13 versions.
What's the best way to downgrade Xamarin.iOS on a Mac? Is this to install
Visual Studio for mac 2019 and use that to recompiled the app?
Kind Regards
Steve
…On Tue, 25 Oct 2022 at 09:02, Rolf Bjarne Kvinge ***@***.***> wrote:
Thank you for the quick and positive response. When is the next service
release planned ( roughly ) ?
I can't really say because it depends on external factors (for instance
when Apple will make Xcode 14.1 stable), but my guess would be a few weeks.
—
Reply to this email directly, view it on GitHub
<#16223 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4XMUJPZDC42HUQ4EOZ77LWE6HZBANCNFSM6AAAAAAQ4BIVO4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
You can usually keep using an older Xcode for a while (we don't specifically block it). Note that Apple will eventually require you to build with Xcode 14 (probably next spring). The reason we're kind of dependent on Xcode 14.1 is that we roughly base our release schedule around Xcode releases. To downgrade just download the package you want here: https://github.com/xamarin/xamarin-macios/blob/main/DOWNLOADS.md, any recent ones should work fairly well with most versions of VSMac. |
Hi Rolf,
I installed Visual Studio 2019 for the Mac and recompiled the entire
project in release mode and it worked perfectly. No errors in release build.
So your suggestion to downgrade to an earlier version of Xamarin.iOS
worked. Thank you.
Kind Regards
Steve
…On Tue, 25 Oct 2022 at 19:29, Rolf Bjarne Kvinge ***@***.***> wrote:
I assume the service release will rely on me using Xcode 14.1?
You can usually keep using an older Xcode for a while (we don't
specifically block it). Note that Apple will eventually require you to
build with Xcode 14 (probably next spring).
The reason we're kind of dependent on Xcode 14.1 is that we roughly base
our release schedule around Xcode releases.
To downgrade just download the package you want here:
https://github.com/xamarin/xamarin-macios/blob/main/DOWNLOADS.md, any
recent ones should work fairly well with most versions of VSMac.
—
Reply to this email directly, view it on GitHub
<#16223 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4XMUIXCT2LUZCXJZFVLFTWFARJTANCNFSM6AAAAAAQ4BIVO4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
When attempting to build both Maui net6 and net7 versions for iOS, clang hits a linker error. These appear to be the same on both the net6 and net7 versions. Similar build processes are used for both but will use the net7 version for the reproduction steps. This may be better off in the Maui repo, but figured to start here given the error is specifically coming from Microsoft.iOS.Sdk/16.0.1263-rc.2-xcode14 on for net7 and Microsoft.iOS.Sdk/16.0.515 for net6 with reference to Xamarin targets.
Steps to Reproduce
General
Specific (Exact steps given clean environment, does download files)
Expected Behavior
The app should build into an ipa file that can be run for testing.
Actual Behavior
We get to the linker step and then fail.
Environment
Runtime Information
Workloads used in rollback
Build Logs
MauiiOS.zip
The text was updated successfully, but these errors were encountered: