Bug 34186 - MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_fix_ranlib_warning_about_no_symbols'.
Summary: MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_fix_ranlib_w...
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries ()
Version: XI 9.0 (iOS9)
Hardware: Macintosh Mac OS
: Normal major
Target Milestone: 9.0.2 (iOS9SR1)
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-09-22 17:57 UTC by Ahmad Husseini
Modified: 2015-10-08 09:18 UTC (History)
7 users (show)

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


Attachments
Build Log (319.02 KB, application/octet-stream)
2015-09-22 17:57 UTC, Ahmad Husseini
Details


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 Ahmad Husseini 2015-09-22 17:57:25 UTC
Updated to Xamarin.iOS 9.0.1, now getting the following when compiling for Release:

MTOUCH: error MT5212: Native linking failed, duplicate symbol: '_fix_ranlib_warning_about_no_symbols'.
MTOUCH: error MT5213: Duplicate symbol in: /Library/Frameworks/Xamarin.iOS.framework/Versions/9.0.1.20/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonotouch-sgen.a(mono-runtime-sgen.arm64.o) (Location related to previous error)
MTOUCH: error MT5213: Duplicate symbol in: /Library/Frameworks/Xamarin.iOS.framework/Versions/9.0.1.20/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libmonotouch-sgen.a(monotouch-debug-sgen.arm64.o) (Location related to previous error)
MTOUCH: error MT5209: Native linking error: 1 duplicate symbol for architecture arm64
MTOUCH: error MT5202: Native linking failed. Please review the build log.

I've tried downgrading to Xamarin.iOS 8 but it can't find the iOS 9 SDK. I have also tried rebuilding the library using the instructions on Xamarin's mtouch errors page.
Comment 1 Ahmad Husseini 2015-09-22 17:57:59 UTC
Created attachment 13030 [details]
Build Log
Comment 2 Rolf Bjarne Kvinge [MSFT] 2015-09-23 03:40:20 UTC
You're using Xamarin.iOS 9.2 (probably from the alpha or beta channel), not Xamarin.iOS 9.0:

>     Xamarin.iOS 9.2.0.53 (cycle6: bdbf45b) Priority Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk

Can you install the version from the stable channel, and see if that works?
Comment 3 Ahmad Husseini 2015-09-23 11:17:15 UTC
Sorry, I'm having issues with my machine and will have to restore, so I won't be able to give updates until tomorrow. I was getting this exact same error in Xamarin.iOS 9.01 and updated to Alpha to try the new Xamarin.iOS build.
Comment 4 Rolf Bjarne Kvinge [MSFT] 2015-09-23 11:36:11 UTC
OK, I can reproduce if I pass -all_load to the linker.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2015-09-23 11:42:43 UTC
Fixed.

maccore/master: 008294aaed4c566fdcb2f21edbeab86d377df119
Comment 6 Rolf Bjarne Kvinge [MSFT] 2015-09-23 11:50:50 UTC
QA: to test, just create a new project, select a device + release configuration and add "-gcc_flags -all_load" to the additional mtouch arguments in the project's build options.
Comment 7 Andrey Mamontov 2015-09-24 08:32:22 UTC
to test you can add "-gcc_flags -force_load ... " as well
Comment 8 Shruti 2015-09-24 09:45:03 UTC
First I have reproduce this issue with adding "-gcc_flags -all_load" to the additional mtouch arguments using latest Cycle6 build X.iOS 9.2.0.67. Screencast for same: http://www.screencast.com/t/td1qvOeZrJso

Case 1:
Then, I have checked this with arguments "-gcc_flags -all_load" and observed that no error occur during building application with release + device configuration
Screencast for same: http://www.screencast.com/t/4HhTHACLTE

Case 2:
As per comment 7, I have also checked it with arguments "-gcc_flags -force_load" then get following errors during build the application:
	MTOUCH: error MT5209: Native linking error: clang: error: argument to '-force_load' is missing (expected 1 value)
	MTOUCH: error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -force_load
	MTOUCH: error MT5202: Native linking failed. Please review the build log.

Build Logs: https://gist.github.com/Shruti360/77d84f4c0eee1e107825
Screencast for the same:  http://www.screencast.com/t/4HhTHACLTE

I guess, I got error with arguments '-gcc_flags -force_load' are different for which this issue is filed.
So I think, separate issue should file for Case 2 and this issue should be close on behalf of Case1.

Please share your suggestions.

Thanks!!

Environment Info:
=== Xamarin Studio ===

Version 5.10 (build 802)
Installation UUID: 67eaf3b4-f8a7-4ab4-a9df-3197350ca5dc
Runtime:
	Mono 4.2.1 (explicit/4a18c57)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010056

=== Xamarin.Profiler ===

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

=== Apple Developer Tools ===

Xcode 7.0 (8227)
Build 7A220

=== Xamarin.Android ===

Version: 6.0.0.2
Android SDK: Not found

=== Xamarin Android Player ===

Version: 0.4.4
Location: /Applications/Xamarin Android Player.app

=== Xamarin.iOS ===

Version: 9.3.0.81 (Business Edition)
Hash: caccada
Branch: master
Build date: 2015-09-23 22:26:55-0400

=== Xamarin.Mac ===

Version: 2.4.0.62 (Business Edition)

=== Build Information ===

Release ID: 510000802
Git revision: 37ec54a7213f42f5a9a996dcd7bc4f7e23344209
Build date: 2015-09-24 05:07:34-04
Xamarin addins: 77989334cdb0c2273c7802512c05b02aa004ec93
Build lane: monodevelop-lion-cycle6

=== Operating System ===

Mac OS X 10.10.4
Darwin XamnewiMac.local 14.4.0 Darwin Kernel Version 14.4.0
    Thu May 28 11:35:04 PDT 2015
    root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64
Comment 9 Rolf Bjarne Kvinge [MSFT] 2015-09-24 10:21:58 UTC
(In reply to comment #8) 
> I guess, I got error with arguments '-gcc_flags -force_load' are different for
> which this issue is filed.
> So I think, separate issue should file for Case 2 and this issue should be
> close on behalf of Case1.

This is correct (you can reproduce with "-force_load" as well, but you'll need another argument, i.e. "-force_load /path/to/file/to/load", but it's not necessary to test this).
Comment 10 Shruti 2015-09-24 11:26:08 UTC
As per comment 8, I am changing status to verified.
Comment 12 Ruchi 2015-09-25 02:52:02 UTC
Followed as per instructed but no success. Still same issue.

See screencast http://screencast.com/t/SRlBMzIBdS
Comment 13 Andrey Mamontov 2015-09-25 03:27:38 UTC
If this fix is part of last night Alpha update, I can approve, issue still active.
Comment 14 Rolf Bjarne Kvinge [MSFT] 2015-09-25 04:12:48 UTC
@Ruchi, @Andrey: the fix still hasn't been released (it will be in Xamarin.iOS 9.0.2).
Comment 15 Andrey Mamontov 2015-09-25 04:54:59 UTC
Thanks a lot for clarification! By the way, write down estimated release is a great way to improve our communication.
Comment 16 Shruti 2015-09-29 03:36:18 UTC
I have checked this issue with X.iOS  9.0.1.29. I am able to build app with arguments "-gcc_flags
-force_load".
Screencast for the same:http://www.screencast.com/t/XppmE2EJ

=== Xamarin Studio ===

Version 5.9.7 (build 12)
Installation UUID: 67eaf3b4-f8a7-4ab4-a9df-3197350ca5dc
Runtime:
	Mono 4.0.4 ((detached/cb6d6b2)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040002

=== Apple Developer Tools ===

Xcode 7.0 (8227)
Build 7A220

=== Xamarin.Mac ===

Not Installed

=== Xamarin.Android ===

Version: 6.0.0.5
Android SDK: Not found

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.iOS ===

Version: 9.0.1.29 (Trial Edition)
Hash: 1d27ac2
Branch: master
Build date: 2015-09-25 18:08:44-0400

=== Build Information ===

Release ID: 509070012
Git revision: 2635bd7e508e5bc4c19438e45eefdd9a75232ecb
Build date: 2015-09-25 15:52:15-04
Xamarin addins: 6e0ed86be96e8bd589ba9bc0f50d7121c4dd0d30

=== Operating System ===

Mac OS X 10.10.4
Darwin XamnewiMac.local 14.4.0 Darwin Kernel Version 14.4.0
    Thu May 28 11:35:04 PDT 2015
    root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64
Comment 17 Shruti 2015-10-08 09:18:07 UTC
I have checked this issue with C6 X.iOS  9.2.0.85. I am able to build app with
arguments "-gcc_flags -all_load" in release mode. 
Screencast for the same: http://www.screencast.com/t/ukPSyvQHxl
Environment Info: https://gist.github.com/Shruti360/4e8bb3940e5be9d96f87