Xcode 15 issues - my temporary workaround

Christopher Jones jonesc at hep.phy.cam.ac.uk
Wed Sep 27 12:08:52 UTC 2023


Hi,

Thanks. We will need to see how widespread problems are due to this, but we might need to. at least temporarily, set this as the default in some central place if it ends up affecting a lot of ports. 

Just to note, a potentially more convenient way to force the legacy linker is via the environment variable

OTHER_LDFLAGS=-Wl,-ld_classic

as that can be set, as appropriate, and thus avoids the need to ensure build options get passed.

https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Linking
Xcode 15 Release Notes | Apple Developer Documentation
developer.apple.com

At the moment most issues see isolated to places where gcc, or binaries built with gcc are used. My guess is eventually GCC will have to adapt to support the new linker.

Chris


> On 25 Sep 2023, at 11:10 pm, CC <copious-commotion at cobaltmailbox.com> wrote:
> 
> Hi -
> 
> Instead of reverting to Xcode 14, I have had success (so far) by forcing the linker to use the "classic" version.  Xcode 15 switched the default to Apple's newer "prime" linker.
> 
> what I did --
> - start with a clean slate (mv /opt/local /opt/local.0; mv /Applications/MacPorts /Applications/MacPorts.0)
> - install macports from macports-base repo
> - "port install ld64" (which should install ld64-xcode)
> - edit /opt/local/bin/ld to add "-ld_classic" option (see below)
> 
> "libgcc12" was my test port and it worked after I did the above.  I hope this helps others while we wait for someone with more knowledge to dig deeper into issues with the new linker.<ld.txt>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20230927/3fef918b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: developer-og.jpg
Type: image/jpeg
Size: 39580 bytes
Desc: not available
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20230927/3fef918b/attachment.jpg>


More information about the macports-users mailing list