Bug 51634 - watchOS: enabling LLVM and disabling bitcode causes native link failure
Summary: watchOS: enabling LLVM and disabling bitcode causes native link failure
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: (C10)
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2017-01-19 13:11 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2017-02-07 18:44 UTC (History)
2 users (show)

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


Attachments
build.log (160.20 KB, text/plain)
2017-01-19 13:11 UTC, Rolf Bjarne Kvinge [MSFT]
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 INVALID

Description Rolf Bjarne Kvinge [MSFT] 2017-01-19 13:11:58 UTC
Created attachment 19395 [details]
build.log

Test case:

* Use any watchOS extension project.
* Select a release/device configuration.
* Add --bitcode=marker to the additional mtouch arguments.
* Build

Results in:

> Undefined symbols for architecture armv7k:
>   "___sync_lock_test_and_set_4", referenced from:
>       _mscorlib_System_Threading_SpinLock_ExitSlowPath_bool in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_Tasks_Task_1_TResult_REF_TrySetResult_TResult_REF in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_Tasks_Task_FinishStageTwo in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_Tasks_Task_ExecuteEntry_bool in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_Tasks_Task_CancellationCleanupLogic in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_Tasks_Task_1_TResult_INT_TrySetResult_TResult_INT in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_Tasks_Task_1_TResult_BOOL_TrySetResult_TResult_BOOL in mscorlib.dll.armv7k-llvm.o
>       ...
>   "___sync_fetch_and_add_4", referenced from:
>       _Xamarin_WatchOS_ObjCRuntime_BlockLiteral_CleanupBlock in Xamarin.WatchOS.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_SpinLock_ContinueTryEnter_int_bool_ in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_SpinLock_ExitSlowPath_bool in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_Tasks_Task_AddNewChild in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_Tasks_Task_DisregardChild in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_Tasks_Task_NewId in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Threading_Tasks_Task_Finish_bool in mscorlib.dll.armv7k-llvm.o
>       ...
>   "___sync_synchronize", referenced from:
>       _Xamarin_WatchOS_ObjCRuntime_BlockLiteral_SetupBlock_System_Delegate_System_Delegate in Xamarin.WatchOS.dll.armv7k-llvm.o
>       _Xamarin_WatchOS_System_Collections_Generic_EqualityComparer_1_ObjCRuntime_MethodDescription_get_Default in Xamarin.WatchOS.dll.armv7k-llvm.o
>       _Xamarin_WatchOS_System_Collections_Generic_EqualityComparer_1_T_INTPTR_get_Default in Xamarin.WatchOS.dll.armv7k-llvm.o
>       _Xamarin_WatchOS_System_Collections_Generic_EqualityComparer_1_T_REF_get_Default in Xamarin.WatchOS.dll.armv7k-llvm.o
>       _Xamarin_WatchOS_System_Collections_Generic_EqualityComparer_1_T_INT_get_Default in Xamarin.WatchOS.dll.armv7k-llvm.o
>       _mscorlib_System_ArgumentOutOfRangeException_get_RangeMessage in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Collections_Generic_Comparer_1_T_REF_get_Default in mscorlib.dll.armv7k-llvm.o
>       ...
>   "___sync_val_compare_and_swap_4", referenced from:
>       _Xamarin_WatchOS_Registrar_DynamicRegistrar__GetProtocolMemberAttributesc__Iterator0_System_Collections_Generic_IEnumerable_Foundation_ProtocolMemberAttribute_GetEnumerator in Xamarin.WatchOS.dll.armv7k-llvm.o
>       _mscorlib_System_Collections_Hashtable_get_SyncRoot in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Globalization_CompareInfo_GetCollator in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Text_InternalDecoderBestFitFallbackBuffer_get_InternalSyncObject in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Text_DecoderFallback_get_InternalSyncObject in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Text_InternalEncoderBestFitFallbackBuffer_get_InternalSyncObject in mscorlib.dll.armv7k-llvm.o
>       _mscorlib_System_Text_EncoderFallback_get_InternalSyncObject in mscorlib.dll.armv7k-llvm.o
Comment 1 Zoltan Varga 2017-02-01 21:13:33 UTC
The problem seems to be that when we use --bitcode=marker, we are using our internal llvm to compile the .bc files instead of clang, and the generated code doesn't seem to link.
Comment 2 Zoltan Varga 2017-02-01 21:22:06 UTC
I.e. we are still using the our 2014 fork of llvm which might not be able to generate code which really works on watchos.
Comment 3 Zoltan Varga 2017-02-02 17:47:48 UTC
So I don't think we should/could support this currently.
Comment 4 Rodrigo Kumpera 2017-02-07 18:44:05 UTC
As Zoltan said, we won't support that configuration