When building with lazy initialization of the root conformance, we need
to ensure that we are invoking the accessor to initialize the
conformance record. We would previously generate a direct reference to
the conformance, which was uninitialized, resulting in a crash at
runtime.
The non-windows test changes here are to use/imply static linking for
the support modules. This should have no difference on the non-Windows
targets, but makes a difference on Windows where this implies that
everything will be built into a single module, which permits the
non-indirect access to types. Unfortunately, this does somewhat regress
the test coverage on Windows as we do not exercise as much of the shared
linkage paths which do change some of the code-generation to deal with
the moral equivalent of the GOT - the IAT.
Special thanks to @slavapestov for the pointer to
`isDependentConformance`. This should eliminate the last known issue
with cross-module protocol conformances.
Fixes: SR-14807
Windows does not permit cross-module data accesses to be direct. This
is a problem for public protocols with root conformances which are
external. Use a runtime initialiser for the root protocol conformance
chaining to alleviate this issue. This shows up in the Foundation
build.