Bug 8365 - Linking process now broken for missing architectures
Summary: Linking process now broken for missing architectures
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: Normal major
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2012-11-13 06:56 UTC by Chris Hatton
Modified: 2012-11-13 12:40 UTC (History)
4 users (show)

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


Attachments
Example project isolating the issue (416.48 KB, application/zip)
2012-11-13 06:56 UTC, Chris Hatton
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:
RESOLVED FIXED

Description Chris Hatton 2012-11-13 06:56:22 UTC
Created attachment 2911 [details]
Example project isolating the issue

Example project attached.

We use a Barcode scanning binary library which does not have an i386 slice. This has been a component of our project going back a year. Whenever we build for Simulator, the library is silently left unlinked and the barcode scanning features do not work. This is the desired and expected behaviour and is confirmed in 6.0.2 (though suspected ok up to 6.0.5).

However now in MonoTouch 6.0.6 the linker incorrectly expects to find the Barcode scanning library in the build folder and fails the build because of it.

Lines extracted from the build log:

warning MT1301: Native library `libVSBarcodeReader_v5_5_nothumb_iOS4.a` (armv6, armv7) was ignored since it does not match the current build architecture (i386)

(Correct. Then later...)

ld: file not found: /var/folders/p9/ttsk458j2lbdngcngb046zcc0000gn/T/tmp5928ea13.tmp/libVSBarcodeReader_v5_5_nothumb_iOS4.a
collect2: ld returned 1 exit status
error MT5202: Native linking failed. Please review the build log.

ld Should not have been requested to link this file?

Isolating this in an example project could not have been simpler. On a secondary machine with MT 6.0.2 I created a new project, included the Barcode library, and made a single reference to it in DidFinishLaunching. This build for i386 as expected and I was given the warning that the library would not be linked.

Opened the same project in 6.0.6 and the error above occurred.
Comment 1 Sebastien Pouliot 2012-11-13 10:09:46 UTC
It worked on 6.0.2 - but it looks like it did only because it did not try to rebuild the simlauncher (i.e. the `ld`command itself would be invalid, but it's not issued).


/Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode.app/Contents/Developer" -v --cache "/Users/sebastienpouliot/Downloads/CompileTest/CompileTest/obj/Debug/mtouch-cache" --nomanifest --nosign -sim "/Users/sebastienpouliot/Downloads/CompileTest/CompileTest/bin/iPhoneSimulator/Debug/CompileTest.app" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -r "/Users/sebastienpouliot/Downloads/CompileTest/CompileTest/BarcodeReader-Release.dll" -debug -nolink -sdk "6.0" -targetver "3.1" --armv7 "-v" "-v" "-v" "/Users/sebastienpouliot/Downloads/CompileTest/CompileTest/bin/iPhoneSimulator/Debug/CompileTest.exe"
MonoTouch version 6.0.2.1348750907 using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk
warning MT1301: Native library `libVSBarcodeReader_v5_5_nothumb_iOS4.a` (ARMv6, ARMv7) was ignored since it does not match the current build architecture (i386)
Comment 2 Sebastien Pouliot 2012-11-13 11:24:58 UTC
This "rebuild simlauncher" started with the refactoring for armv7s support (after 6.0.4, before 6.0.5)
revision: afef5453155277c77e2610e29b330c234d38977c
Comment 3 Sebastien Pouliot 2012-11-13 12:40:55 UTC
The linker flags were still added even if the library itself was removed (skipping the fastpah/simlauncher).

Fixed in:

ios6: 6b0893313b0705b6cf685931310c104e2da2b275
master: 6e22f4a518012e9f1a8b2f9c67da6631df6362b6