I run into this ld assertion error while building an iOS dynamic framework in command line using xcodebuild.
0 0x10163b342 __assert_rtn + 144
1 0x101678a3a archive::File<arm64>::makeObjectFileForMember(archive::File<arm64>::Entry const*) const + 1138
2 0x1016783e8 archive::File<arm64>::justInTimeforEachAtom(char const*, ld::File::AtomHandler&) const + 122
3 0x10168ea75 ld::tool::InputFiles::searchLibraries(char const*, bool, bool, bool, ld::File::AtomHandler&) const + 265
4 0x101697db8 ld::tool::Resolver::resolveUndefines() + 160
5 0x10169a117 ld::tool::Resolver::resolve() + 79
6 0x10163c060 main + 812
7 0x7fff9dd4c5ad start + 1
A linker snapshot was created at:
/tmp/MyKit-2016-02-31-154836.ld-snapshot
ld: Assertion failed: (memberIndex != 0), function makeObjectFileForMember, file /Library/Caches/com.apple.xbs/Sources/ld64/ld64-253.9/src/ld/parsers/archive_file.cpp, line 355.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
According to archive_file.cpp source code (http://www.opensource.apple.com/source/ld64/ld64-253.3/src/ld/parsers/archive_file.cpp) it seems there are some kind of symbol corruption while ld is loading a library. But other than that I have no clue how this issue might be fixed.
This issue shows up only when I try to build my framework with bitcode enabled by adding "-fembed-bitcode" compiler flag.
Also, in my ld command, I am trying to link against a few static libraries, one of them is > 4.25 GB (with bitcode built-in), and this size exceeds an unsigned 32-bit integer's max value (~ 3.99 GB). I previously run into a few issue with libtool related to not being able to handle large binary libs, so this is one of my suspicion.
I wonder if anyone has seen similar problems or figure out how to fix it ? Thanks
a few related questions
Weird xCode linker error I've never seen before saying "Assertion failed"
https://github.com/SciRuby/nmatrix/issues/69
http://lists.llvm.org/pipermail/llvm-dev/2013-October/066722.html