Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mono] Fix iOS/tvOS build with Xcode 14 #76433

Merged
merged 1 commit into from
Sep 30, 2022

Conversation

akoeplinger
Copy link
Member

Before Xcode 14 the objc_super struct definition in the SDK headers looked like this:

#if !defined(__cplusplus)  &&  !__OBJC2__
    /* For compatibility with old objc-runtime.h header */
    __unsafe_unretained _Nonnull Class class;
#else
    __unsafe_unretained _Nonnull Class super_class;
#endif

With Xcode 14 however the iOS/tvOS SDK header was changed to only define super_class, but the MacOSX SDK stayed the same.

Added CMake detection of this case so we can compile both on older and newer Xcode SDKs across platforms.

Before Xcode 14 the `objc_super` struct definition in the SDK headers looked like this:

```
#if !defined(__cplusplus)  &&  !__OBJC2__
    /* For compatibility with old objc-runtime.h header */
    __unsafe_unretained _Nonnull Class class;
#else
    __unsafe_unretained _Nonnull Class super_class;
#endif
```

With Xcode 14 however the iOS/tvOS SDK header was changed to only define `super_class`, but the MacOSX SDK stayed the same.

Added CMake detection of this case so we can compile both on older and newer Xcode SDKs across platforms.
@lewing
Copy link
Member

lewing commented Sep 30, 2022

wasm failures are #76429

Copy link
Member

@mdh1418 mdh1418 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@akoeplinger
Copy link
Member Author

The failures are known issues.

@akoeplinger akoeplinger merged commit d6f4ee1 into dotnet:main Sep 30, 2022
@akoeplinger akoeplinger deleted the fix-xcode14 branch September 30, 2022 14:11
@akoeplinger
Copy link
Member Author

/backport to release/7.0

@akoeplinger
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3159385932

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/3159386632

@github-actions
Copy link
Contributor

@akoeplinger backporting to release/6.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: [mono] Fix iOS/tvOS build with Xcode 14
Using index info to reconstruct a base tree...
M	src/mono/cmake/config.h.in
M	src/mono/cmake/configure.cmake
M	src/mono/mono/utils/mono-threads-mach-helper.c
Falling back to patching base and 3-way merge...
Auto-merging src/mono/mono/utils/mono-threads-mach-helper.c
Auto-merging src/mono/cmake/configure.cmake
Auto-merging src/mono/cmake/config.h.in
CONFLICT (content): Merge conflict in src/mono/cmake/config.h.in
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 [mono] Fix iOS/tvOS build with Xcode 14
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

akoeplinger added a commit to akoeplinger/runtime that referenced this pull request Sep 30, 2022
Before Xcode 14 the `objc_super` struct definition in the SDK headers looked like this:

```
#if !defined(__cplusplus)  &&  !__OBJC2__
    /* For compatibility with old objc-runtime.h header */
    __unsafe_unretained _Nonnull Class class;
#else
    __unsafe_unretained _Nonnull Class super_class;
#endif
```

With Xcode 14 however the iOS/tvOS SDK header was changed to only define `super_class`, but the MacOSX SDK stayed the same.

Added CMake detection of this case so we can compile both on older and newer Xcode SDKs across platforms.

(cherry picked from commit d6f4ee1)

# Conflicts:
#	src/mono/cmake/config.h.in
carlossanlop pushed a commit that referenced this pull request Oct 5, 2022
Before Xcode 14 the `objc_super` struct definition in the SDK headers looked like this:

```
#if !defined(__cplusplus)  &&  !__OBJC2__
    /* For compatibility with old objc-runtime.h header */
    __unsafe_unretained _Nonnull Class class;
#else
    __unsafe_unretained _Nonnull Class super_class;
#endif
```

With Xcode 14 however the iOS/tvOS SDK header was changed to only define `super_class`, but the MacOSX SDK stayed the same.

Added CMake detection of this case so we can compile both on older and newer Xcode SDKs across platforms.

(cherry picked from commit d6f4ee1)

# Conflicts:
#	src/mono/cmake/config.h.in
@lambdageek
Copy link
Member

/azp run sync-runtime-to-mono

@ghost ghost locked as resolved and limited conversation to collaborators Nov 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants