Friday, March 15, 2024

Xcode 15: “no platform load command found”

Wade Tregaskis:

Apple’s new linker appears to be much more pedantic than the old one – it warns about a lot of things that the old one didn’t care about. One of these is missing platform load commands:

/Users/SadPanda/Documents/vmaf/libvmaf/ld:1:1: no platform load command found in 'src/libvmaf.a[62](cpuid.obj)', assuming: macOS

This doesn’t technically break anything – assuming it guessed the platform correctly, which I suspect it just takes as being the host’s platform – but it’s super annoying because it’s emitted for every afflicted object file the linker sees (that’s individual files, even if they’re buried in archive files – e.g. libfoo.a). You can have hundreds or even thousands of these warnings for a single library. Worse, they’re emitted when you link against the library, not just when you build it. And with nested static libraries they can propagate up a build chain endlessly.

I’ve been seeing this with the old eSellerate library, which fortunately I won’t need for much longer, as I don’t know how long the -Wl,-ld_classic workaround to use the old ld64 linker will last.

Previously:

Comments RSS · Twitter · Mastodon

Leave a Comment