I'm not sure I understand your last sentence. Unless you're running the linker under supervision of a debugger, I don't see how you can "see the error in the linker directly" ? FWIW this error occurs (in the LLVM source code) in llvm/lld/MachO/Driver.cpp around line 500 :
%
static void addFramework(StringRef name, bool isNeeded, bool isWeak,
bool isReexport, bool isExplicit, LoadType loadType) {
if (Optional<StringRef> path = findFramework(name)) {
if (loadedObjectFrameworks.contains(*path))
return;
InputFile *file =
addFile(*path, loadType, /*isLazy=*/false, isExplicit, false);
if (auto *dylibFile = dyn_cast_or_null<DylibFile>(file)) {
if (isNeeded)
dylibFile->forceNeeded = true;
if (isWeak)
dylibFile->forceWeakImport = true;
if (isReexport) {
config->hasReexports = true;
dylibFile->reexport = true;
}
} else if (isa_and_nonnull<ObjFile>(file) ||
isa_and_nonnull<BitcodeFile>(file)) {
// Cache frameworks containing object or bitcode files to avoid duplicate
// symbols. Frameworks containing static archives are cached separately
// in addFile() to share caching with libraries, and frameworks
// containing dylibs should allow overwriting of attributes such as
// forceNeeded by subsequent loads
loadedObjectFrameworks.insert(*path);
}
return;
}
error("framework not found for -framework " + name);
}
%
There are several ways a framework specification can be added to the linker's inputs. One of them is through command-line flags (the -framework option). Another one is when implicit (auto-linked) frameworks are encountered in a dylib or framework TDB specification file in the iOS SDK. This occurs when a library or framework is dependent on another one. The Apple linker allows the linking to continue (for in case the framework functions that do depend on the other framework are never called, this won't be a problem and the app is safe), whereas the LLVM linker systematically stops. I just patched it so that it'll continue, in alignment with what Apple's ld64 does and I'm looking for different test cases to validate the change. But you can test it right away : download this updated linker from https://www.pmbaty.com/iosbuildenv/ld64.lld.zip and extract it into the Toolchain directory of the builder's install path. Re-run your script with the -lld flag and let me know what happens.
*edit* I found the crash bug in the Apple linker today. If I'm not too unlucky, the next release of the builder will be able to build your project without crashing with the Apple linker (ld64).