Bug 58901 - Breaking ABI change on 32 bits with xcode 8.3 or newer
Summary: Breaking ABI change on 32 bits with xcode 8.3 or newer
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-08-19 03:53 UTC by Zoltan Varga
Modified: 2017-09-07 17:11 UTC (History)
6 users (show)

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

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 for Bug 58901 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Zoltan Varga 2017-08-19 03:53:21 UTC
The problem seems to be caused by the handling of empty structures. For this code:
typedef struct {
} AStruct;

AStruct ret (int a) {
        AStruct s;
        if (a == 42)
                printf (".\n");
        return s;

xcode73-s clang -emit-llvm generates:

define void @ret(%struct.AStruct* noalias sret %agg.result, i32 %a) #0 {

xcode83-s clang generates:

define void @ret(i32) #0 {

The empty structure is no longer passed to the llvm backend at all, causing it to generate different code.
Comment 1 Zoltan Varga 2017-08-19 04:01:22 UTC
The change which introduced this seems to be clang bc350ca21c51e341427c7f96dc21fc1bd8f73a2b.
Comment 2 Bernhard Urban 2017-08-21 15:36:35 UTC
reminder: please revert https://github.com/mono/mono/pull/5411 once this bug is resolved.
Comment 3 Zoltan Varga 2017-08-22 03:36:35 UTC
Comment 4 Zoltan Varga 2017-08-22 18:52:48 UTC
Comment 5 Marek Safar 2017-08-22 22:04:03 UTC
I think even if this is a corner case we should follow and update to the latest ABI unless we get clear response that they are reverting the change.

We could introduce LEGACY_CLANG_EMPTY_STRUCT to control the behaviour.