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

Spurious Warnings in Xcode 15 #8301

Closed
bdkjones opened this issue Jul 13, 2023 · 6 comments
Closed

Spurious Warnings in Xcode 15 #8301

bdkjones opened this issue Jul 13, 2023 · 6 comments

Comments

@bdkjones
Copy link

How frequently does the bug occur?

Always

Description

This may be related to #8251, but I recently added Realm to a project that I'm compiling with Xcode 15 beta 3 and I get 37 gobbledegook warnings about debug notes:

Screenshot 2023-07-13 at 00 02 15

And I get a warning about duplicating the lc++ library:

Screenshot 2023-07-13 at 00 02 25

(Nothing in this app uses C++ other than Realm.)

Stacktrace & log output

N/A

Can you reproduce the bug?

Always

Reproduction Steps

Include Realm in an app, then build it with Xcode 15 beta 3.

Version

10.40.2

What Atlas Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

macOS 13.4.1

Build environment

Xcode version: 15 beta 3
Dependency manager and version: SPM via Xcode

@dianaafanador3
Copy link
Contributor

dianaafanador3 commented Jul 13, 2023

@bdkjones thanks for letting us know about this.
This issue appears since Xcode 15 beta and it's still happening on Xcode 15 beta 4, and by the looks of it seems like it is an Apple Bug. It seems like the linker is finding multiple occurrence of the same library, in concrete c++, and may be related to the introduction of C++ interoperability, but I'm not completely sure.
We'll keep this issue open so we can track any changes on future releases.

@dianaafanador3
Copy link
Contributor

Some of this warnings have dissapeared on Xcode 15 Beta 5, the only one remaining is
Ignoring duplicate library '-lc++'.

@bdkjones
Copy link
Author

bdkjones commented Sep 11, 2023

@dianaafanador3 The remaining warning about duplicate C++ libraries still exists in Xcode 15 Beta 8.

The consensus is that since Apple added C++ interoperability (and therefore now link the C++ library by default) they forgot to handle all the many libraries that explicitly included the C++ libraries: getsentry/sentry-cocoa#3122 (comment)

I think this spurious warning is going to remain until Apple either gets their act together or Realm explicitly removes the C++ libraries when the build is done with Xcode 15+.

If it's possible for Realm to conditionally link the C++ libraries only for older Xcode releases, that would likely eliminate this last warning.

@sync-by-unito sync-by-unito bot removed the T-Bug label Sep 12, 2023
@vg-identance
Copy link

bump (Xcode 15 released and issue still exists)

@bdkjones
Copy link
Author

bdkjones commented Oct 9, 2023

This discussion explains the cause and a way for users to address it via a build flag:

https://indiestack.com/2023/10/xcode-15-duplicate-library-linker-warnings/

The following text should be added to "Other Linker Flags" in your Build Settings. Note: the text is one single entry and the spacing matters. You're passing this option through the compiler, down to the linker:

"-Wl,-no_warn_duplicate_libraries"

@bdkjones bdkjones closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2023
@bdkjones
Copy link
Author

Closed the issue because the bug is Apple's and Realm can't solve it.

@sync-by-unito sync-by-unito bot reopened this Feb 16, 2024
@sync-by-unito sync-by-unito bot closed this as completed Feb 19, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants