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
Status: CONFIRMED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-19 03:53 UTC by Zoltan Varga
Modified: 2017-09-07 17:11 UTC (History)
6 users (show)

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


Attachments

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 {

while
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
https://bugs.llvm.org/show_bug.cgi?id=34272
Comment 4 Zoltan Varga 2017-08-22 18:52:48 UTC
https://github.com/mono/mono/pull/5423
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.

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

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.

Note You need to log in before you can comment on or make changes to this bug.