Bug 17199 - Native linking failed, undefined symbol: _mono_handle_global_vregs.
Summary: Native linking failed, undefined symbol: _mono_handle_global_vregs.
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 7.0.6.x
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2014-01-13 04:40 UTC by apollo_maverick
Modified: 2014-03-13 08:51 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description apollo_maverick 2014-01-13 04:40:40 UTC
I have a binding project (my own TapjoyConnect SDK binding, it was ok before). I tested even if create a new project from template, the errors still exist.

With -v -v -v compiler arguments, can see that it says those undefined symbols are referenced from libmonoboehm-2.0.a

http://stackoverflow.com/questions/21002550/native-linking-errors-in-xamarin/21087515#21087515

FYI: 
Xamarin.iOS 7.0.6.166 
MDK for OSX 2.3.5 
OSX 10.8.5

error MT5210: Native linking failed, undefined symbol: _mono_handle_global_vregs. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
error MT5210: Native linking failed, undefined symbol: _mono_inst_name. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
error MT5210: Native linking failed, undefined symbol: _mono_local_deadce. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
error MT5210: Native linking failed, undefined symbol: _mono_print_code. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
error MT5210: Native linking failed, undefined symbol: _mono_type_to_regmove. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
error MT5210: Native linking failed, undefined symbol: _type_to_eval_stack_type. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
error MT5202: Native linking failed. Please review the build log.
Comment 1 Atin 2014-01-13 06:01:23 UTC
Could you please attach your project? So we can reproduce this issue at our end.
Comment 3 apollo_maverick 2014-01-18 02:11:29 UTC
test project uploaded, please check it out.
Comment 4 apollo_maverick 2014-01-18 02:18:17 UTC
build for simulator ok, only encounter the errors when building for devices
Comment 5 Rolf Bjarne Kvinge [MSFT] 2014-01-20 07:33:35 UTC
It looks like this happens with any iOS project if you add "--gcc_flags -load_all" to the additional mtouch arguments.

Zoltan, can you have a look?
Comment 6 apollo_maverick 2014-01-20 08:07:50 UTC
the code in the xxx.linkwith.cs of the binding libary is:

[assembly: LinkWith ("TapjoyPublisherLibrary.a", 
    LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Simulator, 
                     ForceLoad = true,
                     Frameworks="CoreGraphics Foundation MediaPlayer SystemConfiguration UIKit", 
                     WeakFrameworks="AdSupport CoreTelephony",
                     LinkerFlags="-ObjC -all_load -fobjc-arc")]
Comment 7 Zoltan Varga 2014-01-20 22:28:08 UTC
Fixed in mono master 93540ce41d2e2b393b2f282a2b8b987e238d18b1/mt master 7f53e0338ae319bcb5c29944fb88bbb7d11dea6b.
Comment 8 Rolf Bjarne Kvinge [MSFT] 2014-01-21 06:57:19 UTC
I can confirm this is fixed.

Unit tests added as well (monotouch/master: 094bb4ef0373deb0730776f540511edcd6951485).
Comment 9 narayanp 2014-01-24 09:15:58 UTC
I am closing this issue because Unit test has been added for this.
Comment 10 jan 2014-02-03 11:05:06 UTC
Is there any info on when the fix will be merged in the development releases? 

I just tried the Xamarin.iOS 7.1.4.3 together with XCode 5.1 (ios 7.1 beta4 dev tools) and the problem seems to persist.
Comment 11 Rolf Bjarne Kvinge [MSFT] 2014-02-04 19:09:41 UTC
@jan: a possible workaround is to not use -all_load in the LinkWith attribute, but just set ForceLoad = true instead.

Unfortunately we don't know at this point when a release with this fix will published (a wild guess would be about a month, but I can't guarantee anything).
Comment 12 jan 2014-02-06 10:05:18 UTC
@Rolf: Thank you for the update! I tried the ForceLoad = true and that does the trick for me. Now we are no longer depending on this bug fix being released into stable.

Thanks!
Comment 13 Fannar M 2014-03-13 07:26:06 UTC
Any news when this fix will be released in the Xamarin Stable Channel (or evan Alpha)?
I have a solution that depends on multiple third-party Obj-C binding libraries which were all built using the "-all_load" flag, so I can't deploy my app on a device.
Comment 14 Rolf Bjarne Kvinge [MSFT] 2014-03-13 08:47:06 UTC
@Fannar: this fix will be included in Xamarin.iOS 7.2.1, which is already in the processes of being released. It should at least reach the alpha channel within a week or so.

The alternative is to downgrade to an earlier version of Xamarin.iOS (I believe 7.0.5 works).
Comment 15 Fannar M 2014-03-13 08:51:06 UTC
Alright, thanks for the information.