|
Another wrinkle for this ticket: it appears that the load commands size of 32768 is only one constraint we must satisfy. Interstingly, hygienic builds has moved us in the right direction on this, however, there is another constraint, as revealed by running on master:
./build/install/bin/mongod
|
dyld: Library not loaded: @rpath/libmongod_initializers.dylib
|
Referenced from: build/install/lib/libmongod_main.dylib
|
Reason: no suitable image found. Did find:
|
build/install/lib/../lib/libmongod_initializers.dylib: too many dependent dylibs in build/install/lib/../lib/libmongod_initializers.dylib
|
build/install/lib/../lib/libmongod_initializers.dylib: stat() failed with errno=1
|
build/install/bin/../lib/libmongod_initializers.dylib: too many dependent dylibs in build/install/bin/../lib/libmongod_initializers.dylib
|
[1] 29234 abort ./build/install/bin/mongod
|
It appears that there is hard-coded upper bound of 512 dynamic dependencies. Look for too many dependent dylibs in https://opensource.apple.com/source/dyld/dyld-733.6/src/ImageLoader.cpp.auto.html.
If we look at libmongod_initializers.dylib we see that we currently have 530:
$ otool -l /build/install/lib/../lib/libmongod_initializers.dylib | grep cmdsize | wc -l
|
530
|
So, we may not actually be able to solve this problem until we simplify the link graph, or are able to move many more libraries to LIBDEPS_PRIVATE.
|