Frontend: re-serialise static library status

When compiling the swiftmodule from the textual swift interface, ensure
that we re-serialise the static or dynamic nature of the module. This is
required for proper code generation where the static and dynamic linking
is material to symbolic references. This also opens the possibility of
optimizations on other platforms via internalisation of the symbols.

Fixes: #77756
This commit is contained in:
Saleem Abdulrasool
2024-11-27 09:58:36 -08:00
parent b13544e44c
commit b660d20c85
4 changed files with 28 additions and 0 deletions

View File

@@ -279,6 +279,7 @@ std::error_code ExplicitModuleInterfaceBuilder::buildSwiftModuleFromInterface(
// optimization pipeline.
SerializationOptions SerializationOpts;
std::string OutPathStr = OutputPath.str();
SerializationOpts.StaticLibrary = FEOpts.Static;
SerializationOpts.OutputPath = OutPathStr.c_str();
SerializationOpts.ModuleLinkName = FEOpts.ModuleLinkName;
SerializationOpts.AutolinkForceLoad =