Bug 58861 - dynamic-symbol-mode does not work with 32-bit mac libraries
Summary: dynamic-symbol-mode does not work with 32-bit mac libraries
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: mmp ()
Version: 3.8.0 (d15-4)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2017-08-17 19:46 UTC by Chris Hamons
Modified: 2017-08-24 07:47 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: Yes
Last known good build: Reported as d15-2


Attachments
Repro (385.63 KB, application/zip)
2017-08-17 19:46 UTC, Chris Hamons
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 Hamons 2017-08-17 19:46:17 UTC
Created attachment 24281 [details]
Repro

The dynamic symbol mode code causes 32-bit XM applications to fail with errors such as this

    Undefined symbols for architecture i386:
      "_OBJC_CLASS_$_MyClass", referenced from:
         -u command line option
    ld: symbol(s) not found for architecture i386

as the symbol only exists for 64-bit libraries:

https://gist.github.com/chamons/9ec9d5fc8093515c2cba98bc2b596851

Steps to reproduce:

- Unzip attached project
- Build and run. Note that it works
- Remove --dynamic-symbol-mode:ignore from mmp arguments in Mobile32 and compare
Comment 1 Chris Hamons 2017-08-17 19:48:27 UTC
Work around is to add "--dynamic-symbol-mode:ignore" to any top level XM projects that are 32-bit are affected.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2017-08-18 11:46:58 UTC
https://github.com/xamarin/xamarin-macios/pull/2506
Comment 3 Rolf Bjarne Kvinge [MSFT] 2017-08-18 11:49:50 UTC
@Chris, the test app crashes now with:

> Native type size mismatch between Xamarin.Mac.dll and the executing architecture. Xamarin.Mac.dll was built for 64-bit, while the current process is 32-bit.

which looks like another issue you were looking at, which I assume means you're creating a test case for that other issue, and in that case that test case would cover this bug as well. Or should I add a separate test case for this fix?
Comment 4 Chris Hamons 2017-08-18 13:16:57 UTC
That issue is filed here:

https://github.com/xamarin/xamarin-macios/pull/2503

but the test apps are slightly different. That test was using a managed 32-bit library and hitting a managed name resolution issue. 

This bug would need a 32-bit native library linked in with a binding project.

I can help create a test for this if you'd like though.