xcodebuildlinkersettingsflags

ld_classic will be deprecated in Xcode?


I am getting a warning in Xcode 16.0 that says "-ld_classic is deprecated and will be removed in a future release". I don't if I am supposed to replace ld_classic, although if I want to I can simply erase it. It can be found in Xcode Target -> Build Settings -> Other Linker Flags.

What is ld-classic? How can handle the warning? The only link I found on ld-classic and a possible solution is this: https://github.com/xamarin/xamarin-macios/issues/20711

It says "[dotnet] Change the usage of the classic linker to be opt-in. (#21231)", but that seems to be in reference to Xamarin.

Can anybody enlighten me on this issue, please?

PS. Stack Overflow won't let me add ld_classic as a tag since I don't have enough reputation points.


Solution

  • I have this flag set too. The purpose of this was to force Xcode to use the older linker rather than the new one released Sep 2023 with Xcode 15.

    In my case the flag itself has been added around August 2023. I have annotated that change with the following quote from Xcode release notes:

    Binaries using symbols with a weak definition crash at runtime on iOS 14/macOS 12 or older. This impacts primarily C++ projects due to their extensive use of weak symbols. (114813650) (FB13097713) Workaround: Bump the minimum deployment target to iOS 15, macOS 12, watchOS 8 or tvOS 15, or add -Wl,-ld_classic to the OTHER_LDFLAGS build setting.

    And the link https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking

    As I recall, my project was not crashing but staying with classic linker was addressing some build-related warnings at that time.

    Probably you can try removing that flag and test the app behaviour depending on supported OS versions and dependencies.