diff --git a/core/nativeaot/NativeLibrary/README.md b/core/nativeaot/NativeLibrary/README.md index 3eef85a27a6..3c9eae61823 100644 --- a/core/nativeaot/NativeLibrary/README.md +++ b/core/nativeaot/NativeLibrary/README.md @@ -97,12 +97,18 @@ where `` is your project configuration (such as Debug or Release) The above command will drop a static library (Windows `.lib`, OSX/Linux `.a`) in `./bin/[configuration]/netstandard2.0/[RID]/publish/` folder and will have the same name as the folder in which your source file is present. + +
+Extra requirements to link static libraries produced by .NET 7 (click to expand) When linking the generated static library, it is important to also include additional framework dependencies in the linker settings, and add `NativeAOT_StaticInitialization` to the symbol table. This can be accomplished by appending the following flag to the linker settings: * Windows: `/INCLUDE:NativeAOT_StaticInitialization` * Linux: `-Wl,--require-defined,NativeAOT_StaticInitialization` * macOS: `-Wl,-u,_NativeAOT_StaticInitialization` +
+ + You can find a list of additional framework libraries by publishing the project as shared library (`/p:NativeLib=Shared`) with detailed verbosity (`-v d`), and looking at the output generated by the `LinkNative` target. ## References