Skip to content
This repository was archived by the owner on Feb 15, 2023. It is now read-only.

Commit 5776b3c

Browse files
authored
Add list of workarounds in error message for objc selector stubs (#117)
1 parent da4c431 commit 5776b3c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ld/src/ld/Resolver.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,11 @@ void Resolver::checkUndefines(bool force)
15091509
for (int i=0; i < unresolvableCount; ++i) {
15101510
const char* name = unresolvableUndefines[i];
15111511
unsigned int slot = _symbolTable.findSlotForName(name);
1512-
fprintf(stderr, " \"%s\", referenced from:\n", _options.demangleSymbol(name));
1512+
if (strstr(name, "_objc_msgSend")) {
1513+
fprintf(stderr, " \"%s - this is a zld/Xcode 14 issue, see the bottom of the full error message for details\", referenced from:\n", _options.demangleSymbol(name));
1514+
} else {
1515+
fprintf(stderr, " \"%s\", referenced from:\n", _options.demangleSymbol(name));
1516+
}
15131517
// scan all atoms for references
15141518
bool foundAtomReference = printReferencedBy(name, slot);
15151519
// scan command line options
@@ -1564,6 +1568,12 @@ void Resolver::checkUndefines(bool force)
15641568
fprintf(stderr, " NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.\n");
15651569
}
15661570
}
1571+
for (const auto &name : unresolvableUndefines) {
1572+
if (strstr(name, "_objc_msgSend")) {
1573+
fprintf(stderr, "****************************\nNOTE: at least one missing symbol is due to changes in Xcode 14 (https://github.com/michaeleisel/zld/issues/113). Here are some workarounds:\n- Add the -fno-objc-msgsend-selector-stubs *compiler* flag to your build\n- Switch to lld, another fast alternative to ld64\n****************************\n");
1574+
break;
1575+
}
1576+
}
15671577
}
15681578
if ( doError )
15691579
throw "symbol(s) not found";

0 commit comments

Comments
 (0)