Bug 18521 - SQLCipher only working with no link settings
Summary: SQLCipher only working with no link settings
Status: RESOLVED UPSTREAM
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: master
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Alex Soto [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2014-03-21 14:36 UTC by Michael Lukas
Modified: 2015-01-05 15:33 UTC (History)
3 users (show)

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


Attachments
Build Output (7.52 KB, text/plain)
2014-03-21 14:36 UTC, Michael Lukas
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 UPSTREAM

Description Michael Lukas 2014-03-21 14:36:58 UTC
Created attachment 6383 [details]
Build Output

After reading http://docs.xamarin.com/guides/ios/advanced_topics/linker/ ( If your application only works with -nolink, please submit a bug report.) I decided to report a bug with SQLCipher.

After downloading SQLCipher and testing their example I saw that it only works with no link activated.

Attached is the build output.

Not sure if im correct with reporting this here or should I report it @ sqlcipher ?
Comment 1 Sebastien Pouliot 2014-03-21 16:40:23 UTC
You can report it here first.

In this case it's not a managed linker issue - but a native linker one.

What happens is that the component is missing a Framework, -framework=Security, so the native linker report it's missing.

error MT5210: Native linking failed, undefined symbol: _SecRandomCopyBytes. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
error MT5210: Native linking failed, undefined symbol: _kSecRandomDefault. 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.


Now why does it works when disabling the managed linker ?

When set to "Don't link" your application will include a lot of extra code from monotouch.dll - that include codes that requires the Security framework, so it gets included (indirectly) and the _native_ linker is happy.


You should be able to re-enable the linker by adding a:

-gcc_flags="-framework Security"

to your project options, Additional mtouch arguments

c.c. Alex (for component fix)
Comment 2 Alex Soto [MSFT] 2014-03-21 17:00:28 UTC
Hello Michael

We will report this to Sqlcipher ASAP but also if you report it to http://sqlcipher.net/support/ might help to speed things up a bit.

Thanks for letting us know about this.

Alex
Comment 3 Alex Soto [MSFT] 2015-01-05 15:33:27 UTC
As per comment #2