Xcode 15.0.1 and Xcode 15.1 breaking changes when using link time optimization (works in Xcode 15.0)

The following is occurring when linking a release version of our test suite.

0 0x102d82f9c __assert_rtn + 72 1 0x102d36e08 mach_o::Symbol ld::Layout::symbolForAtom<ld::LinkedAtomPlacement const>(ld::Atom const*, CString, ld::LinkedAtomPlacement const&, ld::DylibMapping const*, unsigned long long) const + 2120 2 0x102d36ff8 void dispatchForEach<ld::AtomAndName const, void ld::buildSymbolTable<ld::LinkedAtomPlacement>(ld::SymbolTableLayout&, ld::Layout const&, ld::Options const&, ld::AtomSymbolPartition const&, ld::LinkedAtomPlacement const&, ld::DylibMapping const*, unsigned long long, bool, bool)::'lambda1'(unsigned long, ld::AtomAndName const&)>(std::__1::span<ld::LinkedAtomPlacement, 18446744073709551615ul>, unsigned long, void ld::buildSymbolTable<ld::LinkedAtomPlacement>(ld::SymbolTableLayout&, ld::Layout const&, ld::Options const&, ld::AtomSymbolPartition const&, ld::LinkedAtomPlacement const&, ld::DylibMapping const*, unsigned long long, bool, bool)::'lambda1'(unsigned long, ld::AtomAndName const&))::'lambda'(unsigned long)::operator()(unsigned long) const + 152 3 0x102d3f17c ld::LayoutExecutable::writeToFile(char const*) + 5004 4 0x102cf362c main + 9604 ld: Assertion failed: (0 && "lto symbol should not be in layout"), function symbolForAtom, file Layout.cpp, line 1447.

Xcode 15 has a new linker implementation, known as ld_prime [1]. Does this problem go away if you (temporarily) switch back to ld64? The Xcode 15 Release Notes explain how to do this.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] For more of the backstory here, see An Apple Library Primer.

Xcode 15.0.1 and Xcode 15.1 breaking changes when using link time optimization (works in Xcode 15.0)
 
 
Q